@@ -182,19 +182,21 @@ as they had originally thought.
182
182
## Change is hard
183
183
184
184
You might well be wondering at this point: "Wait, when * is* it okay to transmute
185
- a pointer to a ` usize ` during const evaluation?" And the answer is: "Never. It
186
- has always been undefined behavior, ever since const-eval added support for
187
- ` transmute ` and ` union ` ." You can read more about this in the
185
+ a pointer to a ` usize ` during const evaluation?" And the answer is: "Never."
186
+
187
+ Transmuting a pointer to a usize during const-eval has always been undefined behavior,
188
+ ever since const-eval added support for
189
+ ` transmute ` and ` union ` . You can read more about this in the
188
190
` const_fn_ ` {` transmute ` ,` union ` } [ stabilization report] [ cftu report ] ,
189
191
specifically the subsection entitled "Pointer-integer-transmutes".
190
192
191
193
[ cftu report ] : https://github.com/rust-lang/rust/pull/85769#issuecomment-854363720
192
194
193
- Thus, we can see that the classification of this as UB during const evaluation
195
+ Thus, we can see that the classification of the above examples as UB during const evaluation
194
196
is not a new thing at all. The only change here was that Miri had some internal
195
197
changes that made it start detecting the UB rather than silently ignoring it.
196
198
197
- So we see that the Rust compiler has a shifting notion of what UB it will
199
+ This means the Rust compiler has a shifting notion of what UB it will
198
200
explicitly catch. We anticipated this: RFC 3016, "const UB", explicitly
199
201
[ says] ( https://github.com/rust-lang/rfcs/blob/master/text/3016-const-ub.md#guide-level-explanation ) :
200
202
0 commit comments