summaryrefslogtreecommitdiffstats
path: root/tests/ui/wf/wf-outlives-ty-in-fn-or-trait.rs
blob: 85a332e244ff0f1dca05c15a6096c644a55f0474 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#![feature(rustc_attrs)]
#![allow(dead_code)]

trait Trait<'a, T> {
    type Out;
}

impl<'a, T> Trait<'a, T> for usize {
    type Out = &'a fn(T); //~ ERROR `T` may not live long enough
}

struct Foo<'a,T> {
    f: &'a fn(T),
}

trait Baz<T> { }

impl<'a, T> Trait<'a, T> for u32 {
    type Out = &'a dyn Baz<T>; //~ ERROR `T` may not live long enough
}

fn main() { }