fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

1.43.1
1.1 KiB27 linesraw
1error[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   |
4LL | const A: () = { let x = Cell::new(2); &raw const x; };
5   |                                       ^^^^^^^^^^^^
6
7error[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   |
10LL | static B: () = { let x = Cell::new(2); &raw const x; };
11   |                                        ^^^^^^^^^^^^
12
13error[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   |
16LL | static mut C: () = { let x = Cell::new(2); &raw const x; };
17   |                                            ^^^^^^^^^^^^
18
19error[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   |
22LL |     let y = &raw const x;
23   |             ^^^^^^^^^^^^
24
25error: aborting due to 4 previous errors
26
27For more information about this error, try `rustc --explain E0492`.