From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/lint/unused/issue-90807-unused-paren-error.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/ui/lint/unused/issue-90807-unused-paren-error.rs (limited to 'tests/ui/lint/unused/issue-90807-unused-paren-error.rs') diff --git a/tests/ui/lint/unused/issue-90807-unused-paren-error.rs b/tests/ui/lint/unused/issue-90807-unused-paren-error.rs new file mode 100644 index 000000000..2fca2e262 --- /dev/null +++ b/tests/ui/lint/unused/issue-90807-unused-paren-error.rs @@ -0,0 +1,9 @@ +// Make sure unused parens lint emit is emitted for loop and match. +// See https://github.com/rust-lang/rust/issues/90807 +// and https://github.com/rust-lang/rust/pull/91956#discussion_r771647953 +#![deny(unused_parens)] + +fn main() { + for _ in (1..loop { break 2 }) {} //~ERROR + for _ in (1..match () { () => 2 }) {} //~ERROR +} -- cgit v1.2.3