about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/diagnostics.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs
index baa9750d311..2e4b40fbae9 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`
 ```
 "##,