]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / consts / miri_unleashed / const_refers_to_static_cross_crate.64bit.stderr
CommitLineData
f9f354fc 1error[E0080]: it is undefined behavior to use this value
cdc7bbd5 2 --> $DIR/const_refers_to_static_cross_crate.rs:12:1
f9f354fc
XL
3 |
4LL | / const SLICE_MUT: &[u8; 1] = {
5LL | |
f9f354fc
XL
6LL | | unsafe { &static_cross_crate::ZERO }
7LL | | };
8 | |__^ type validation failed: encountered a reference pointing to a static variable
9 |
10 = 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.
cdc7bbd5 11 = note: the raw bytes of the constant (size: 8, align: 8) {
136023e0 12 ╾───────alloc1────────╼ │ ╾──────╼
cdc7bbd5 13 }
f9f354fc
XL
14
15error: could not evaluate constant pattern
17df50a5 16 --> $DIR/const_refers_to_static_cross_crate.rs:40:9
f9f354fc
XL
17 |
18LL | SLICE_MUT => true,
19 | ^^^^^^^^^
20
21error[E0080]: it is undefined behavior to use this value
17df50a5 22 --> $DIR/const_refers_to_static_cross_crate.rs:17:1
f9f354fc
XL
23 |
24LL | / const U8_MUT: &u8 = {
25LL | |
f9f354fc
XL
26LL | | unsafe { &static_cross_crate::ZERO[0] }
27LL | | };
28 | |__^ type validation failed: encountered a reference pointing to a static variable
29 |
30 = 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.
cdc7bbd5 31 = note: the raw bytes of the constant (size: 8, align: 8) {
136023e0 32 ╾───────alloc1────────╼ │ ╾──────╼
cdc7bbd5 33 }
f9f354fc
XL
34
35error: could not evaluate constant pattern
17df50a5 36 --> $DIR/const_refers_to_static_cross_crate.rs:49:9
f9f354fc
XL
37 |
38LL | U8_MUT => true,
39 | ^^^^^^
40
41warning: any use of this value will cause an error
17df50a5 42 --> $DIR/const_refers_to_static_cross_crate.rs:25:15
f9f354fc
XL
43 |
44LL | / const U8_MUT2: &u8 = {
45LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
5869c6ff
XL
46 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
47LL | |
48LL | |
f9f354fc 49LL | |
f9f354fc
XL
50LL | | };
51 | |__-
52 |
53note: the lint level is defined here
17df50a5 54 --> $DIR/const_refers_to_static_cross_crate.rs:23:8
f9f354fc
XL
55 |
56LL | #[warn(const_err)]
57 | ^^^^^^^^^
5869c6ff
XL
58 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
59 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
f9f354fc
XL
60
61error: could not evaluate constant pattern
17df50a5 62 --> $DIR/const_refers_to_static_cross_crate.rs:60:9
f9f354fc
XL
63 |
64LL | U8_MUT2 => true,
65 | ^^^^^^^
66
67warning: any use of this value will cause an error
17df50a5 68 --> $DIR/const_refers_to_static_cross_crate.rs:32:51
f9f354fc
XL
69 |
70LL | / const U8_MUT3: &u8 = {
71LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
72 | | ^^^^^^^^^^^ constant accesses static
73LL | |
74LL | |
5869c6ff 75LL | |
f9f354fc
XL
76LL | | };
77 | |__-
78 |
79note: the lint level is defined here
17df50a5 80 --> $DIR/const_refers_to_static_cross_crate.rs:30:8
f9f354fc
XL
81 |
82LL | #[warn(const_err)]
83 | ^^^^^^^^^
5869c6ff
XL
84 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
85 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
f9f354fc
XL
86
87error: could not evaluate constant pattern
17df50a5 88 --> $DIR/const_refers_to_static_cross_crate.rs:68:9
f9f354fc
XL
89 |
90LL | U8_MUT3 => true,
91 | ^^^^^^^
92
93error: could not evaluate constant pattern
17df50a5 94 --> $DIR/const_refers_to_static_cross_crate.rs:40:9
f9f354fc
XL
95 |
96LL | SLICE_MUT => true,
97 | ^^^^^^^^^
98
99error: could not evaluate constant pattern
17df50a5 100 --> $DIR/const_refers_to_static_cross_crate.rs:49:9
f9f354fc
XL
101 |
102LL | U8_MUT => true,
103 | ^^^^^^
104
105error: could not evaluate constant pattern
17df50a5 106 --> $DIR/const_refers_to_static_cross_crate.rs:60:9
f9f354fc
XL
107 |
108LL | U8_MUT2 => true,
109 | ^^^^^^^
110
111error: could not evaluate constant pattern
17df50a5 112 --> $DIR/const_refers_to_static_cross_crate.rs:68:9
f9f354fc
XL
113 |
114LL | U8_MUT3 => true,
115 | ^^^^^^^
116
117warning: skipping const checks
118 |
119help: skipping check that does not even have a feature gate
17df50a5 120 --> $DIR/const_refers_to_static_cross_crate.rs:14:15
f9f354fc
XL
121 |
122LL | unsafe { &static_cross_crate::ZERO }
123 | ^^^^^^^^^^^^^^^^^^^^^^^^
124help: skipping check that does not even have a feature gate
17df50a5 125 --> $DIR/const_refers_to_static_cross_crate.rs:14:15
f9f354fc
XL
126 |
127LL | unsafe { &static_cross_crate::ZERO }
128 | ^^^^^^^^^^^^^^^^^^^^^^^^
129help: skipping check that does not even have a feature gate
17df50a5 130 --> $DIR/const_refers_to_static_cross_crate.rs:19:15
f9f354fc
XL
131 |
132LL | unsafe { &static_cross_crate::ZERO[0] }
133 | ^^^^^^^^^^^^^^^^^^^^^^^^
134help: skipping check that does not even have a feature gate
17df50a5 135 --> $DIR/const_refers_to_static_cross_crate.rs:19:15
f9f354fc
XL
136 |
137LL | unsafe { &static_cross_crate::ZERO[0] }
138 | ^^^^^^^^^^^^^^^^^^^^^^^^
139help: skipping check that does not even have a feature gate
17df50a5 140 --> $DIR/const_refers_to_static_cross_crate.rs:19:15
f9f354fc
XL
141 |
142LL | unsafe { &static_cross_crate::ZERO[0] }
143 | ^^^^^^^^^^^^^^^^^^^^^^^^
144help: skipping check that does not even have a feature gate
17df50a5 145 --> $DIR/const_refers_to_static_cross_crate.rs:25:17
f9f354fc
XL
146 |
147LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
148 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
149help: skipping check that does not even have a feature gate
17df50a5 150 --> $DIR/const_refers_to_static_cross_crate.rs:32:20
f9f354fc
XL
151 |
152LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
153 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
fc512014 154help: skipping check that does not even have a feature gate
17df50a5 155 --> $DIR/const_refers_to_static_cross_crate.rs:32:20
fc512014
XL
156 |
157LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
158 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
f9f354fc 159help: skipping check that does not even have a feature gate
17df50a5 160 --> $DIR/const_refers_to_static_cross_crate.rs:32:20
f9f354fc
XL
161 |
162LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
163 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
164help: skipping check for `const_panic` feature
17df50a5 165 --> $DIR/const_refers_to_static_cross_crate.rs:32:77
f9f354fc
XL
166 |
167LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
168 | ^^^^^^^^
169help: skipping check that does not even have a feature gate
17df50a5 170 --> $DIR/const_refers_to_static_cross_crate.rs:32:20
f9f354fc
XL
171 |
172LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
173 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17df50a5 174 = note: this warning originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
f9f354fc
XL
175
176error: aborting due to 10 previous errors; 3 warnings emitted
177
178For more information about this error, try `rustc --explain E0080`.