// revisions: angle paren ok elision #![allow(dead_code)] #![feature(rustc_attrs)] #![feature(unboxed_closures)] trait Foo { type Item; } #[cfg(angle)] fn angle Foo>() { //[angle]~^ ERROR binding for associated type `Item` references lifetime `'a` } #[cfg(angle)] fn angle1() where T: for<'a> Foo { //[angle]~^ ERROR binding for associated type `Item` references lifetime `'a` } #[cfg(angle)] fn angle2() where for<'a> T: Foo { //[angle]~^ ERROR binding for associated type `Item` references lifetime `'a` } #[cfg(angle)] fn angle3(_: &dyn for<'a> Foo) { //[angle]~^ ERROR binding for associated type `Item` references lifetime `'a` } #[cfg(paren)] fn paren Fn() -> &'a i32>() { //[paren]~^ ERROR binding for associated type `Output` references lifetime `'a` } #[cfg(paren)] fn paren1() where T: for<'a> Fn() -> &'a i32 { //[paren]~^ ERROR binding for associated type `Output` references lifetime `'a` } #[cfg(paren)] fn paren2() where for<'a> T: Fn() -> &'a i32 { //[paren]~^ ERROR binding for associated type `Output` references lifetime `'a` } #[cfg(paren)] fn paren3(_: &dyn for<'a> Fn() -> &'a i32) { //[paren]~^ ERROR binding for associated type `Output` references lifetime `'a` } #[cfg(elision)] fn elision &i32>() { //[elision]~^ ERROR E0106 } struct Parameterized<'a> { x: &'a str } #[cfg(ok)] fn ok1 Fn(&Parameterized<'a>) -> &'a i32>() { } #[cfg(ok)] fn ok2 Fn<(&'b Parameterized<'a>,), Output=&'a i32>>() { } #[cfg(ok)] fn ok3() where for<'a> Parameterized<'a>: Foo { } #[rustc_error] fn main() { } //[ok]~ ERROR fatal error triggered by #[rustc_error]