]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Rollup merge of #73862 - oli-obk:const_array_to_slice, r=RalfJung
authorManish Goregaokar <manishsmail@gmail.com>
Sat, 11 Jul 2020 06:26:26 +0000 (23:26 -0700)
committerGitHub <noreply@github.com>
Sat, 11 Jul 2020 06:26:26 +0000 (23:26 -0700)
commitf4f969027c6378264be509ba5ae512e35258f2e5
tree4e781dbfd2c2ae83b96a82abb7ce405769a88d96
parentd82588b45aa866418a3cc88924e939015fd1bd1c
parent7e682d3f6f5761471e05fefc21e5de6ce4a52444
Rollup merge of #73862 - oli-obk:const_array_to_slice, r=RalfJung

Stabilize casts and coercions to `&[T]` in const fn

Part of #64992

There was never a reason to not stabilize this, we just accidentally prevented them when we implemented the `min_const_fn` feature that gave us `const fn` on stable. This PR stabilizes these casts (which are already stable in `const` outside `const fn`), while keeping all other unsizing casts (so `T` -> `dyn Trait`) unstable within const fn.
These casts have no forward compatibility concerns with any future features for const eval and users were able to use them under the `const_fn` feature gate already since at least the miri merger, possibly longer.

r? @rust-lang/lang
src/librustc_middle/ty/layout.rs
src/librustc_mir/transform/qualify_min_const_fn.rs