From 0c54d2d12ee21f53657e76bf7d2ace9445520ff5 Mon Sep 17 00:00:00 2001 From: Johnathan Van Why Date: Tue, 22 Jan 2019 15:02:57 -0800 Subject: [PATCH] Mention that core::intrinsics::transmute is available at core::mem::transmute. In #[no_std] environments, std::mem::transmute is unavailable. Searching for transmute in libcore only pulls up core::intrinsics::transmute, which is behind the (unstable) core_intrinsics feature flag. Users wishing to use transmute in #[no_std] environments typically should use core::mem::transmute instead, as it is stable. This documentation makes core::mem::transmute discoverable. --- src/libcore/intrinsics.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index db19baf7a2c6..74c0eae939cb 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -729,6 +729,10 @@ extern "rust-intrinsic" { /// cause [undefined behavior][ub] with this function. `transmute` should be /// the absolute last resort. /// + /// `transmute` is re-exported by [core::mem](../mem/index.html) as + /// `core::mem::transmute`, which may be used without the `core_intrinsics` + /// feature flag. + /// /// The [nomicon](../../nomicon/transmutes.html) has additional /// documentation. ///