diff options
| author | Johnathan Van Why <jrvanwhy@google.com> | 2019-01-22 15:02:57 -0800 |
|---|---|---|
| committer | Johnathan Van Why <jrvanwhy@google.com> | 2019-01-22 15:02:57 -0800 |
| commit | 0c54d2d12ee21f53657e76bf7d2ace9445520ff5 (patch) | |
| tree | e18f3833e5aa8d3f37b873b733839c428ba1e0b5 | |
| parent | ad30e9a6814b5d29dfbdcd85ecde48afcc94389b (diff) | |
| download | rust-0c54d2d12ee21f53657e76bf7d2ace9445520ff5.tar.gz rust-0c54d2d12ee21f53657e76bf7d2ace9445520ff5.zip | |
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.
| -rw-r--r-- | src/libcore/intrinsics.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index db19baf7a2c..74c0eae939c 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. /// |
