2024-12-25 11:12:17 +00:00
|
|
|
//@ normalize-stderr: "\(size: \d+, align: \d+\)" -> "(size: $$PTR, align: $$PTR)"
|
|
|
|
//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
|
2024-08-29 20:48:05 +00:00
|
|
|
|
2024-02-17 19:01:56 +00:00
|
|
|
#![allow(static_mut_refs)]
|
2024-02-12 14:14:58 +00:00
|
|
|
|
2015-01-08 11:02:42 +00:00
|
|
|
const C1: &'static mut [usize] = &mut [];
|
2021-01-03 18:46:20 +00:00
|
|
|
//~^ ERROR: mutable references are not allowed
|
2014-10-07 04:16:35 +00:00
|
|
|
|
2024-08-29 20:48:05 +00:00
|
|
|
static mut S: i32 = 3;
|
|
|
|
const C2: &'static mut i32 = unsafe { &mut S };
|
|
|
|
//~^ ERROR: it is undefined behavior to use this value
|
|
|
|
//~| reference to mutable memory
|
2014-10-07 04:16:35 +00:00
|
|
|
|
|
|
|
fn main() {}
|