diff options
Diffstat (limited to 'tests/ui/no-patterns-in-args-2.rs')
-rw-r--r-- | tests/ui/no-patterns-in-args-2.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/no-patterns-in-args-2.rs b/tests/ui/no-patterns-in-args-2.rs new file mode 100644 index 000000000..85b7fc5cd --- /dev/null +++ b/tests/ui/no-patterns-in-args-2.rs @@ -0,0 +1,13 @@ +#![deny(patterns_in_fns_without_body)] + +trait Tr { + fn f1(mut arg: u8); //~ ERROR patterns aren't allowed in functions without bodies + //~^ WARN was previously accepted + fn f2(&arg: u8); //~ ERROR patterns aren't allowed in functions without bodies + fn g1(arg: u8); // OK + fn g2(_: u8); // OK + #[allow(anonymous_parameters)] + fn g3(u8); // OK +} + +fn main() {} |