1 // Test that NLL analysis propagates lifetimes correctly through
2 // field accesses, Box accesses, etc.
6 fn foo(s: &mut (i32,)) -> i32 {
7 let t = &mut *s; // this borrow should last for the entire function
9 *s = (2,); //~ ERROR cannot assign to `*s`
13 fn bar(s: &Box<(i32,)>) -> &'static i32 {
14 // FIXME(#46983): error message should be better
15 &s.0 //~ ERROR explicit lifetime required in the type of `s` [E0621]