summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
blob: dfa0f76baa1865f2ac436c8fe8cae3fb23e23c07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
error[E0080]: it is undefined behavior to use this value
  --> $DIR/const_refers_to_static_cross_crate.rs:12:1
   |
LL | const SLICE_MUT: &[u8; 1] = {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
   |
   = 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.
   = note: the raw bytes of the constant (size: 8, align: 8) {
               ╾───────alloc1────────╼                         │ ╾──────╼
           }

error: could not evaluate constant pattern
  --> $DIR/const_refers_to_static_cross_crate.rs:40:9
   |
LL |         SLICE_MUT => true,
   |         ^^^^^^^^^

error[E0080]: it is undefined behavior to use this value
  --> $DIR/const_refers_to_static_cross_crate.rs:17:1
   |
LL | const U8_MUT: &u8 = {
   | ^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
   |
   = 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.
   = note: the raw bytes of the constant (size: 8, align: 8) {
               ╾───────alloc1────────╼                         │ ╾──────╼
           }

error: could not evaluate constant pattern
  --> $DIR/const_refers_to_static_cross_crate.rs:49:9
   |
LL |         U8_MUT => true,
   |         ^^^^^^

warning: any use of this value will cause an error
  --> $DIR/const_refers_to_static_cross_crate.rs:25:15
   |
LL | const U8_MUT2: &u8 = {
   | ------------------
LL |     unsafe { &(*static_cross_crate::ZERO_REF)[0] }
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
   |
note: the lint level is defined here
  --> $DIR/const_refers_to_static_cross_crate.rs:23:8
   |
LL | #[warn(const_err)]
   |        ^^^^^^^^^
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>

error: could not evaluate constant pattern
  --> $DIR/const_refers_to_static_cross_crate.rs:60:9
   |
LL |         U8_MUT2 => true,
   |         ^^^^^^^

warning: any use of this value will cause an error
  --> $DIR/const_refers_to_static_cross_crate.rs:32:20
   |
LL | const U8_MUT3: &u8 = {
   | ------------------
LL |     unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
   |
note: the lint level is defined here
  --> $DIR/const_refers_to_static_cross_crate.rs:30:8
   |
LL | #[warn(const_err)]
   |        ^^^^^^^^^
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>

error: could not evaluate constant pattern
  --> $DIR/const_refers_to_static_cross_crate.rs:68:9
   |
LL |         U8_MUT3 => true,
   |         ^^^^^^^

error: could not evaluate constant pattern
  --> $DIR/const_refers_to_static_cross_crate.rs:40:9
   |
LL |         SLICE_MUT => true,
   |         ^^^^^^^^^

error: could not evaluate constant pattern
  --> $DIR/const_refers_to_static_cross_crate.rs:49:9
   |
LL |         U8_MUT => true,
   |         ^^^^^^

error: could not evaluate constant pattern
  --> $DIR/const_refers_to_static_cross_crate.rs:60:9
   |
LL |         U8_MUT2 => true,
   |         ^^^^^^^

error: could not evaluate constant pattern
  --> $DIR/const_refers_to_static_cross_crate.rs:68:9
   |
LL |         U8_MUT3 => true,
   |         ^^^^^^^

warning: skipping const checks
   |
help: skipping check that does not even have a feature gate
  --> $DIR/const_refers_to_static_cross_crate.rs:14:15
   |
LL |     unsafe { &static_cross_crate::ZERO }
   |               ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
  --> $DIR/const_refers_to_static_cross_crate.rs:14:15
   |
LL |     unsafe { &static_cross_crate::ZERO }
   |               ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
  --> $DIR/const_refers_to_static_cross_crate.rs:19:15
   |
LL |     unsafe { &static_cross_crate::ZERO[0] }
   |               ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
  --> $DIR/const_refers_to_static_cross_crate.rs:19:15
   |
LL |     unsafe { &static_cross_crate::ZERO[0] }
   |               ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
  --> $DIR/const_refers_to_static_cross_crate.rs:19:15
   |
LL |     unsafe { &static_cross_crate::ZERO[0] }
   |               ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
  --> $DIR/const_refers_to_static_cross_crate.rs:25:17
   |
LL |     unsafe { &(*static_cross_crate::ZERO_REF)[0] }
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
  --> $DIR/const_refers_to_static_cross_crate.rs:32:20
   |
LL |     unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
  --> $DIR/const_refers_to_static_cross_crate.rs:32:20
   |
LL |     unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
  --> $DIR/const_refers_to_static_cross_crate.rs:32:20
   |
LL |     unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
  --> $DIR/const_refers_to_static_cross_crate.rs:32:20
   |
LL |     unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 10 previous errors; 3 warnings emitted

For more information about this error, try `rustc --explain E0080`.
Future incompatibility report: Future breakage diagnostic:
warning: any use of this value will cause an error
  --> $DIR/const_refers_to_static_cross_crate.rs:25:15
   |
LL | const U8_MUT2: &u8 = {
   | ------------------
LL |     unsafe { &(*static_cross_crate::ZERO_REF)[0] }
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
   |
note: the lint level is defined here
  --> $DIR/const_refers_to_static_cross_crate.rs:23:8
   |
LL | #[warn(const_err)]
   |        ^^^^^^^^^
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>

Future breakage diagnostic:
warning: any use of this value will cause an error
  --> $DIR/const_refers_to_static_cross_crate.rs:32:20
   |
LL | const U8_MUT3: &u8 = {
   | ------------------
LL |     unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
   |
note: the lint level is defined here
  --> $DIR/const_refers_to_static_cross_crate.rs:30:8
   |
LL | #[warn(const_err)]
   |        ^^^^^^^^^
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>