rust/tests/ui/consts/const-points-to-static.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
282 B
Rust
Raw Normal View History

// compile-flags: -Zunleash-the-miri-inside-of-you
// stderr-per-bitwidth
#![allow(dead_code)]
const TEST: &u8 = &MY_STATIC;
2020-05-03 07:23:08 -05:00
//~^ ERROR it is undefined behavior to use this value
//~| encountered a reference pointing to a static variable
static MY_STATIC: u8 = 4;
fn main() {
}