From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/anon-params/anon-params-denied-2018.rs | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/ui/anon-params/anon-params-denied-2018.rs (limited to 'tests/ui/anon-params/anon-params-denied-2018.rs') diff --git a/tests/ui/anon-params/anon-params-denied-2018.rs b/tests/ui/anon-params/anon-params-denied-2018.rs new file mode 100644 index 000000000..95533cf3d --- /dev/null +++ b/tests/ui/anon-params/anon-params-denied-2018.rs @@ -0,0 +1,32 @@ +// Tests that anonymous parameters are a hard error in edition 2018. + +// edition:2018 + +trait T { + fn foo(i32); //~ expected one of `:`, `@`, or `|`, found `)` + + // Also checks with `&` + fn foo_with_ref(&mut i32); + //~^ ERROR expected one of `:`, `@`, or `|`, found `)` + + fn foo_with_qualified_path(::Baz); + //~^ ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)` + + fn foo_with_qualified_path_and_ref(&::Baz); + //~^ ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)` + + fn foo_with_multiple_qualified_paths(::Baz, ::Baz); + //~^ ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `,` + //~| ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)` + + fn bar_with_default_impl(String, String) {} + //~^ ERROR expected one of `:` + //~| ERROR expected one of `:` + + // do not complain about missing `b` + fn baz(a:usize, b, c: usize) -> usize { //~ ERROR expected one of `:` + a + b + c + } +} + +fn main() {} -- cgit v1.2.3