Skip to content

Commit 32d11e6

Browse files
committed
Handle new cast kinds in clippy and cranelift
1 parent 7b9502d commit 32d11e6

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

compiler/rustc_codegen_cranelift/src/base.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -610,17 +610,13 @@ fn codegen_stmt<'tcx>(
610610
}
611611
}
612612
Rvalue::Cast(
613-
CastKind::Pointer(PointerCast::UnsafeFnPointer),
614-
ref operand,
615-
to_ty,
616-
)
617-
| Rvalue::Cast(
618-
CastKind::Pointer(PointerCast::MutToConstPointer),
619-
ref operand,
620-
to_ty,
621-
)
622-
| Rvalue::Cast(
623-
CastKind::Pointer(PointerCast::ArrayToPointer),
613+
CastKind::StripPattern
614+
| CastKind::Patternize
615+
| CastKind::Pointer(
616+
PointerCast::UnsafeFnPointer
617+
| PointerCast::MutToConstPointer
618+
| PointerCast::ArrayToPointer,
619+
),
624620
ref operand,
625621
to_ty,
626622
) => {

src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs

+2
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ fn check_rvalue<'tcx>(
133133
| Rvalue::Use(operand)
134134
| Rvalue::Cast(
135135
CastKind::PointerFromExposedAddress
136+
| CastKind::StripPattern
137+
| CastKind::Patternize
136138
| CastKind::IntToInt
137139
| CastKind::FloatToInt
138140
| CastKind::IntToFloat

0 commit comments

Comments
 (0)