Skip to content

Commit 22f0940

Browse files
committed
Add cases to where-allowed.rs
1 parent f710d41 commit 22f0940

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/test/compile-fail/impl-trait/where-allowed.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ fn in_dyn_Fn_parameter_in_parameters(_: &dyn Fn(impl Debug)) { panic!() }
4848
// Disallowed
4949
fn in_dyn_Fn_return_in_parameters(_: &dyn Fn() -> impl Debug) { panic!() }
5050
//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
51-
// FIXME -- no error currently
5251

5352
// Disallowed
5453
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!() }
5756
// Disallowed
5857
fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic!() }
5958
//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
60-
// FIXME -- no error currently
6159

6260
// Disallowed
6361
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!() }
6664
// Disallowed
6765
fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() }
6866
//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
69-
// FIXME -- no error currently
7067

7168
// Disallowed
7269
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!() }
7572
// Disallowed
7673
fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
7774
//~^ 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+
7984

8085
// Allowed
8186
fn in_impl_Trait_in_parameters(_: impl Iterator<Item = impl Iterator>) { panic!() }

0 commit comments

Comments
 (0)