rust/tests/ui/consts/issue-17718-const-bad-values.rs
2024-09-15 09:51:32 +02:00

11 lines
252 B
Rust

#![allow(static_mut_refs)]
const C1: &'static mut [usize] = &mut [];
//~^ ERROR: mutable references are not allowed
static mut S: usize = 3;
const C2: &'static mut usize = unsafe { &mut S };
//~^ ERROR: referencing statics in constants
fn main() {}