diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2015-11-22 10:26:50 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-11-22 10:26:50 +0530 |
| commit | bef93557e5f230e2d99d1fa5f0f8b9354c85ac7c (patch) | |
| tree | f7596319480e9bdb97b5062e4f438f1d829b836a | |
| parent | 352853c18bf1ec00c69725ee97ae1e3c0bb176fe (diff) | |
Improve transmute diagnostics with a note about destructors
fixes #29922
| -rw-r--r-- | src/librustc/diagnostics.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index 7cb2de78e2c..361b8c53108 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -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##" |
