Skip to content

Commit 0c54d2d

Browse files
committed
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.
1 parent ad30e9a commit 0c54d2d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libcore/intrinsics.rs

+4
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,10 @@ extern "rust-intrinsic" {
729729
/// cause [undefined behavior][ub] with this function. `transmute` should be
730730
/// the absolute last resort.
731731
///
732+
/// `transmute` is re-exported by [core::mem](../mem/index.html) as
733+
/// `core::mem::transmute`, which may be used without the `core_intrinsics`
734+
/// feature flag.
735+
///
732736
/// The [nomicon](../../nomicon/transmutes.html) has additional
733737
/// documentation.
734738
///

0 commit comments

Comments
 (0)