summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/write-to-static-mut-in-static.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/consts/write-to-static-mut-in-static.stderr
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/consts/write-to-static-mut-in-static.stderr')
-rw-r--r--tests/ui/consts/write-to-static-mut-in-static.stderr34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/ui/consts/write-to-static-mut-in-static.stderr b/tests/ui/consts/write-to-static-mut-in-static.stderr
new file mode 100644
index 000000000..395b2d42f
--- /dev/null
+++ b/tests/ui/consts/write-to-static-mut-in-static.stderr
@@ -0,0 +1,34 @@
+error[E0080]: could not evaluate static initializer
+ --> $DIR/write-to-static-mut-in-static.rs:2:33
+ |
+LL | pub static mut B: () = unsafe { A = 1; };
+ | ^^^^^ modifying a static's initial value from another static's initializer
+
+error[E0391]: cycle detected when const-evaluating + checking `C`
+ --> $DIR/write-to-static-mut-in-static.rs:5:1
+ |
+LL | pub static mut C: u32 = unsafe { C = 1; 0 };
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+note: ...which requires const-evaluating + checking `C`...
+ --> $DIR/write-to-static-mut-in-static.rs:5:34
+ |
+LL | pub static mut C: u32 = unsafe { C = 1; 0 };
+ | ^^^^^
+ = note: ...which again requires const-evaluating + checking `C`, completing the cycle
+note: cycle used when linting top-level module
+ --> $DIR/write-to-static-mut-in-static.rs:1:1
+ |
+LL | / pub static mut A: u32 = 0;
+LL | | pub static mut B: () = unsafe { A = 1; };
+LL | |
+LL | |
+... |
+LL | |
+LL | | fn main() {}
+ | |____________^
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0080, E0391.
+For more information about an error, try `rustc --explain E0080`.