rust/tests/mir-opt/dataflow-const-prop/default_boxed_slice.rs
2023-12-24 20:08:57 +00:00

19 lines
566 B
Rust

// skip-filecheck
// unit-test: DataflowConstProp
// compile-flags: -Zmir-enable-passes=+GVN,+Inline
// ignore-debug assertions change the output MIR
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
struct A {
foo: Box<[bool]>,
}
// EMIT_MIR default_boxed_slice.main.GVN.diff
// EMIT_MIR default_boxed_slice.main.DataflowConstProp.diff
fn main() {
// ConstProp will create a constant of type `Box<[bool]>`.
// Verify that `DataflowConstProp` does not ICE trying to dereference it directly.
let a: A = A { foo: Box::default() };
}