11warning: skipping const checks
2- --> $DIR/const_refers_to_static_cross_crate.rs:15 :15
2+ --> $DIR/const_refers_to_static_cross_crate.rs:14 :15
33 |
44LL | unsafe { &static_cross_crate::ZERO }
55 | ^^^^^^^^^^^^^^^^^^^^^^^^
66
77error[E0080]: it is undefined behavior to use this value
8- --> $DIR/const_refers_to_static_cross_crate.rs:12 :1
8+ --> $DIR/const_refers_to_static_cross_crate.rs:11 :1
99 |
1010LL | / const SLICE_MUT: &[u8; 1] = {
1111LL | |
@@ -18,21 +18,21 @@ LL | | };
1818 = 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.
1919
2020error: could not evaluate constant pattern
21- --> $DIR/const_refers_to_static_cross_crate.rs:28 :9
21+ --> $DIR/const_refers_to_static_cross_crate.rs:43 :9
2222 |
2323LL | SLICE_MUT => true,
2424 | ^^^^^^^^^
2525
2626warning: skipping const checks
27- --> $DIR/const_refers_to_static_cross_crate.rs:22 :15
27+ --> $DIR/const_refers_to_static_cross_crate.rs:21 :15
2828 |
2929LL | unsafe { &static_cross_crate::ZERO[0] }
3030 | ^^^^^^^^^^^^^^^^^^^^^^^^
3131
3232error[E0080]: it is undefined behavior to use this value
33- --> $DIR/const_refers_to_static_cross_crate.rs:19 :1
33+ --> $DIR/const_refers_to_static_cross_crate.rs:18 :1
3434 |
35- LL | / const SLICE_MUT2 : &u8 = {
35+ LL | / const U8_MUT : &u8 = {
3636LL | |
3737LL | |
3838LL | | unsafe { &static_cross_crate::ZERO[0] }
@@ -43,11 +43,71 @@ LL | | };
4343 = 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.
4444
4545error: could not evaluate constant pattern
46- --> $DIR/const_refers_to_static_cross_crate.rs:36 :9
46+ --> $DIR/const_refers_to_static_cross_crate.rs:51 :9
4747 |
48- LL | SLICE_MUT2 => true,
49- | ^^^^^^^^^^
48+ LL | U8_MUT => true,
49+ | ^^^^^^
5050
51- error: aborting due to 4 previous errors; 2 warnings emitted
51+ warning: skipping const checks
52+ --> $DIR/const_refers_to_static_cross_crate.rs:28:17
53+ |
54+ LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
55+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56+
57+ warning: any use of this value will cause an error
58+ --> $DIR/const_refers_to_static_cross_crate.rs:28:14
59+ |
60+ LL | / const U8_MUT2: &u8 = {
61+ LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
62+ | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
63+ LL | |
64+ LL | |
65+ LL | |
66+ LL | | };
67+ | |__-
68+ |
69+ note: the lint level is defined here
70+ --> $DIR/const_refers_to_static_cross_crate.rs:26:8
71+ |
72+ LL | #[warn(const_err)]
73+ | ^^^^^^^^^
74+
75+ error: could not evaluate constant pattern
76+ --> $DIR/const_refers_to_static_cross_crate.rs:61:9
77+ |
78+ LL | U8_MUT2 => true,
79+ | ^^^^^^^
80+
81+ warning: skipping const checks
82+ --> $DIR/const_refers_to_static_cross_crate.rs:35:20
83+ |
84+ LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
85+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86+
87+ warning: any use of this value will cause an error
88+ --> $DIR/const_refers_to_static_cross_crate.rs:35:51
89+ |
90+ LL | / const U8_MUT3: &u8 = {
91+ LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
92+ | | ^^^^^^^^^^^ constant accesses static
93+ LL | |
94+ LL | |
95+ LL | |
96+ LL | | };
97+ | |__-
98+ |
99+ note: the lint level is defined here
100+ --> $DIR/const_refers_to_static_cross_crate.rs:33:8
101+ |
102+ LL | #[warn(const_err)]
103+ | ^^^^^^^^^
104+
105+ error: could not evaluate constant pattern
106+ --> $DIR/const_refers_to_static_cross_crate.rs:68:9
107+ |
108+ LL | U8_MUT3 => true,
109+ | ^^^^^^^
110+
111+ error: aborting due to 6 previous errors; 6 warnings emitted
52112
53113For more information about this error, try `rustc --explain E0080`.
0 commit comments