about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/base.rs
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2024-06-14 23:01:22 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2024-06-19 10:44:01 -0700
commite04e35133f28426df9fa61f9703da957d99b48d8 (patch)
treed8a4e6cca8ba5ce3752e0e56f6520f4d5e18f873 /compiler/rustc_codegen_cranelift/src/base.rs
parent4630d1b23b996793e9188490cc99b1576176233f (diff)
downloadrust-e04e35133f28426df9fa61f9703da957d99b48d8.tar.gz
rust-e04e35133f28426df9fa61f9703da957d99b48d8.zip
`bug!` more uses of these in runtime stuff
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/base.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/src/base.rs21
1 files changed, 11 insertions, 10 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/base.rs b/compiler/rustc_codegen_cranelift/src/base.rs
index 6d26ca0b899..b117dc496c2 100644
--- a/compiler/rustc_codegen_cranelift/src/base.rs
+++ b/compiler/rustc_codegen_cranelift/src/base.rs
@@ -677,22 +677,23 @@ fn codegen_stmt<'tcx>(
                     CastKind::PointerCoercion(PointerCoercion::UnsafeFnPointer),
                     ref operand,
                     to_ty,
-                )
-                | Rvalue::Cast(
-                    CastKind::PointerCoercion(PointerCoercion::MutToConstPointer),
-                    ref operand,
-                    to_ty,
-                )
-                | Rvalue::Cast(
-                    CastKind::PointerCoercion(PointerCoercion::ArrayToPointer),
-                    ref operand,
-                    to_ty,
                 ) => {
                     let to_layout = fx.layout_of(fx.monomorphize(to_ty));
                     let operand = codegen_operand(fx, operand);
                     lval.write_cvalue(fx, operand.cast_pointer_to(to_layout));
                 }
                 Rvalue::Cast(
+                    CastKind::PointerCoercion(
+                        PointerCoercion::MutToConstPointer | PointerCoercion::ArrayToPointer,
+                    ),
+                    ..,
+                ) => {
+                    bug!(
+                        "{:?} is for borrowck, and should never appear in codegen",
+                        to_place_and_rval.1
+                    );
+                }
+                Rvalue::Cast(
                     CastKind::IntToInt
                     | CastKind::FloatToFloat
                     | CastKind::FloatToInt