summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lint/unused/issue-90807-unused-paren-error.rs
blob: 2fca2e262657eadd0241bfa02e300e1b27cd8234 (plain)
1
2
3
4
5
6
7
8
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
}