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