1 // revisions: sig local structure ok elision
4 #![feature(rustc_attrs)]
5 #![feature(unboxed_closures)]
12 fn sig1(_: for<'a> fn() -> &'a i32) {
13 //[sig]~^ ERROR return type references lifetime `'a`
17 fn sig2(_: for<'a, 'b> fn(&'b i32) -> &'a i32) {
18 //[sig]~^ ERROR return type references lifetime `'a`
23 let _: for<'a> fn() -> &'a i32 = loop { };
24 //[local]~^ ERROR return type references lifetime `'a`
29 x: for<'a> fn() -> &'a i32
30 //[structure]~^ ERROR return type references lifetime `'a`
34 fn elision(_: fn() -> &i32) {
35 //[elision]~^ ERROR E0106
38 struct Parameterized<'a> { x: &'a str }
41 fn ok1(_: &dyn for<'a> Fn(&Parameterized<'a>) -> &'a i32) {
45 fn ok2(_: &dyn for<'a,'b> Fn<(&'b Parameterized<'a>,), Output=&'a i32>) {
49 fn main() { } //[ok]~ ERROR fatal error triggered by #[rustc_error]