Consider this example:
fn borrow<'a>(i:&'a mut i32)->&'a mut i32{
let v = & /*'r*/ mut *i; // #1
v
}
The reborrowing constraint at #1 is 'a:'r. However, for v being returned, is the constraint 'r:'a also imposed on the lifetime 'r? Because Type coercions - The Rust Reference says
Function results—either the final line of a block if it is not semicolon-terminated or any expression in a
returnstatement
To coerce &'r mut i32 to &'a mut i32, the former must be the subtype of the latter, so 'r:'a. Is there a requirement like that imposed on v? So, the final constraints are 'a:'r and 'r:'a, so the 'r must be 'a to satisfies these constraints. Is my understanding right?