about summary refs log tree commit diff
path: root/tests/ui/consts/issue-17718-const-bad-values.rs
blob: a447350e35bf87fd3bcecdc174128da2985f8caf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//@ 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"
//@ dont-require-annotations: NOTE

#![allow(static_mut_refs)]

const C1: &'static mut [usize] = &mut [];
//~^ ERROR: mutable borrows of temporaries

static mut S: i32 = 3;
const C2: &'static mut i32 = unsafe { &mut S };
//~^ ERROR: encountered mutable reference

fn main() {}