]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-points-to-static.rs
Rollup merge of #83634 - JohnTitor:proc-macro-ice, r=varkor
[rust.git] / src / test / ui / consts / const-points-to-static.rs
1 // compile-flags: -Zunleash-the-miri-inside-of-you
2 // stderr-per-bitwidth
3
4 #![allow(dead_code)]
5
6 const TEST: &u8 = &MY_STATIC;
7 //~^ ERROR it is undefined behavior to use this value
8 //~| NOTE  encountered a reference pointing to a static variable
9 //~| NOTE undefined behavior
10 //~| NOTE the raw bytes of the constant
11
12 static MY_STATIC: u8 = 4;
13
14 fn main() {
15 }