1 // compile-flags: --crate-type=lib
2 #![feature(const_mut_refs)]
3 #![feature(const_precise_live_drops)]
4 #![feature(const_swap)]
6 // Mutable borrow of a field with drop impl.
8 let mut a: (u32, Option<String>) = (0, None); //~ ERROR destructors cannot be evaluated
12 // Mutable borrow of a type with drop impl.
14 let mut x = None; //~ ERROR destructors cannot be evaluated
15 let mut y = Some(String::new());
22 // Mutable borrow of a type with drop impl.
25 let mut y = Some(String::new());
30 let _z = x; //~ ERROR destructors cannot be evaluated
33 // Shared borrow of a type that might be !Freeze and Drop.
34 pub const fn g1<T>() {
35 let x: Option<T> = None; //~ ERROR destructors cannot be evaluated
39 // Shared borrow of a type that might be !Freeze and Drop.
40 pub const fn g2<T>() {
41 let x: Option<T> = None;
43 let _y = x; //~ ERROR destructors cannot be evaluated