fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.3 KiB30 linesraw
1error[E0133]: borrow of layout constrained field with interior mutability is unsafe and requires unsafe function or block
2  --> $DIR/ranged_ints3_const.rs:15:13
3   |
4LL |     let y = &x.0;
5   |             ^^^^ borrow of layout constrained field with interior mutability
6   |
7   = note: references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values
8
9error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability
10  --> $DIR/ranged_ints3_const.rs:15:13
11   |
12LL |     let y = &x.0;
13   |             ^^^^
14   |
15   = note: see issue #80384 <https://github.com/rust-lang/rust/issues/80384> for more information
16   = help: add `#![feature(const_refs_to_cell)]` to the crate attributes to enable
17
18error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability
19  --> $DIR/ranged_ints3_const.rs:22:22
20   |
21LL |     let y = unsafe { &x.0 };
22   |                      ^^^^
23   |
24   = note: see issue #80384 <https://github.com/rust-lang/rust/issues/80384> for more information
25   = help: add `#![feature(const_refs_to_cell)]` to the crate attributes to enable
26
27error: aborting due to 3 previous errors
28
29Some errors have detailed explanations: E0133, E0658.
30For more information about an error, try `rustc --explain E0133`.