rust/tests/ui/wf/wf-outlives-ty-in-fn-or-trait.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
370 B
Rust
Raw Normal View History

#![feature(rustc_attrs)]
#![allow(dead_code)]
trait Trait<'a, T> {
type Out;
}
impl<'a, T> Trait<'a, T> for usize {
2018-11-27 03:56:36 -06:00
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 {
2019-05-28 13:46:13 -05:00
type Out = &'a dyn Baz<T>; //~ ERROR `T` may not live long enough
}
fn main() { }