diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/ui/unsafe/ranged_ints3_const.thirunsafeck.stderr | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/unsafe/ranged_ints3_const.thirunsafeck.stderr')
-rw-r--r-- | tests/ui/unsafe/ranged_ints3_const.thirunsafeck.stderr | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/ui/unsafe/ranged_ints3_const.thirunsafeck.stderr b/tests/ui/unsafe/ranged_ints3_const.thirunsafeck.stderr new file mode 100644 index 000000000..5dbc563aa --- /dev/null +++ b/tests/ui/unsafe/ranged_ints3_const.thirunsafeck.stderr @@ -0,0 +1,30 @@ +error[E0133]: borrow of layout constrained field with interior mutability is unsafe and requires unsafe function or block + --> $DIR/ranged_ints3_const.rs:15: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:15: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 + +error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability + --> $DIR/ranged_ints3_const.rs:22: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 + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0133, E0658. +For more information about an error, try `rustc --explain E0133`. |