diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-4735.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-4735.rs b/src/test/ui/issues/issue-4735.rs new file mode 100644 index 000000000..3ea4b01cd --- /dev/null +++ b/src/test/ui/issues/issue-4735.rs @@ -0,0 +1,19 @@ +// run-pass +// pretty-expanded FIXME #23616 + +use std::mem::transmute; + +struct NonCopyable(*const u8); + +impl Drop for NonCopyable { + fn drop(&mut self) { + let NonCopyable(p) = *self; + let _v = unsafe { transmute::<*const u8, Box<isize>>(p) }; + } +} + +pub fn main() { + let t = Box::new(0); + let p = unsafe { transmute::<Box<isize>, *const u8>(t) }; + let _z = NonCopyable(p); +} |