From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../require-parens-for-chained-comparison.rs | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/test/ui/parser/require-parens-for-chained-comparison.rs (limited to 'src/test/ui/parser/require-parens-for-chained-comparison.rs') diff --git a/src/test/ui/parser/require-parens-for-chained-comparison.rs b/src/test/ui/parser/require-parens-for-chained-comparison.rs new file mode 100644 index 000000000..f29fd7a54 --- /dev/null +++ b/src/test/ui/parser/require-parens-for-chained-comparison.rs @@ -0,0 +1,36 @@ +fn main() { + false == false == false; + //~^ ERROR comparison operators cannot be chained + //~| HELP split the comparison into two + + false == 0 < 2; + //~^ ERROR comparison operators cannot be chained + //~| HELP parenthesize the comparison + + f(); + //~^ ERROR comparison operators cannot be chained + //~| HELP use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments + + f, Option>>(1, 2); + //~^ ERROR comparison operators cannot be chained + //~| HELP use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments + + let _ = f(); + //~^ ERROR expected one of + //~| HELP use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments + + let _ = f<'_, i8>(); + //~^ ERROR expected one of + //~| HELP use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments + //~| ERROR expected + + f<'_>(); + //~^ comparison operators cannot be chained + //~| HELP use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments + //~| ERROR expected + + let _ = f; + //~^ ERROR comparison operators cannot be chained + //~| HELP use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments + //~| HELP or use `(...)` if you meant to specify fn arguments +} -- cgit v1.2.3