mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
11 lines
242 B
Rust
11 lines
242 B
Rust
#![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
|
|
}
|