summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-mut-refs/issue-76510.64bit.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/consts/const-mut-refs/issue-76510.64bit.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/consts/const-mut-refs/issue-76510.64bit.stderr')
-rw-r--r--src/test/ui/consts/const-mut-refs/issue-76510.64bit.stderr31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/test/ui/consts/const-mut-refs/issue-76510.64bit.stderr b/src/test/ui/consts/const-mut-refs/issue-76510.64bit.stderr
new file mode 100644
index 000000000..0f420ae1b
--- /dev/null
+++ b/src/test/ui/consts/const-mut-refs/issue-76510.64bit.stderr
@@ -0,0 +1,31 @@
+error[E0764]: mutable references are not allowed in the final value of constants
+ --> $DIR/issue-76510.rs:5:29
+ |
+LL | const S: &'static mut str = &mut " hello ";
+ | ^^^^^^^^^^^^^^
+
+error[E0658]: mutation through a reference is not allowed in constants
+ --> $DIR/issue-76510.rs:5:29
+ |
+LL | const S: &'static mut str = &mut " hello ";
+ | ^^^^^^^^^^^^^^
+ |
+ = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
+ = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
+
+error[E0596]: cannot borrow data in a `&` reference as mutable
+ --> $DIR/issue-76510.rs:5:29
+ |
+LL | const S: &'static mut str = &mut " hello ";
+ | ^^^^^^^^^^^^^^ cannot borrow as mutable
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/issue-76510.rs:11:70
+ |
+LL | let s = transmute::<(*const u8, usize), &ManuallyDrop<str>>((S.as_ptr(), 3));
+ | ^ referenced constant has errors
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0080, E0596, E0658, E0764.
+For more information about an error, try `rustc --explain E0080`.