diff options
Diffstat (limited to 'tests/ui/consts/const-ptr-unique.rs')
-rw-r--r-- | tests/ui/consts/const-ptr-unique.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/consts/const-ptr-unique.rs b/tests/ui/consts/const-ptr-unique.rs new file mode 100644 index 000000000..252c5d1a9 --- /dev/null +++ b/tests/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 +} |