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