diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index baa9750d311aa..2e4b40fbae924 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -831,9 +831,7 @@ is a size mismatch in one of the impls. It is also possible to manually transmute: ``` -let result: SomeType = mem::uninitialized(); -unsafe { copy_nonoverlapping(&v, &result) }; -result // `v` transmuted to type `SomeType` +ptr::read(&v as *const _ as *const SomeType) // `v` transmuted to `SomeType` ``` "##,