summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-ptr-unique.rs
blob: 252c5d1a9cda57e0a7e92a971baa8441d037fc9a (plain)
1
2
3
4
5
6
7
8
9
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
}