3 // from issue #93951, where borrowck complained the temporary that `foo(&x)` was stored in was to
4 // be dropped sometime after `x` was. It then suggested adding a semicolon that was already there.
9 fn foo<'a>(x: &'a str) -> Result<impl Debug + 'a, ()> {
14 let x = String::from("Hey");
15 let Ok(_) = foo(&x) else { return };
19 let x = String::from("Hey");
20 let _ = if let Ok(s) = foo(&x) { s } else { return };