af02f71
Add --fix option to meta script (closed #17) - ChillerDragonfn main() {
let in1 = String::from("foo"); // lifetime of in1 starts here
let in2 = String::from("bar"); // lifetime of in2 starts here
let out = longest(&in1, &in2); // 'a starts and ends here (just this line), lifetime of out starts here
drop(in1); // lifetime of in1 ends here
drop(in2); // lifetime of in2 ends here
println!("{}", out);
} // lifetime of out ends here
(edited)fn max<'a>(x: &'a str, y: &'a str) -> &'a str {
if x > y {
x
} else {
"abc"
}
}
{
let x = 5; // ----------+-- 'b
// |
let r = &x; // --+-- 'a |
// | |
println!("r: {}", r); // | |
// --+ |
} // ----------+
(edited)