error[E0521]: borrowed data escapes outside of closure --> tests/ui/test_client_cannot_be_smuggled_out.rs:9:31 | 6 | Client::new(|client, _| { | ------ | | | `client` is a reference that is only valid in the closure body | has type `&mut Client<'1>` ... 9 | let smuggled_client = std::mem::replace(client, other_client); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | `client` escapes the closure body here | argument requires that `'1` must outlive `'static` | = note: requirement occurs because of a mutable reference to `Client<'_>` = note: mutable references are invariant over their type parameter = help: see for more information about variance