rust/tests/ui/lint/unused/issue-90807-unused-paren-error.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
333 B
Rust
Raw Normal View History

// 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
}