2019-12-26 14:50:40 +01:00
|
|
|
extern "C" {
|
|
|
|
static X: i32;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Y: i32 = 42;
|
|
|
|
|
2020-03-11 11:49:00 +01:00
|
|
|
// EMIT_MIR rustc.BAR.PromoteTemps.diff
|
|
|
|
// EMIT_MIR rustc.BAR-promoted[0].ConstProp.after.mir
|
2020-02-15 12:13:20 +00:00
|
|
|
static mut BAR: *const &i32 = [&Y].as_ptr();
|
2019-12-26 14:50:40 +01:00
|
|
|
|
2020-03-11 11:49:00 +01:00
|
|
|
// EMIT_MIR rustc.FOO.PromoteTemps.diff
|
|
|
|
// EMIT_MIR rustc.FOO-promoted[0].ConstProp.after.mir
|
2020-02-15 12:13:20 +00:00
|
|
|
static mut FOO: *const &i32 = [unsafe { &X }].as_ptr();
|
2019-12-26 14:50:40 +01:00
|
|
|
|
|
|
|
fn main() {}
|