1 #![feature(const_precise_live_drops)]
2 pub const fn id<T>(x: T) -> T { x }
4 let _: &'static _ = &id(&String::new());
5 //~^ ERROR: temporary value dropped while borrowed
6 //~| ERROR: temporary value dropped while borrowed
7 //~| ERROR: destructor of `String` cannot be evaluated at compile-time
11 let _: &'static _ = &id(&String::new());
12 //~^ ERROR: temporary value dropped while borrowed
13 //~| ERROR: temporary value dropped while borrowed