Skip to content

Commit 59a661a

Browse files
committed
slight cleanup to text.
1 parent 9a45f33 commit 59a661a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

posts/2022-09-15-const-eval-safety-rule-revision.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,19 +182,21 @@ as they had originally thought.
182182
## Change is hard
183183

184184
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
188190
`const_fn_`{`transmute`,`union`} [stabilization report][cftu report],
189191
specifically the subsection entitled "Pointer-integer-transmutes".
190192

191193
[cftu report]: https://github.com/rust-lang/rust/pull/85769#issuecomment-854363720
192194

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
194196
is not a new thing at all. The only change here was that Miri had some internal
195197
changes that made it start detecting the UB rather than silently ignoring it.
196198

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
198200
explicitly catch. We anticipated this: RFC 3016, "const UB", explicitly
199201
[says](https://github.com/rust-lang/rfcs/blob/master/text/3016-const-ub.md#guide-level-explanation):
200202

0 commit comments

Comments
 (0)