about summary refs log tree commit diff
path: root/tests/ui/impl-trait/in-bindings/lifetime-failure.rs
blob: df685c36c435e0a86eeff5ea451bce6afe783c47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#![feature(impl_trait_in_bindings)]

trait Static: 'static {}
impl<T: 'static> Static for T {}

struct W<T>(T);

fn main() {
    let local = 0;
    let _: W<impl Static> = W(&local);
    //~^ ERROR `local` does not live long enough
}