mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 10:13:54 +00:00
23 lines
325 B
Rust
23 lines
325 B
Rust
//@ check-pass
|
|
|
|
trait Captures<'a> {}
|
|
impl<T> Captures<'_> for T {}
|
|
|
|
fn foo(x: &mut i32) -> impl Sized + Captures<'_> + 'static {}
|
|
|
|
fn overlapping_mut() {
|
|
let i = &mut 1;
|
|
let x = foo(i);
|
|
let y = foo(i);
|
|
}
|
|
|
|
fn live_past_borrow() {
|
|
let y;
|
|
{
|
|
let x = &mut 1;
|
|
y = foo(x);
|
|
}
|
|
}
|
|
|
|
fn main() {}
|