1 // Test that NLL analysis propagates lifetimes correctly through
2 // field accesses, Box accesses, etc.
4 fn foo(s: &mut (i32,)) -> i32 {
5 let t = &mut *s; // this borrow should last for the entire function
7 *s = (2,); //~ ERROR cannot assign to `*s`
11 fn bar(s: &Box<(i32,)>) -> &'static i32 {
12 // FIXME(#46983): error message should be better
13 &s.0 //~ ERROR lifetime may not live long enough