mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-18 18:04:13 +00:00
Add cases to where-allowed.rs
This commit is contained in:
parent
f710d41f77
commit
22f0940f2d
@ -48,7 +48,6 @@ fn in_dyn_Fn_parameter_in_parameters(_: &dyn Fn(impl Debug)) { panic!() }
|
||||
// Disallowed
|
||||
fn in_dyn_Fn_return_in_parameters(_: &dyn Fn() -> impl Debug) { panic!() }
|
||||
//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
|
||||
// FIXME -- no error currently
|
||||
|
||||
// Disallowed
|
||||
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!() }
|
||||
// Disallowed
|
||||
fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic!() }
|
||||
//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
|
||||
// FIXME -- no error currently
|
||||
|
||||
// Disallowed
|
||||
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!() }
|
||||
// Disallowed
|
||||
fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() }
|
||||
//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
|
||||
// FIXME -- no error currently
|
||||
|
||||
// Disallowed
|
||||
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!() }
|
||||
// Disallowed
|
||||
fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
|
||||
//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
|
||||
// FIXME -- no error currently
|
||||
|
||||
// Disallowed
|
||||
fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() }
|
||||
//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
|
||||
|
||||
// Disallowed
|
||||
fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() }
|
||||
//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
|
||||
|
||||
|
||||
// Allowed
|
||||
fn in_impl_Trait_in_parameters(_: impl Iterator<Item = impl Iterator>) { panic!() }
|
||||
|
Loading…
Reference in New Issue
Block a user