Skip to content

Commit 655b564

Browse files
committed
Add note that const-eval UB of transmute::<*_, usize> is established in docs of latter.
1 parent 60d2eea commit 655b564

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,13 @@ ever since const-eval added support for
199199
`transmute` and `union`. You can read more about this in the
200200
`const_fn_transmute` / `const_fn_union` [stabilization report][cftu report],
201201
specifically the subsection entitled "Pointer-integer-transmutes".
202+
(It is also mentioned in the [documentation][doc for transmute] for `transmute`<!--,
203+
though with less discussion than what you see in the stabilization report -->.)
202204

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

207+
[doc for transmute]: https://doc.rust-lang.org/std/mem/fn.transmute.html
208+
205209
Thus, we can see that the classification of the above examples as UB during const evaluation
206210
is not a new thing at all. The only change here was that Miri had some internal
207211
changes that made it start detecting the UB rather than silently ignoring it.

0 commit comments

Comments
 (0)