@@ -3,8 +3,6 @@ error[E0080]: it is undefined behavior to use this value
33 |
44LL | / const SLICE_MUT: &[u8; 1] = {
55LL | |
6- LL | |
7- LL | |
86LL | | unsafe { &static_cross_crate::ZERO }
97LL | | };
108 | |__^ type validation failed: encountered a reference pointing to a static variable
@@ -15,18 +13,16 @@ LL | | };
1513 }
1614
1715error: could not evaluate constant pattern
18- --> $DIR/const_refers_to_static_cross_crate.rs:47 :9
16+ --> $DIR/const_refers_to_static_cross_crate.rs:40 :9
1917 |
2018LL | SLICE_MUT => true,
2119 | ^^^^^^^^^
2220
2321error[E0080]: it is undefined behavior to use this value
24- --> $DIR/const_refers_to_static_cross_crate.rs:19 :1
22+ --> $DIR/const_refers_to_static_cross_crate.rs:17 :1
2523 |
2624LL | / const U8_MUT: &u8 = {
2725LL | |
28- LL | |
29- LL | |
3026LL | | unsafe { &static_cross_crate::ZERO[0] }
3127LL | | };
3228 | |__^ type validation failed: encountered a reference pointing to a static variable
@@ -37,143 +33,141 @@ LL | | };
3733 }
3834
3935error: could not evaluate constant pattern
40- --> $DIR/const_refers_to_static_cross_crate.rs:56 :9
36+ --> $DIR/const_refers_to_static_cross_crate.rs:49 :9
4137 |
4238LL | U8_MUT => true,
4339 | ^^^^^^
4440
4541warning: any use of this value will cause an error
46- --> $DIR/const_refers_to_static_cross_crate.rs:29 :15
42+ --> $DIR/const_refers_to_static_cross_crate.rs:25 :15
4743 |
4844LL | / const U8_MUT2: &u8 = {
4945LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
5046 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
5147LL | |
5248LL | |
5349LL | |
54- LL | |
5550LL | | };
5651 | |__-
5752 |
5853note: the lint level is defined here
59- --> $DIR/const_refers_to_static_cross_crate.rs:27 :8
54+ --> $DIR/const_refers_to_static_cross_crate.rs:23 :8
6055 |
6156LL | #[warn(const_err)]
6257 | ^^^^^^^^^
6358 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
6459 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
6560
6661error: could not evaluate constant pattern
67- --> $DIR/const_refers_to_static_cross_crate.rs:67 :9
62+ --> $DIR/const_refers_to_static_cross_crate.rs:60 :9
6863 |
6964LL | U8_MUT2 => true,
7065 | ^^^^^^^
7166
7267warning: any use of this value will cause an error
73- --> $DIR/const_refers_to_static_cross_crate.rs:37 :51
68+ --> $DIR/const_refers_to_static_cross_crate.rs:32 :51
7469 |
7570LL | / const U8_MUT3: &u8 = {
7671LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
7772 | | ^^^^^^^^^^^ constant accesses static
7873LL | |
7974LL | |
80- ... |
8175LL | |
8276LL | | };
8377 | |__-
8478 |
8579note: the lint level is defined here
86- --> $DIR/const_refers_to_static_cross_crate.rs:35 :8
80+ --> $DIR/const_refers_to_static_cross_crate.rs:30 :8
8781 |
8882LL | #[warn(const_err)]
8983 | ^^^^^^^^^
9084 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9185 = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
9286
9387error: could not evaluate constant pattern
94- --> $DIR/const_refers_to_static_cross_crate.rs:75 :9
88+ --> $DIR/const_refers_to_static_cross_crate.rs:68 :9
9589 |
9690LL | U8_MUT3 => true,
9791 | ^^^^^^^
9892
9993error: could not evaluate constant pattern
100- --> $DIR/const_refers_to_static_cross_crate.rs:47 :9
94+ --> $DIR/const_refers_to_static_cross_crate.rs:40 :9
10195 |
10296LL | SLICE_MUT => true,
10397 | ^^^^^^^^^
10498
10599error: could not evaluate constant pattern
106- --> $DIR/const_refers_to_static_cross_crate.rs:56 :9
100+ --> $DIR/const_refers_to_static_cross_crate.rs:49 :9
107101 |
108102LL | U8_MUT => true,
109103 | ^^^^^^
110104
111105error: could not evaluate constant pattern
112- --> $DIR/const_refers_to_static_cross_crate.rs:67 :9
106+ --> $DIR/const_refers_to_static_cross_crate.rs:60 :9
113107 |
114108LL | U8_MUT2 => true,
115109 | ^^^^^^^
116110
117111error: could not evaluate constant pattern
118- --> $DIR/const_refers_to_static_cross_crate.rs:75 :9
112+ --> $DIR/const_refers_to_static_cross_crate.rs:68 :9
119113 |
120114LL | U8_MUT3 => true,
121115 | ^^^^^^^
122116
123117warning: skipping const checks
124118 |
125119help: skipping check that does not even have a feature gate
126- --> $DIR/const_refers_to_static_cross_crate.rs:16 :15
120+ --> $DIR/const_refers_to_static_cross_crate.rs:14 :15
127121 |
128122LL | unsafe { &static_cross_crate::ZERO }
129123 | ^^^^^^^^^^^^^^^^^^^^^^^^
130124help: skipping check that does not even have a feature gate
131- --> $DIR/const_refers_to_static_cross_crate.rs:16 :15
125+ --> $DIR/const_refers_to_static_cross_crate.rs:14 :15
132126 |
133127LL | unsafe { &static_cross_crate::ZERO }
134128 | ^^^^^^^^^^^^^^^^^^^^^^^^
135129help: skipping check that does not even have a feature gate
136- --> $DIR/const_refers_to_static_cross_crate.rs:23 :15
130+ --> $DIR/const_refers_to_static_cross_crate.rs:19 :15
137131 |
138132LL | unsafe { &static_cross_crate::ZERO[0] }
139133 | ^^^^^^^^^^^^^^^^^^^^^^^^
140134help: skipping check that does not even have a feature gate
141- --> $DIR/const_refers_to_static_cross_crate.rs:23 :15
135+ --> $DIR/const_refers_to_static_cross_crate.rs:19 :15
142136 |
143137LL | unsafe { &static_cross_crate::ZERO[0] }
144138 | ^^^^^^^^^^^^^^^^^^^^^^^^
145139help: skipping check that does not even have a feature gate
146- --> $DIR/const_refers_to_static_cross_crate.rs:23 :15
140+ --> $DIR/const_refers_to_static_cross_crate.rs:19 :15
147141 |
148142LL | unsafe { &static_cross_crate::ZERO[0] }
149143 | ^^^^^^^^^^^^^^^^^^^^^^^^
150144help: skipping check that does not even have a feature gate
151- --> $DIR/const_refers_to_static_cross_crate.rs:29 :17
145+ --> $DIR/const_refers_to_static_cross_crate.rs:25 :17
152146 |
153147LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
154148 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
155149help: skipping check that does not even have a feature gate
156- --> $DIR/const_refers_to_static_cross_crate.rs:37 :20
150+ --> $DIR/const_refers_to_static_cross_crate.rs:32 :20
157151 |
158152LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
159153 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
160154help: skipping check that does not even have a feature gate
161- --> $DIR/const_refers_to_static_cross_crate.rs:37 :20
155+ --> $DIR/const_refers_to_static_cross_crate.rs:32 :20
162156 |
163157LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
164158 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
165159help: skipping check that does not even have a feature gate
166- --> $DIR/const_refers_to_static_cross_crate.rs:37 :20
160+ --> $DIR/const_refers_to_static_cross_crate.rs:32 :20
167161 |
168162LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
169163 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
170164help: skipping check for `const_panic` feature
171- --> $DIR/const_refers_to_static_cross_crate.rs:37 :77
165+ --> $DIR/const_refers_to_static_cross_crate.rs:32 :77
172166 |
173167LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
174168 | ^^^^^^^^
175169help: skipping check that does not even have a feature gate
176- --> $DIR/const_refers_to_static_cross_crate.rs:37 :20
170+ --> $DIR/const_refers_to_static_cross_crate.rs:32 :20
177171 |
178172LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
179173 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments