2024-02-11 14:27:08 +01:00
|
|
|
#![feature(const_mut_refs)]
|
|
|
|
|
2024-02-14 12:28:07 +00:00
|
|
|
//@ normalize-stderr-test "\(size: ., align: .\)" -> ""
|
|
|
|
//@ normalize-stderr-test " +│ ╾─+╼" -> ""
|
|
|
|
|
2016-05-12 15:17:02 +02:00
|
|
|
static X: i32 = 1;
|
|
|
|
const C: i32 = 2;
|
2019-11-26 17:08:46 -08:00
|
|
|
static mut M: i32 = 3;
|
2016-05-12 15:17:02 +02: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 15:12:01 +03:00
|
|
|
//~| WARN taking a mutable
|
|
|
|
|
2024-02-11 14:27:08 +01:00
|
|
|
static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR cannot borrow immutable static item `X` as mutable
|
2020-09-29 17:31:04 -07: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 15:12:01 +03:00
|
|
|
//~| WARN taking a mutable
|
|
|
|
|
2016-05-12 15:17:02 +02:00
|
|
|
fn main() {}
|