summaryrefslogtreecommitdiffstats
path: root/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs
blob: cb90776472b5dc543fd395548d0cbe41082ca61f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![feature(type_alias_impl_trait)]

fn main() {
    let y = 42;
    let x = wrong_generic(&y);
    let z: i32 = x;
    //~^ ERROR non-defining opaque type use
}

type WrongGeneric<T> = impl 'static;
//~^ ERROR: at least one trait must be specified

fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
    t
    //~^ ERROR the parameter type `T` may not live long enough
}