summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.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/miri_unleashed/const_refers_to_static_cross_crate.32bit.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/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr')
-rw-r--r--tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr138
1 files changed, 138 insertions, 0 deletions
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
new file mode 100644
index 000000000..6df2fe3d0
--- /dev/null
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
@@ -0,0 +1,138 @@
+error[E0080]: it is undefined behavior to use this value
+ --> $DIR/const_refers_to_static_cross_crate.rs:10:1
+ |
+LL | const SLICE_MUT: &[u8; 1] = {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
+ |
+ = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+ = note: the raw bytes of the constant (size: 4, align: 4) {
+ ╾─alloc1──╼ │ ╾──╼
+ }
+
+error: could not evaluate constant pattern
+ --> $DIR/const_refers_to_static_cross_crate.rs:34:9
+ |
+LL | SLICE_MUT => true,
+ | ^^^^^^^^^
+
+error[E0080]: it is undefined behavior to use this value
+ --> $DIR/const_refers_to_static_cross_crate.rs:15:1
+ |
+LL | const U8_MUT: &u8 = {
+ | ^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
+ |
+ = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+ = note: the raw bytes of the constant (size: 4, align: 4) {
+ ╾─alloc1──╼ │ ╾──╼
+ }
+
+error: could not evaluate constant pattern
+ --> $DIR/const_refers_to_static_cross_crate.rs:43:9
+ |
+LL | U8_MUT => true,
+ | ^^^^^^
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_refers_to_static_cross_crate.rs:22:15
+ |
+LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
+
+error: could not evaluate constant pattern
+ --> $DIR/const_refers_to_static_cross_crate.rs:54:9
+ |
+LL | U8_MUT2 => true,
+ | ^^^^^^^
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_refers_to_static_cross_crate.rs:27:20
+ |
+LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
+
+error: could not evaluate constant pattern
+ --> $DIR/const_refers_to_static_cross_crate.rs:62:9
+ |
+LL | U8_MUT3 => true,
+ | ^^^^^^^
+
+error: could not evaluate constant pattern
+ --> $DIR/const_refers_to_static_cross_crate.rs:34:9
+ |
+LL | SLICE_MUT => true,
+ | ^^^^^^^^^
+
+error: could not evaluate constant pattern
+ --> $DIR/const_refers_to_static_cross_crate.rs:43:9
+ |
+LL | U8_MUT => true,
+ | ^^^^^^
+
+error: could not evaluate constant pattern
+ --> $DIR/const_refers_to_static_cross_crate.rs:54:9
+ |
+LL | U8_MUT2 => true,
+ | ^^^^^^^
+
+error: could not evaluate constant pattern
+ --> $DIR/const_refers_to_static_cross_crate.rs:62:9
+ |
+LL | U8_MUT3 => true,
+ | ^^^^^^^
+
+warning: skipping const checks
+ |
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static_cross_crate.rs:12:15
+ |
+LL | unsafe { &static_cross_crate::ZERO }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static_cross_crate.rs:12:15
+ |
+LL | unsafe { &static_cross_crate::ZERO }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static_cross_crate.rs:17:15
+ |
+LL | unsafe { &static_cross_crate::ZERO[0] }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static_cross_crate.rs:17:15
+ |
+LL | unsafe { &static_cross_crate::ZERO[0] }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static_cross_crate.rs:17:15
+ |
+LL | unsafe { &static_cross_crate::ZERO[0] }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static_cross_crate.rs:22:17
+ |
+LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static_cross_crate.rs:27:20
+ |
+LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static_cross_crate.rs:27:20
+ |
+LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static_cross_crate.rs:27:20
+ |
+LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static_cross_crate.rs:27:20
+ |
+LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 12 previous errors; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0080`.