about summary refs log tree commit diff
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
commite79dc7656a5664a6daf1b4a1f521bf1c6c6b30a1 (patch)
tree77a125208c29e33b21a54348b551b2ca950b08c5
parentafef64c1bd36a85f71f739e09c901cc6209c82bd (diff)
downloadrust-e79dc7656a5664a6daf1b4a1f521bf1c6c6b30a1.tar.gz
rust-e79dc7656a5664a6daf1b4a1f521bf1c6c6b30a1.zip
`bug!` more uses of these in runtime stuff
-rw-r--r--src/base.rs21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/base.rs b/src/base.rs
index 6d26ca0b899..b117dc496c2 100644
--- a/src/base.rs
+++ b/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