Skip to content

Commit

Permalink
Mention that core::intrinsics::transmute is available at core::mem::t…
Browse files Browse the repository at this point in the history
…ransmute.

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.
  • Loading branch information
jrvanwhy committed Jan 22, 2019
1 parent ad30e9a commit 0c54d2d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down

0 comments on commit 0c54d2d

Please sign in to comment.