fork/rust

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

borsAuto merge of #68568 - pietroalbini:stable-next, r=pietroalbini5e1a799842b

1.41.0
1003 B24 linesraw
1error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead
2  --> $DIR/ranged_ints3_const.rs:12:13
3   |
4LL |     let y = &x.0;
5   |             ^^^^
6
7error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead
8  --> $DIR/ranged_ints3_const.rs:19:22
9   |
10LL |     let y = unsafe { &x.0 };
11   |                      ^^^^
12
13error[E0133]: borrow of layout constrained field with interior mutability is unsafe and requires unsafe function or block
14  --> $DIR/ranged_ints3_const.rs:12:13
15   |
16LL |     let y = &x.0;
17   |             ^^^^ borrow of layout constrained field with interior mutability
18   |
19   = note: references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values
20
21error: aborting due to 3 previous errors
22
23Some errors have detailed explanations: E0133, E0492.
24For more information about an error, try `rustc --explain E0133`.