diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/consts/const-ptr-unique.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ui/consts/const-ptr-unique.rs b/src/test/ui/consts/const-ptr-unique.rs new file mode 100644 index 000000000..252c5d1a9 --- /dev/null +++ b/src/test/ui/consts/const-ptr-unique.rs @@ -0,0 +1,10 @@ +#![feature(ptr_internals)] + +use std::ptr::Unique; + +fn main() { + let mut i: u32 = 10; + let unique = Unique::new(&mut i).unwrap(); + let x: &'static *mut u32 = &(unique.as_ptr()); + //~^ ERROR temporary value dropped while borrowed +} |