rust/tests/ui/error-codes/E0388.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
586 B
Rust
Raw Normal View History

static X: i32 = 1;
const C: i32 = 2;
const CR: &'static mut i32 = &mut C; //~ ERROR mutable references are not allowed
//~| WARN taking a mutable
2020-09-30 00:31:04 +00:00
static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR cannot borrow
//~| ERROR E0658
//~| ERROR mutable references are not allowed
2020-09-30 00:31:04 +00:00
static CONST_REF: &'static mut i32 = &mut C; //~ ERROR mutable references are not allowed
//~| WARN taking a mutable
fn main() {}