Improve transmute diagnostics with a note about destructors
fixes #29922
This commit is contained in:
parent
352853c18b
commit
bef93557e5
1 changed files with 3 additions and 0 deletions
|
@ -858,6 +858,9 @@ It is also possible to manually transmute:
|
|||
```
|
||||
ptr::read(&v as *const _ as *const SomeType) // `v` transmuted to `SomeType`
|
||||
```
|
||||
|
||||
Note that this does not move `v` (unlike `transmute`), and may need a
|
||||
call to `mem::forget(v)` in case you want to avoid destructors being called.
|
||||
"##,
|
||||
|
||||
E0152: r##"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue