1- error[E0658 ]: `& raw mut` is not allowed in constants
1+ error[E0764 ]: raw mutable references are not allowed in constants
22 --> $DIR/const-address-of-mut.rs:3:32
33 |
44LL | const A: () = { let mut x = 2; &raw mut x; };
5- | ^^^^^^^^^^
6- |
7- = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
8- = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
5+ | ^^^^^^^^^^ `&raw mut` is only allowed in `const fn`
96
10- error[E0658 ]: `& raw mut` is not allowed in statics
7+ error[E0764 ]: raw mutable references are not allowed in statics
118 --> $DIR/const-address-of-mut.rs:5:33
129 |
1310LL | static B: () = { let mut x = 2; &raw mut x; };
14- | ^^^^^^^^^^
15- |
16- = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
17- = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
11+ | ^^^^^^^^^^ `&raw mut` is only allowed in `const fn`
1812
19- error[E0658 ]: `& raw mut` is not allowed in statics
13+ error[E0764 ]: raw mutable references are not allowed in statics
2014 --> $DIR/const-address-of-mut.rs:7:37
2115 |
2216LL | static mut C: () = { let mut x = 2; &raw mut x; };
23- | ^^^^^^^^^^
24- |
25- = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
26- = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
17+ | ^^^^^^^^^^ `&raw mut` is only allowed in `const fn`
2718
28- error[E0658]: `& raw mut` is not allowed in constant functions
19+ error[E0658]: raw mutable references are not allowed in constant functions
2920 --> $DIR/const-address-of-mut.rs:11:13
3021 |
3122LL | let y = &raw mut x;
@@ -36,4 +27,5 @@ LL | let y = &raw mut x;
3627
3728error: aborting due to 4 previous errors
3829
39- For more information about this error, try `rustc --explain E0658`.
30+ Some errors have detailed explanations: E0658, E0764.
31+ For more information about an error, try `rustc --explain E0658`.
0 commit comments