Rollup merge of #72920 - oli-obk:const_transmute, r=RalfJung

Stabilize `transmute` in constants and statics but not const fn

cc #53605 (leaving issue open so we can add `transmute` to `const fn` later)

Previous attempt: #64011

r? @RalfJung

cc @rust-lang/wg-const-eval
This commit is contained in:
Manish Goregaokar 2020-07-11 08:53:06 -07:00 committed by GitHub
commit b57ceb45b0
1 changed files with 1 additions and 9 deletions

View File

@ -57,14 +57,6 @@ LL | | t
LL | | }
| |_^
error: this could be a `const fn`
--> $DIR/could_be_const.rs:48:1
|
LL | / fn sub(x: u32) -> usize {
LL | | unsafe { transmute(&x) }
LL | | }
| |_^
error: this could be a `const fn`
--> $DIR/could_be_const.rs:67:9
|
@ -73,5 +65,5 @@ LL | | B
LL | | }
| |_________^
error: aborting due to 9 previous errors
error: aborting due to 8 previous errors