]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-address-of-interior-mut.stderr
Rollup merge of #72279 - RalfJung:raw-ref-macros, r=nikomatsakis
[rust.git] / src / test / ui / consts / const-address-of-interior-mut.stderr
1 error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead
2   --> $DIR/const-address-of-interior-mut.rs:5:39
3    |
4 LL | const A: () = { let x = Cell::new(2); &raw const x; };
5    |                                       ^^^^^^^^^^^^
6
7 error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead
8   --> $DIR/const-address-of-interior-mut.rs:7:40
9    |
10 LL | static B: () = { let x = Cell::new(2); &raw const x; };
11    |                                        ^^^^^^^^^^^^
12
13 error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead
14   --> $DIR/const-address-of-interior-mut.rs:9:44
15    |
16 LL | static mut C: () = { let x = Cell::new(2); &raw const x; };
17    |                                            ^^^^^^^^^^^^
18
19 error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead
20   --> $DIR/const-address-of-interior-mut.rs:13:13
21    |
22 LL |     let y = &raw const x;
23    |             ^^^^^^^^^^^^
24
25 error: aborting due to 4 previous errors
26
27 For more information about this error, try `rustc --explain E0492`.