1 // Regression test for #31567: cached results of projections were
2 // causing region relations not to be enforced at all the places where
3 // they have to be enforced.
7 struct VecWrapper<'a>(&'a mut S);
11 fn get_dangling<'a>(v: VecWrapper<'a>) -> &'a u32 {
12 let s_inner: &'a S = &*v.0; //~ ERROR borrow may still be in use when destructor runs [E0713]
16 impl<'a> Drop for VecWrapper<'a> {
18 *self.0 = S(Box::new(0));
23 let mut s = S(Box::new(11));
24 let vw = VecWrapper(&mut s);
25 let dangling = get_dangling(vw);
26 println!("{}", dangling);