未验证 提交 b20aff2b 编写于 作者: Y Yuki Okushi 提交者: GitHub

Rollup merge of #97269 - RalfJung:transmute, r=m-ou-se

adjust transmute const stabilization version

With 1.46, this became callable only in `const`/`static` items.

Only since 1.56 is this callable in `const fn`: [changelog](https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1560-2021-10-21)

Also see [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/transmute.20const.20fn.20stabilization).
...@@ -1144,7 +1144,7 @@ pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) { ...@@ -1144,7 +1144,7 @@ pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
/// } /// }
/// ``` /// ```
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_transmute", since = "1.46.0")] #[rustc_const_stable(feature = "const_transmute", since = "1.56.0")]
#[rustc_diagnostic_item = "transmute"] #[rustc_diagnostic_item = "transmute"]
pub fn transmute<T, U>(e: T) -> U; pub fn transmute<T, U>(e: T) -> U;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册