summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/issue-52663-trait-object.rs
blob: f6bbb2d14b003afb80e9f1d0225663f9bbe1be9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
}