about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-05-02 14:02:29 +0000
committerbors <bors@rust-lang.org>2023-05-02 14:02:29 +0000
commit9d795a6e6e19d56b235d1dbd4f5941404cf5918c (patch)
tree21af69303742ed60373248ad943d166e805a2197 /compiler/rustc_mir_transform/src
parent98c33e47a495fbd7b22bce9ce32f2815991bc414 (diff)
parentf08f903fa9866c6235714c6b0d7b1a33c7671a48 (diff)
downloadrust-9d795a6e6e19d56b235d1dbd4f5941404cf5918c.tar.gz
rust-9d795a6e6e19d56b235d1dbd4f5941404cf5918c.zip
Auto merge of #111082 - saethlin:box-assertkind, r=saethlin
Box AssertKind

r? `@nnethercote` this feels like your kind of thing

I want to add a new variant to `AssertKind` that needs 3 operands, and that ends up breaking a bunch of size assertions. So... what if we go the opposite direction first; shrinking `AssertKind` by boxing it?
Diffstat (limited to 'compiler/rustc_mir_transform/src')
-rw-r--r--compiler/rustc_mir_transform/src/check_alignment.rs4
-rw-r--r--compiler/rustc_mir_transform/src/generator.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_mir_transform/src/check_alignment.rs b/compiler/rustc_mir_transform/src/check_alignment.rs
index e99712eeef8..d60184e0ebe 100644
--- a/compiler/rustc_mir_transform/src/check_alignment.rs
+++ b/compiler/rustc_mir_transform/src/check_alignment.rs
@@ -224,10 +224,10 @@ fn insert_alignment_check<'tcx>(
             cond: Operand::Copy(is_ok),
             expected: true,
             target: new_block,
-            msg: AssertKind::MisalignedPointerDereference {
+            msg: Box::new(AssertKind::MisalignedPointerDereference {
                 required: Operand::Copy(alignment),
                 found: Operand::Copy(addr),
-            },
+            }),
             unwind: UnwindAction::Terminate,
         },
     });
diff --git a/compiler/rustc_mir_transform/src/generator.rs b/compiler/rustc_mir_transform/src/generator.rs
index e44dd084b2d..ff1745300da 100644
--- a/compiler/rustc_mir_transform/src/generator.rs
+++ b/compiler/rustc_mir_transform/src/generator.rs
@@ -1150,7 +1150,7 @@ fn insert_panic_block<'tcx>(
             literal: ConstantKind::from_bool(tcx, false),
         })),
         expected: true,
-        msg: message,
+        msg: Box::new(message),
         target: assert_block,
         unwind: UnwindAction::Continue,
     };