summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/miri_unleashed/const_refers_to_static.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/miri_unleashed/const_refers_to_static.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/miri_unleashed/const_refers_to_static.stderr')
-rw-r--r--src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr100
1 files changed, 100 insertions, 0 deletions
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr
new file mode 100644
index 000000000..fa2088124
--- /dev/null
+++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr
@@ -0,0 +1,100 @@
+error[E0080]: erroneous constant used
+ --> $DIR/const_refers_to_static.rs:25:5
+ |
+LL | MUTATE_INTERIOR_MUT;
+ | ^^^^^^^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+ --> $DIR/const_refers_to_static.rs:27:5
+ |
+LL | READ_INTERIOR_MUT;
+ | ^^^^^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: erroneous constant used
+ --> $DIR/const_refers_to_static.rs:29:5
+ |
+LL | READ_MUT;
+ | ^^^^^^^^ referenced constant has errors
+
+warning: skipping const checks
+ |
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:13:5
+ |
+LL | FOO.fetch_add(1, Ordering::Relaxed)
+ | ^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:13:5
+ |
+LL | FOO.fetch_add(1, Ordering::Relaxed)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:18:17
+ |
+LL | unsafe { *(&FOO as *const _ as *const usize) }
+ | ^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:22:32
+ |
+LL | const READ_MUT: u32 = unsafe { MUTABLE };
+ | ^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:22:32
+ |
+LL | const READ_MUT: u32 = unsafe { MUTABLE };
+ | ^^^^^^^
+
+error: aborting due to 3 previous errors; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0080`.
+Future incompatibility report: Future breakage diagnostic:
+warning: any use of this value will cause an error
+ --> $DIR/const_refers_to_static.rs:13:5
+ |
+LL | const MUTATE_INTERIOR_MUT: usize = {
+ | --------------------------------
+LL | static FOO: AtomicUsize = AtomicUsize::new(0);
+LL | FOO.fetch_add(1, Ordering::Relaxed)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `AtomicUsize::fetch_add`
+ |
+note: the lint level is defined here
+ --> $DIR/const_refers_to_static.rs:3:10
+ |
+LL | #![allow(const_err)]
+ | ^^^^^^^^^
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+
+Future breakage diagnostic:
+warning: any use of this value will cause an error
+ --> $DIR/const_refers_to_static.rs:18:14
+ |
+LL | const READ_INTERIOR_MUT: usize = {
+ | ------------------------------
+LL | static FOO: AtomicUsize = AtomicUsize::new(0);
+LL | unsafe { *(&FOO as *const _ as *const usize) }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
+ |
+note: the lint level is defined here
+ --> $DIR/const_refers_to_static.rs:3:10
+ |
+LL | #![allow(const_err)]
+ | ^^^^^^^^^
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+
+Future breakage diagnostic:
+warning: any use of this value will cause an error
+ --> $DIR/const_refers_to_static.rs:22:32
+ |
+LL | const READ_MUT: u32 = unsafe { MUTABLE };
+ | ------------------- ^^^^^^^ constant accesses static
+ |
+note: the lint level is defined here
+ --> $DIR/const_refers_to_static.rs:3:10
+ |
+LL | #![allow(const_err)]
+ | ^^^^^^^^^
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+