rust/tests/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff
Nilstrieb 2beabbbf6f Rename adjustment::PointerCast and variants using it to PointerCoercion
It makes it sound like the `ExprKind` and `Rvalue` are supposed to represent all pointer related
casts, when in reality their just used to share a some enum variants. Make it clear there these
are only coercion to make it clear why only some pointer related "casts" are in the enum.
2023-07-07 18:17:16 +02:00

47 lines
1.1 KiB
Diff

- // MIR for `BAR` before PromoteTemps
+ // MIR for `BAR` after PromoteTemps
static mut BAR: *const &i32 = {
let mut _0: *const &i32;
let mut _1: &[&i32];
let mut _2: &[&i32; 1];
let _3: [&i32; 1];
let mut _4: &i32;
let _5: &i32;
+ let mut _6: &[&i32; 1];
bb0: {
StorageLive(_1);
StorageLive(_2);
- StorageLive(_3);
- StorageLive(_4);
- StorageLive(_5);
- _5 = const {alloc1: &i32};
- _4 = &(*_5);
- _3 = [move _4];
- _2 = &_3;
+ _6 = const _;
+ _2 = &(*_6);
_1 = move _2 as &[&i32] (PointerCoercion(Unsize));
- StorageDead(_4);
StorageDead(_2);
_0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2];
}
bb1: {
- StorageDead(_5);
- StorageDead(_3);
StorageDead(_1);
return;
}
bb2 (cleanup): {
resume;
}
- }
-
- alloc1 (static: Y, size: 4, align: 4) {
- 2a 00 00 00 │ *...
}