]> git.lizzy.rs Git - rust.git/blob - tests/ui/wf/wf-outlives-ty-in-fn-or-trait.rs
Rollup merge of #106244 - atouchet:readme3, r=workingjubilee
[rust.git] / tests / ui / wf / wf-outlives-ty-in-fn-or-trait.rs
1 #![feature(rustc_attrs)]
2 #![allow(dead_code)]
3
4 trait Trait<'a, T> {
5     type Out;
6 }
7
8 impl<'a, T> Trait<'a, T> for usize {
9     type Out = &'a fn(T); //~ ERROR `T` may not live long enough
10 }
11
12 struct Foo<'a,T> {
13     f: &'a fn(T),
14 }
15
16 trait Baz<T> { }
17
18 impl<'a, T> Trait<'a, T> for u32 {
19     type Out = &'a dyn Baz<T>; //~ ERROR `T` may not live long enough
20 }
21
22 fn main() { }