2019-11-28 17:20:28 +00:00
|
|
|
static X: i32 = 1;
|
|
|
|
const C: i32 = 2;
|
|
|
|
|
2021-01-03 18:46:20 +00:00
|
|
|
const CR: &'static mut i32 = &mut C; //~ ERROR mutable references are not allowed
|
2020-08-10 11:16:30 +00:00
|
|
|
//~| WARN taking a mutable
|
2020-09-30 00:31:04 +00:00
|
|
|
static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR cannot borrow
|
2021-01-03 18:46:20 +00:00
|
|
|
//~| ERROR E0658
|
|
|
|
//~| ERROR mutable references are not allowed
|
2020-09-30 00:31:04 +00:00
|
|
|
|
2021-01-03 18:46:20 +00:00
|
|
|
static CONST_REF: &'static mut i32 = &mut C; //~ ERROR mutable references are not allowed
|
2020-08-10 11:16:30 +00:00
|
|
|
//~| WARN taking a mutable
|
2019-11-28 17:20:28 +00:00
|
|
|
|
|
|
|
fn main() {}
|