@@ -3,8 +3,6 @@ error[E0080]: it is undefined behavior to use this value
3
3
|
4
4
LL | / const SLICE_MUT: &[u8; 1] = {
5
5
LL | |
6
- LL | |
7
- LL | |
8
6
LL | | unsafe { &static_cross_crate::ZERO }
9
7
LL | | };
10
8
| |__^ type validation failed: encountered a reference pointing to a static variable
@@ -15,18 +13,16 @@ LL | | };
15
13
}
16
14
17
15
error: 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
19
17
|
20
18
LL | SLICE_MUT => true,
21
19
| ^^^^^^^^^
22
20
23
21
error[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
25
23
|
26
24
LL | / const U8_MUT: &u8 = {
27
25
LL | |
28
- LL | |
29
- LL | |
30
26
LL | | unsafe { &static_cross_crate::ZERO[0] }
31
27
LL | | };
32
28
| |__^ type validation failed: encountered a reference pointing to a static variable
@@ -37,143 +33,141 @@ LL | | };
37
33
}
38
34
39
35
error: 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
41
37
|
42
38
LL | U8_MUT => true,
43
39
| ^^^^^^
44
40
45
41
warning: 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
47
43
|
48
44
LL | / const U8_MUT2: &u8 = {
49
45
LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
50
46
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
51
47
LL | |
52
48
LL | |
53
49
LL | |
54
- LL | |
55
50
LL | | };
56
51
| |__-
57
52
|
58
53
note: 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
60
55
|
61
56
LL | #[warn(const_err)]
62
57
| ^^^^^^^^^
63
58
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
64
59
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
65
60
66
61
error: 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
68
63
|
69
64
LL | U8_MUT2 => true,
70
65
| ^^^^^^^
71
66
72
67
warning: 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
74
69
|
75
70
LL | / const U8_MUT3: &u8 = {
76
71
LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
77
72
| | ^^^^^^^^^^^ constant accesses static
78
73
LL | |
79
74
LL | |
80
- ... |
81
75
LL | |
82
76
LL | | };
83
77
| |__-
84
78
|
85
79
note: 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
87
81
|
88
82
LL | #[warn(const_err)]
89
83
| ^^^^^^^^^
90
84
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
91
85
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
92
86
93
87
error: 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
95
89
|
96
90
LL | U8_MUT3 => true,
97
91
| ^^^^^^^
98
92
99
93
error: 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
101
95
|
102
96
LL | SLICE_MUT => true,
103
97
| ^^^^^^^^^
104
98
105
99
error: 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
107
101
|
108
102
LL | U8_MUT => true,
109
103
| ^^^^^^
110
104
111
105
error: 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
113
107
|
114
108
LL | U8_MUT2 => true,
115
109
| ^^^^^^^
116
110
117
111
error: 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
119
113
|
120
114
LL | U8_MUT3 => true,
121
115
| ^^^^^^^
122
116
123
117
warning: skipping const checks
124
118
|
125
119
help: 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
127
121
|
128
122
LL | unsafe { &static_cross_crate::ZERO }
129
123
| ^^^^^^^^^^^^^^^^^^^^^^^^
130
124
help: 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
132
126
|
133
127
LL | unsafe { &static_cross_crate::ZERO }
134
128
| ^^^^^^^^^^^^^^^^^^^^^^^^
135
129
help: 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
137
131
|
138
132
LL | unsafe { &static_cross_crate::ZERO[0] }
139
133
| ^^^^^^^^^^^^^^^^^^^^^^^^
140
134
help: 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
142
136
|
143
137
LL | unsafe { &static_cross_crate::ZERO[0] }
144
138
| ^^^^^^^^^^^^^^^^^^^^^^^^
145
139
help: 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
147
141
|
148
142
LL | unsafe { &static_cross_crate::ZERO[0] }
149
143
| ^^^^^^^^^^^^^^^^^^^^^^^^
150
144
help: 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
152
146
|
153
147
LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
154
148
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
155
149
help: 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
157
151
|
158
152
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
159
153
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
160
154
help: 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
162
156
|
163
157
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
164
158
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
165
159
help: 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
167
161
|
168
162
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
169
163
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
170
164
help: 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
172
166
|
173
167
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
174
168
| ^^^^^^^^
175
169
help: 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
177
171
|
178
172
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
179
173
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments