2024-12-25 22:12:17 +11: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"
|
2025-04-05 19:19:56 +03:00
|
|
|
//@ dont-require-annotations: NOTE
|
2024-08-30 04:48:05 +08:00
|
|
|
|
2024-02-17 22:01:56 +03:00
|
|
|
#![allow(static_mut_refs)]
|
2024-02-12 15:14:58 +01:00
|
|
|
|
2015-01-08 22:02:42 +11:00
|
|
|
const C1: &'static mut [usize] = &mut [];
|
2021-01-03 18:46:20 +00:00
|
|
|
//~^ ERROR: mutable references are not allowed
|
2014-10-06 21:16:35 -07:00
|
|
|
|
2024-08-30 04:48:05 +08:00
|
|
|
static mut S: i32 = 3;
|
|
|
|
|
const C2: &'static mut i32 = unsafe { &mut S };
|
|
|
|
|
//~^ ERROR: it is undefined behavior to use this value
|
2025-04-05 19:19:56 +03:00
|
|
|
//~| NOTE reference to mutable memory
|
2014-10-06 21:16:35 -07:00
|
|
|
|
|
|
|
|
fn main() {}
|