@@ -48,7 +48,6 @@ fn in_dyn_Fn_parameter_in_parameters(_: &dyn Fn(impl Debug)) { panic!() }
48
48
// Disallowed
49
49
fn in_dyn_Fn_return_in_parameters ( _: & dyn Fn ( ) -> impl Debug ) { panic ! ( ) }
50
50
//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
51
- // FIXME -- no error currently
52
51
53
52
// Disallowed
54
53
fn in_dyn_Fn_parameter_in_return ( ) -> & ' static dyn Fn ( impl Debug ) { panic ! ( ) }
@@ -57,7 +56,6 @@ fn in_dyn_Fn_parameter_in_return() -> &'static dyn Fn(impl Debug) { panic!() }
57
56
// Disallowed
58
57
fn in_dyn_Fn_return_in_return ( ) -> & ' static dyn Fn ( ) -> impl Debug { panic ! ( ) }
59
58
//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
60
- // FIXME -- no error currently
61
59
62
60
// Disallowed
63
61
fn in_impl_Fn_parameter_in_parameters ( _: & impl Fn ( impl Debug ) ) { panic ! ( ) }
@@ -66,7 +64,6 @@ fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
66
64
// Disallowed
67
65
fn in_impl_Fn_return_in_parameters ( _: & impl Fn ( ) -> impl Debug ) { panic ! ( ) }
68
66
//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
69
- // FIXME -- no error currently
70
67
71
68
// Disallowed
72
69
fn in_impl_Fn_parameter_in_return ( ) -> & ' static impl Fn ( impl Debug ) { panic ! ( ) }
@@ -75,7 +72,15 @@ fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
75
72
// Disallowed
76
73
fn in_impl_Fn_return_in_return ( ) -> & ' static impl Fn ( ) -> impl Debug { panic ! ( ) }
77
74
//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
78
- // FIXME -- no error currently
75
+
76
+ // Disallowed
77
+ fn in_Fn_parameter_in_generics < F : Fn ( impl Debug ) > ( _: F ) { panic ! ( ) }
78
+ //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
79
+
80
+ // Disallowed
81
+ fn in_Fn_return_in_generics < F : Fn ( ) -> impl Debug > ( _: F ) { panic ! ( ) }
82
+ //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
83
+
79
84
80
85
// Allowed
81
86
fn in_impl_Trait_in_parameters ( _: impl Iterator < Item = impl Iterator > ) { panic ! ( ) }
0 commit comments