mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 11:44:28 +00:00
doc: improve transmute example a little
This commit is contained in:
parent
aca2057ed5
commit
b667ff7d6e
@ -247,8 +247,8 @@ extern "rust-intrinsic" {
|
||||
/// ```
|
||||
/// use std::mem;
|
||||
///
|
||||
/// let v: &[u8] = unsafe { mem::transmute("L") };
|
||||
/// assert!(v == [76]);
|
||||
/// let array: &[u8] = unsafe { mem::transmute("Rust") };
|
||||
/// assert_eq!(array, [82, 117, 115, 116]);
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn transmute<T,U>(e: T) -> U;
|
||||
|
Loading…
Reference in New Issue
Block a user