11error[E0080]: it is undefined behavior to use this value
2- --> $DIR/const_refers_to_static_cross_crate.rs:11 :1
2+ --> $DIR/const_refers_to_static_cross_crate.rs:12 :1
33 |
44LL | / const SLICE_MUT: &[u8; 1] = {
55LL | |
@@ -11,13 +11,13 @@ LL | | };
1111 = 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.
1212
1313error: could not evaluate constant pattern
14- --> $DIR/const_refers_to_static_cross_crate.rs:39 :9
14+ --> $DIR/const_refers_to_static_cross_crate.rs:40 :9
1515 |
1616LL | SLICE_MUT => true,
1717 | ^^^^^^^^^
1818
1919error[E0080]: it is undefined behavior to use this value
20- --> $DIR/const_refers_to_static_cross_crate.rs:17 :1
20+ --> $DIR/const_refers_to_static_cross_crate.rs:18 :1
2121 |
2222LL | / const U8_MUT: &u8 = {
2323LL | |
@@ -29,13 +29,13 @@ LL | | };
2929 = 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.
3030
3131error: could not evaluate constant pattern
32- --> $DIR/const_refers_to_static_cross_crate.rs:47 :9
32+ --> $DIR/const_refers_to_static_cross_crate.rs:49 :9
3333 |
3434LL | U8_MUT => true,
3535 | ^^^^^^
3636
3737warning: any use of this value will cause an error
38- --> $DIR/const_refers_to_static_cross_crate.rs:26 :14
38+ --> $DIR/const_refers_to_static_cross_crate.rs:27 :14
3939 |
4040LL | / const U8_MUT2: &u8 = {
4141LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
@@ -46,19 +46,19 @@ LL | | };
4646 | |__-
4747 |
4848note: the lint level is defined here
49- --> $DIR/const_refers_to_static_cross_crate.rs:24 :8
49+ --> $DIR/const_refers_to_static_cross_crate.rs:25 :8
5050 |
5151LL | #[warn(const_err)]
5252 | ^^^^^^^^^
5353
5454error: could not evaluate constant pattern
55- --> $DIR/const_refers_to_static_cross_crate.rs:57 :9
55+ --> $DIR/const_refers_to_static_cross_crate.rs:60 :9
5656 |
5757LL | U8_MUT2 => true,
5858 | ^^^^^^^
5959
6060warning: any use of this value will cause an error
61- --> $DIR/const_refers_to_static_cross_crate.rs:32 :51
61+ --> $DIR/const_refers_to_static_cross_crate.rs:33 :51
6262 |
6363LL | / const U8_MUT3: &u8 = {
6464LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
@@ -69,76 +69,100 @@ LL | | };
6969 | |__-
7070 |
7171note: the lint level is defined here
72- --> $DIR/const_refers_to_static_cross_crate.rs:30 :8
72+ --> $DIR/const_refers_to_static_cross_crate.rs:31 :8
7373 |
7474LL | #[warn(const_err)]
7575 | ^^^^^^^^^
7676
7777error: could not evaluate constant pattern
78- --> $DIR/const_refers_to_static_cross_crate.rs:64:9
78+ --> $DIR/const_refers_to_static_cross_crate.rs:68:9
79+ |
80+ LL | U8_MUT3 => true,
81+ | ^^^^^^^
82+
83+ error: could not evaluate constant pattern
84+ --> $DIR/const_refers_to_static_cross_crate.rs:40:9
85+ |
86+ LL | SLICE_MUT => true,
87+ | ^^^^^^^^^
88+
89+ error: could not evaluate constant pattern
90+ --> $DIR/const_refers_to_static_cross_crate.rs:49:9
91+ |
92+ LL | U8_MUT => true,
93+ | ^^^^^^
94+
95+ error: could not evaluate constant pattern
96+ --> $DIR/const_refers_to_static_cross_crate.rs:60:9
97+ |
98+ LL | U8_MUT2 => true,
99+ | ^^^^^^^
100+
101+ error: could not evaluate constant pattern
102+ --> $DIR/const_refers_to_static_cross_crate.rs:68:9
79103 |
80104LL | U8_MUT3 => true,
81105 | ^^^^^^^
82106
83107warning: skipping const checks
84108 |
85109help: skipping check that does not even have a feature gate
86- --> $DIR/const_refers_to_static_cross_crate.rs:14 :15
110+ --> $DIR/const_refers_to_static_cross_crate.rs:15 :15
87111 |
88112LL | unsafe { &static_cross_crate::ZERO }
89113 | ^^^^^^^^^^^^^^^^^^^^^^^^
90114help: skipping check that does not even have a feature gate
91- --> $DIR/const_refers_to_static_cross_crate.rs:14 :15
115+ --> $DIR/const_refers_to_static_cross_crate.rs:15 :15
92116 |
93117LL | unsafe { &static_cross_crate::ZERO }
94118 | ^^^^^^^^^^^^^^^^^^^^^^^^
95119help: skipping check that does not even have a feature gate
96- --> $DIR/const_refers_to_static_cross_crate.rs:20 :15
120+ --> $DIR/const_refers_to_static_cross_crate.rs:21 :15
97121 |
98122LL | unsafe { &static_cross_crate::ZERO[0] }
99123 | ^^^^^^^^^^^^^^^^^^^^^^^^
100124help: skipping check that does not even have a feature gate
101- --> $DIR/const_refers_to_static_cross_crate.rs:20 :15
125+ --> $DIR/const_refers_to_static_cross_crate.rs:21 :15
102126 |
103127LL | unsafe { &static_cross_crate::ZERO[0] }
104128 | ^^^^^^^^^^^^^^^^^^^^^^^^
105129help: skipping check that does not even have a feature gate
106- --> $DIR/const_refers_to_static_cross_crate.rs:20 :15
130+ --> $DIR/const_refers_to_static_cross_crate.rs:21 :15
107131 |
108132LL | unsafe { &static_cross_crate::ZERO[0] }
109133 | ^^^^^^^^^^^^^^^^^^^^^^^^
110134help: skipping check that does not even have a feature gate
111- --> $DIR/const_refers_to_static_cross_crate.rs:26 :17
135+ --> $DIR/const_refers_to_static_cross_crate.rs:27 :17
112136 |
113137LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
114138 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115139help: skipping check that does not even have a feature gate
116- --> $DIR/const_refers_to_static_cross_crate.rs:32 :20
140+ --> $DIR/const_refers_to_static_cross_crate.rs:33 :20
117141 |
118142LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
119143 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
120144help: skipping check that does not even have a feature gate
121- --> $DIR/const_refers_to_static_cross_crate.rs:32 :20
145+ --> $DIR/const_refers_to_static_cross_crate.rs:33 :20
122146 |
123147LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
124148 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
125149help: skipping check that does not even have a feature gate
126- --> $DIR/const_refers_to_static_cross_crate.rs:32 :20
150+ --> $DIR/const_refers_to_static_cross_crate.rs:33 :20
127151 |
128152LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
129153 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130154help: skipping check for `const_panic` feature
131- --> $DIR/const_refers_to_static_cross_crate.rs:32 :77
155+ --> $DIR/const_refers_to_static_cross_crate.rs:33 :77
132156 |
133157LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
134158 | ^^^^^^^^
135159help: skipping check that does not even have a feature gate
136- --> $DIR/const_refers_to_static_cross_crate.rs:32 :20
160+ --> $DIR/const_refers_to_static_cross_crate.rs:33 :20
137161 |
138162LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
139163 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140164 = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
141165
142- error: aborting due to 6 previous errors; 3 warnings emitted
166+ error: aborting due to 10 previous errors; 3 warnings emitted
143167
144168For more information about this error, try `rustc --explain E0080`.
0 commit comments