mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 03:25:55 +00:00
17 lines
254 B
Rust
17 lines
254 B
Rust
trait Foo { fn get(&self); }
|
|
|
|
impl<A> Foo for A {
|
|
fn get(&self) { }
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
let _ = {
|
|
let tmp0 = 3;
|
|
let tmp1 = &tmp0;
|
|
Box::new(tmp1) as Box<dyn Foo + '_>
|
|
};
|
|
//~^^^ ERROR `tmp0` does not live long enough
|
|
}
|