mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
19 lines
277 B
Rust
19 lines
277 B
Rust
//@ check-pass
|
|
|
|
trait Foo {
|
|
fn rpitit(&mut self) -> impl Sized + 'static;
|
|
}
|
|
|
|
fn live_past_borrow<T: Foo>(mut t: T) {
|
|
let x = t.rpitit();
|
|
drop(t);
|
|
drop(x);
|
|
}
|
|
|
|
fn overlapping_mut<T: Foo>(mut t: T) {
|
|
let a = t.rpitit();
|
|
let b = t.rpitit();
|
|
}
|
|
|
|
fn main() {}
|