mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
d56cdd48cb
Update tests
33 lines
1.5 KiB
Plaintext
33 lines
1.5 KiB
Plaintext
error[E0133]: borrow of layout constrained field with interior mutability is unsafe and requires unsafe function or block
|
|
--> $DIR/ranged_ints3_const.rs:12:13
|
|
|
|
|
LL | let y = &x.0;
|
|
| ^^^^ borrow of layout constrained field with interior mutability
|
|
|
|
|
= note: references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values
|
|
|
|
error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability
|
|
--> $DIR/ranged_ints3_const.rs:12:13
|
|
|
|
|
LL | let y = &x.0;
|
|
| ^^^^
|
|
|
|
|
= note: see issue #80384 <https://github.com/rust-lang/rust/issues/80384> for more information
|
|
= help: add `#![feature(const_refs_to_cell)]` to the crate attributes to enable
|
|
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
|
|
|
error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability
|
|
--> $DIR/ranged_ints3_const.rs:19:22
|
|
|
|
|
LL | let y = unsafe { &x.0 };
|
|
| ^^^^
|
|
|
|
|
= note: see issue #80384 <https://github.com/rust-lang/rust/issues/80384> for more information
|
|
= help: add `#![feature(const_refs_to_cell)]` to the crate attributes to enable
|
|
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
Some errors have detailed explanations: E0133, E0658.
|
|
For more information about an error, try `rustc --explain E0133`.
|