fn my_fun<'a>(r: &'a i32) -> &'a i32 {
if *r > 5 {
r
} else {
&5
}
}
fn main() {
let result;
{
result = my_fun(&111);
}
println!("result: {}", result);
}
I expected the compile error but it works good.
What is the lifetime of &111
in the example above?