// This doesn't compile (with good reason!):
#[allow(unused)]
fn reassign_and_return_arg(mut arg: &()) -> &() {
let local = ();
arg = &local;
arg
//~^ ERROR cannot return value referencing local variable `local`
}
// This doesn't compile either:
#[allow(unused)]
fn reassign_arg(mut arg: &()) {
let local = ();
//~^ ERROR `local` does not live long enough
arg = &local;
}
// But this compiles (WHAT):
#[allow(unused)]
async fn reassign_arg_async(mut arg: &()) {
let local = ();
arg = &local;
}