rust/tests/ui-internal/author/loop.rs
blyxyas 698363122e Do not run lints that cannot emit
Before this change, adding a lint was a difficult matter
because it always had some overhead involved. This was
because all lints would run, no matter their default level,
or if the user had #![allow]ed them. This PR changes that
2024-10-19 16:19:44 +02:00

41 lines
578 B
Rust

#![feature(stmt_expr_attributes)]
#![allow(
clippy::never_loop,
clippy::while_immutable_condition,
clippy::redundant_pattern_matching
)]
fn main() {
#[clippy::author]
for y in 0..10 {
let z = y;
}
#[clippy::author]
for _ in 0..10 {
break;
}
#[clippy::author]
'label: for _ in 0..10 {
break 'label;
}
let a = true;
#[clippy::author]
while a {
break;
}
#[clippy::author]
while let true = a {
break;
}
#[clippy::author]
loop {
break;
}
}