summaryrefslogtreecommitdiffstats
path: root/tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs
blob: d3e169a70d3f7f30471d26e9186092e2a83ad880 (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 expected generic type parameter, found `&'static i32
}

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
}