diff options
Diffstat (limited to 'tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.rs')
-rw-r--r-- | tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.rs b/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.rs new file mode 100644 index 000000000..4465b43a7 --- /dev/null +++ b/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.rs @@ -0,0 +1,28 @@ +#![feature(unboxed_closures)] + +trait Zero { fn dummy(&self); } + +fn foo1(_: dyn Zero()) { + //~^ ERROR this trait takes 0 generic arguments but 1 generic argument + //~| ERROR associated type `Output` not found for `Zero` +} + +fn foo2(_: dyn Zero<usize>) { + //~^ ERROR this trait takes 0 generic arguments but 1 generic argument +} + +fn foo3(_: dyn Zero < usize >) { + //~^ ERROR this trait takes 0 generic arguments but 1 generic argument +} + +fn foo4(_: dyn Zero(usize)) { + //~^ ERROR this trait takes 0 generic arguments but 1 generic argument + //~| ERROR associated type `Output` not found for `Zero` +} + +fn foo5(_: dyn Zero ( usize )) { + //~^ ERROR this trait takes 0 generic arguments but 1 generic argument + //~| ERROR associated type `Output` not found for `Zero` +} + +fn main() { } |