2023-12-22 06:10:47 -06:00
|
|
|
//@ revisions: e2021 e2024
|
|
|
|
|
|
|
|
//@ [e2021] edition:2021
|
|
|
|
//@ [e2024] compile-flags: --edition 2024 -Z unstable-options
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
static mut X: i32 = 1;
|
|
|
|
|
|
|
|
let _x = &X;
|
2024-02-17 13:01:56 -06:00
|
|
|
//[e2024]~^ creating a shared reference to a mutable static [E0796]
|
2023-12-22 06:10:47 -06:00
|
|
|
//[e2021]~^^ use of mutable static is unsafe and requires unsafe function or block [E0133]
|
2024-02-17 13:01:56 -06:00
|
|
|
//[e2021]~^^^ shared reference to mutable static is discouraged [static_mut_refs]
|
2023-12-22 06:10:47 -06:00
|
|
|
}
|