From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../unsafe/ranged_ints2_const.mirunsafeck.stderr | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/ui/unsafe/ranged_ints2_const.mirunsafeck.stderr (limited to 'tests/ui/unsafe/ranged_ints2_const.mirunsafeck.stderr') diff --git a/tests/ui/unsafe/ranged_ints2_const.mirunsafeck.stderr b/tests/ui/unsafe/ranged_ints2_const.mirunsafeck.stderr new file mode 100644 index 000000000..c16550a58 --- /dev/null +++ b/tests/ui/unsafe/ranged_ints2_const.mirunsafeck.stderr @@ -0,0 +1,39 @@ +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/ranged_ints2_const.rs:14:13 + | +LL | let y = &mut x.0; + | ^^^^^^^^ + | + = note: see issue #57349 for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable + +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/ranged_ints2_const.rs:21:22 + | +LL | let y = unsafe { &mut x.0 }; + | ^^^^^^^^ + | + = note: see issue #57349 for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable + +error[E0658]: mutable references are not allowed in constant functions + --> $DIR/ranged_ints2_const.rs:27:22 + | +LL | unsafe { let y = &mut x.0; } + | ^^^^^^^^ + | + = note: see issue #57349 for more information + = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable + +error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block + --> $DIR/ranged_ints2_const.rs:14:13 + | +LL | let y = &mut x.0; + | ^^^^^^^^ mutation of layout constrained field + | + = note: mutating layout constrained fields cannot statically be checked for valid values + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0133, E0658. +For more information about an error, try `rustc --explain E0133`. -- cgit v1.2.3