2018-10-05 16:31:33 -05:00
|
|
|
trait Foo { fn get(&self); }
|
|
|
|
|
|
|
|
impl<A> Foo for A {
|
|
|
|
fn get(&self) { }
|
|
|
|
}
|
|
|
|
|
2021-08-24 19:39:40 -05:00
|
|
|
|
|
|
|
|
2018-10-05 16:31:33 -05:00
|
|
|
fn main() {
|
|
|
|
let _ = {
|
|
|
|
let tmp0 = 3;
|
|
|
|
let tmp1 = &tmp0;
|
2021-08-24 19:39:40 -05:00
|
|
|
Box::new(tmp1) as Box<dyn Foo + '_>
|
2018-10-05 16:31:33 -05:00
|
|
|
};
|
|
|
|
//~^^^ ERROR `tmp0` does not live long enough
|
|
|
|
}
|