diff options
| author | bors <bors@rust-lang.org> | 2023-04-02 22:12:46 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-04-02 22:12:46 +0000 |
| commit | 7fe83edc11ccc255372be5a7bc0372d6011cc5df (patch) | |
| tree | abb71448ca79b90a19bbee20c532c228b79bfa9b /tests | |
| parent | 8f0ba1f2e0c08d67c6b57a2e6b01cc87428b5341 (diff) | |
| parent | 36047b0216b9fb4741e8927c7e6b644727e02fdf (diff) | |
Auto merge of #10588 - blyxyas:fix-allow_nonminimal_bool, r=llogiq
Fix `nonminimal_bool` `#[allow]` attributes. Closes #10435 changelog: [`nonminimal_bool`]: Fix false-positive where the lint ignore `#[allow]` attributes. r? `@llogiq`
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/nonminimal_bool.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/nonminimal_bool.rs b/tests/ui/nonminimal_bool.rs index 3b5a374b4a7..80cc7c60f56 100644 --- a/tests/ui/nonminimal_bool.rs +++ b/tests/ui/nonminimal_bool.rs @@ -92,3 +92,21 @@ fn issue_10523_2() { } if a!() {} } + +fn issue_10435() { + let x = vec![0]; + let y = vec![1]; + let z = vec![2]; + + // vvv Should not lint + #[allow(clippy::nonminimal_bool)] + if !x.is_empty() && !(y.is_empty() || z.is_empty()) { + println!("{}", line!()); + } + + // vvv Should not lint (#10435 talks about a bug where it lints) + #[allow(clippy::nonminimal_bool)] + if !(x == [0]) { + println!("{}", line!()); + } +} |
