2023-09-20 23:11:08 -05:00
|
|
|
// check-pass
|
|
|
|
|
|
|
|
trait Captures<'a> {}
|
|
|
|
impl<T> Captures<'_> for T {}
|
|
|
|
|
2023-10-14 09:28:44 -05:00
|
|
|
fn foo(x: &mut i32) -> impl Sized + Captures<'_> + 'static {}
|
2023-09-20 23:11:08 -05:00
|
|
|
|
2023-10-14 09:28:44 -05:00
|
|
|
fn overlapping_mut() {
|
|
|
|
let i = &mut 1;
|
|
|
|
let x = foo(i);
|
|
|
|
let y = foo(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn live_past_borrow() {
|
2023-09-20 23:11:08 -05:00
|
|
|
let y;
|
|
|
|
{
|
2023-10-14 09:28:44 -05:00
|
|
|
let x = &mut 1;
|
|
|
|
y = foo(x);
|
2023-09-20 23:11:08 -05:00
|
|
|
}
|
|
|
|
}
|
2023-10-14 09:28:44 -05:00
|
|
|
|
|
|
|
fn main() {}
|