1 #![feature(const_mut_refs)]
2 #![feature(const_trait_impl)]
4 impl const Drop for Panic { fn drop(&mut self) { panic!(); } }
5 pub const fn id<T>(x: T) -> T { x }
7 let _: &'static _ = &id(&Panic);
8 //~^ ERROR: temporary value dropped while borrowed
9 //~| ERROR: temporary value dropped while borrowed
13 let _: &'static _ = &id(&Panic);
14 //~^ ERROR: temporary value dropped while borrowed
15 //~| ERROR: temporary value dropped while borrowed
16 let _: &'static _ = &&(Panic, 0).1;
17 //~^ ERROR: temporary value dropped while borrowed
18 //~| ERROR: temporary value dropped while borrowed