File: const-promotion-extern-static.rs

package info (click to toggle)
rustc 1.46.0+dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 269,876 kB
  • sloc: xml: 133,832; sh: 16,876; ansic: 16,844; javascript: 6,779; python: 6,128; cpp: 4,555; makefile: 3,186; asm: 1,392; ruby: 68; awk: 12
file content (15 lines) | stat: -rw-r--r-- 380 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// ignore-endian-big
extern "C" {
    static X: i32;
}
static Y: i32 = 42;

// EMIT_MIR rustc.BAR.PromoteTemps.diff
// EMIT_MIR rustc.BAR-promoted[0].ConstProp.after.mir
static mut BAR: *const &i32 = [&Y].as_ptr();

// EMIT_MIR rustc.FOO.PromoteTemps.diff
// EMIT_MIR rustc.FOO-promoted[0].ConstProp.after.mir
static mut FOO: *const &i32 = [unsafe { &X }].as_ptr();

fn main() {}