Skip to content

Commit 067ad99

Browse files
committed
Fix E0139 code
Fixes #27946
1 parent 2b45a0d commit 067ad99

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/librustc/diagnostics.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -831,9 +831,7 @@ is a size mismatch in one of the impls.
831831
It is also possible to manually transmute:
832832
833833
```
834-
let result: SomeType = mem::uninitialized();
835-
unsafe { copy_nonoverlapping(&v, &result) };
836-
result // `v` transmuted to type `SomeType`
834+
ptr::read(&v as *const _ as *const SomeType) // `v` transmuted to `SomeType`
837835
```
838836
"##,
839837

0 commit comments

Comments
 (0)