2024-06-21 00:15:36 -05:00
|
|
|
//@ normalize-stderr-test: "\(size: ., align: .\)" -> ""
|
|
|
|
//@ normalize-stderr-test: " +│ ╾─+╼" -> ""
|
2024-02-14 06:28:07 -06:00
|
|
|
|
2016-05-12 08:17:02 -05:00
|
|
|
static X: i32 = 1;
|
|
|
|
const C: i32 = 2;
|
2019-11-26 19:08:46 -06:00
|
|
|
static mut M: i32 = 3;
|
2016-05-12 08:17:02 -05:00
|
|
|
|
2021-01-03 12:46:20 -06:00
|
|
|
const CR: &'static mut i32 = &mut C; //~ ERROR mutable references are not allowed
|
2023-12-22 06:12:01 -06:00
|
|
|
//~| WARN taking a mutable
|
|
|
|
|
2024-02-11 07:27:08 -06:00
|
|
|
static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR cannot borrow immutable static item `X` as mutable
|
2020-09-29 19:31:04 -05:00
|
|
|
|
2021-01-03 12:46:20 -06:00
|
|
|
static CONST_REF: &'static mut i32 = &mut C; //~ ERROR mutable references are not allowed
|
2023-12-22 06:12:01 -06:00
|
|
|
//~| WARN taking a mutable
|
|
|
|
|
2016-05-12 08:17:02 -05:00
|
|
|
fn main() {}
|