Skip to content

Make span_suggestions always verbose#154605

Open
estebank wants to merge 1 commit intorust-lang:mainfrom
estebank:attr-suggest
Open

Make span_suggestions always verbose#154605
estebank wants to merge 1 commit intorust-lang:mainfrom
estebank:attr-suggest

Conversation

@estebank
Copy link
Copy Markdown
Contributor

span_suggestions is to provide mutually exclusive suggestions. When it was introduced, we made its behavior be that if a single suggestion is given to it, we present the suggestion inline, otherwise in patch format. Changing this to make all of its uses be verbose, as that is closer in intent of output.

`span_suggestions` is to provide mutually exclusive suggestions. When it was introduced, we made its behavior be that if a single suggestion is given to it, we present the suggestion inline, otherwise in patch format. Changing this to make all of its uses be verbose, as that is closer in intent of output.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 30, 2026

Some changes occurred in tests/ui/sanitizer

cc @rcvalle

@rustbot rustbot added PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 30, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 30, 2026

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 13 candidates

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
tests/ui/should_impl_trait/method_list_2.rs (revision `edition2021`) ... ok
tests/ui/crashes/third-party/conf_allowlisted.rs ... ok

FAILED TEST: tests/ui/blocks_in_conditions.rs
command: CLIPPY_CONF_DIR="tests" RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui" "tests/ui/blocks_in_conditions.rs" "--extern" "proc_macro_attr=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui/auxiliary/libproc_macro_attr.so" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui/auxiliary" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-fbb2c78a4397bb08.rlib" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-fbb2c78a4397bb08.rmeta" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-08cb6de3a10b25d1.rlib" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-08cb6de3a10b25d1.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-ac3195ae9071a567.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-ac3195ae9071a567.rmeta" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-cb20139ff7bab978.rlib" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-cb20139ff7bab978.rmeta" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-d52f64f9beb2b3e9.rlib" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-d52f64f9beb2b3e9.rmeta" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-099fa7d611da1769.rlib" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-099fa7d611da1769.rmeta" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-cc2552a331d3edc6.rlib" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-cc2552a331d3edc6.rmeta" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-6fe3ac6a29af0bce.rlib" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-6fe3ac6a29af0bce.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-115c8b7669715635.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-115c8b7669715635.rmeta" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/deps" "--edition" "2024"

error: actual output differed from expected
Execute `./x test src/tools/clippy --bless` to update `tests/ui/blocks_in_conditions.stderr` to the actual output
--- tests/ui/blocks_in_conditions.stderr
+++ <stderr output>
 error: in an `if` condition, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
   --> tests/ui/blocks_in_conditions.rs:30:5
... 27 lines skipped ...
    |
 LL |     if true && x == 3 { 6 } else { 10 }
-   |        ^^^^^^^^^^^^^^ help: try: `x == 3`
+   |        ^^^^^^^^^^^^^^
    |
    = note: `-D clippy::nonminimal-bool` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::nonminimal_bool)]`
+help: try
+   |
+LL -     if true && x == 3 { 6 } else { 10 }
+LL +     if x == 3 { 6 } else { 10 }
+   |
 
 error: aborting due to 3 previous errors
 

---
help: try
   |
LL ~     let res = {
LL +
LL +         let x = 3;
LL +         x == 3
LL ~     }; if res {
   |

error: omit braces around single expression condition
##[error]  --> tests/ui/blocks_in_conditions.rs:42:8
   |
LL |     if { true } { 6 } else { 10 }
   |        ^^^^^^^^ help: try: `true`

error: this boolean expression can be simplified
##[error]  --> tests/ui/blocks_in_conditions.rs:48:8
   |
LL |     if true && x == 3 { 6 } else { 10 }
   |        ^^^^^^^^^^^^^^
   |
   = note: `-D clippy::nonminimal-bool` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::nonminimal_bool)]`
help: try
   |
LL -     if true && x == 3 { 6 } else { 10 }
LL +     if x == 3 { 6 } else { 10 }
   |

error: aborting due to 3 previous errors


---
help: try
   |
LL ~     let res = {
LL +
LL +         let x = 3;
LL +         x == 3
LL ~     }; if res {
   |

error: omit braces around single expression condition
##[error]  --> tests/ui/blocks_in_conditions.rs:42:8
   |
LL |     if { true } { 6 } else { 10 }
   |        ^^^^^^^^ help: try: `true`

error: this boolean expression can be simplified
##[error]  --> tests/ui/blocks_in_conditions.rs:48:8
   |
LL |     if true && x == 3 { 6 } else { 10 }
   |        ^^^^^^^^^^^^^^
   |
   = note: `-D clippy::nonminimal-bool` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::nonminimal_bool)]`
help: try
   |
LL -     if true && x == 3 { 6 } else { 10 }
LL +     if x == 3 { 6 } else { 10 }
   |

error: aborting due to 3 previous errors


full stdout:



FAILED TEST: tests/ui/nonminimal_bool.rs
command: CLIPPY_CONF_DIR="tests" RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui" "tests/ui/nonminimal_bool.rs" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-fbb2c78a4397bb08.rlib" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-fbb2c78a4397bb08.rmeta" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-08cb6de3a10b25d1.rlib" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-08cb6de3a10b25d1.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-ac3195ae9071a567.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-ac3195ae9071a567.rmeta" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-cb20139ff7bab978.rlib" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-cb20139ff7bab978.rmeta" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-d52f64f9beb2b3e9.rlib" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-d52f64f9beb2b3e9.rmeta" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-099fa7d611da1769.rlib" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-099fa7d611da1769.rmeta" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-cc2552a331d3edc6.rlib" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-cc2552a331d3edc6.rmeta" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-6fe3ac6a29af0bce.rlib" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-6fe3ac6a29af0bce.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-115c8b7669715635.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-115c8b7669715635.rmeta" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/deps" "--edition" "2024"

error: actual output differed from expected
Execute `./x test src/tools/clippy --bless` to update `tests/ui/nonminimal_bool.stderr` to the actual output
--- tests/ui/nonminimal_bool.stderr
+++ <stderr output>
 error: this boolean expression can be simplified
   --> tests/ui/nonminimal_bool.rs:17:13
    |
 LL |     let _ = !true;
-   |             ^^^^^ help: try: `false`
+   |             ^^^^^
    |
    = note: `-D clippy::nonminimal-bool` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::nonminimal_bool)]`
+help: try
+   |
+LL -     let _ = !true;
+LL +     let _ = false;
+   |
 
 error: this boolean expression can be simplified
   --> tests/ui/nonminimal_bool.rs:20:13
    |
 LL |     let _ = !false;
-   |             ^^^^^^ help: try: `true`
+   |             ^^^^^^
+   |
+help: try
+   |
+LL -     let _ = !false;
+LL +     let _ = true;
+   |
 
 error: this boolean expression can be simplified
   --> tests/ui/nonminimal_bool.rs:23:13
    |
 LL |     let _ = !!a;
-   |             ^^^ help: try: `a`
+   |             ^^^
+   |
+help: try
+   |
+LL -     let _ = !!a;
+LL +     let _ = a;
+   |
 
 error: this boolean expression can be simplified
   --> tests/ui/nonminimal_bool.rs:26:13
    |
 LL |     let _ = false || a;
-   |             ^^^^^^^^^^ help: try: `a`
+   |             ^^^^^^^^^^
+   |
+help: try
+   |
+LL -     let _ = false || a;
+LL +     let _ = a;
+   |
 
 error: this boolean expression can be simplified
   --> tests/ui/nonminimal_bool.rs:32:13
    |
 LL |     let _ = !(!a && b);
-   |             ^^^^^^^^^^ help: try: `a || !b`
+   |             ^^^^^^^^^^
+   |
+help: try
+   |
+LL -     let _ = !(!a && b);
+LL +     let _ = a || !b;
+   |
 
 error: this boolean expression can be simplified
   --> tests/ui/nonminimal_bool.rs:35:13
    |
 LL |     let _ = !(!a || b);
-   |             ^^^^^^^^^^ help: try: `a && !b`
+   |             ^^^^^^^^^^
+   |
+help: try
+   |
+LL -     let _ = !(!a || b);
+LL +     let _ = a && !b;
+   |
 
 error: this boolean expression can be simplified
   --> tests/ui/nonminimal_bool.rs:38:13
    |
 LL |     let _ = !a && !(b && c);
-   |             ^^^^^^^^^^^^^^^ help: try: `!(a || b && c)`
+   |             ^^^^^^^^^^^^^^^
+   |
+help: try
+   |
+LL -     let _ = !a && !(b && c);
+LL +     let _ = !(a || b && c);
+   |
 
 error: this boolean expression can be simplified
... 76 lines skipped ...
    |
 LL |     if matches!(true, true) && true {
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(true, true)`
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: try
+   |
+LL -     if matches!(true, true) && true {
+LL +     if matches!(true, true) {
+   |
 
 error: this boolean expression can be simplified
... 88 lines skipped ...
    |
 LL |     if !(a < 2.0 && !b) {
-   |        ^^^^^^^^^^^^^^^^ help: try: `a >= 2.0 || b`
+   |        ^^^^^^^^^^^^^^^^
+   |
+help: try
+   |
+LL -     if !(a < 2.0 && !b) {
+LL +     if a >= 2.0 || b {
+   |
 
 error: this boolean expression can be simplified
   --> tests/ui/nonminimal_bool.rs:231:12
    |
 LL |         if !(matches!(ty, TyKind::Ref(_, _, _)) && !is_mutable(&expr)) {
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!matches!(ty, TyKind::Ref(_, _, _)) || is_mutable(&expr)`
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: try
+   |
+LL -         if !(matches!(ty, TyKind::Ref(_, _, _)) && !is_mutable(&expr)) {
+LL +         if !matches!(ty, TyKind::Ref(_, _, _)) || is_mutable(&expr) {
+   |
 
 error: this boolean expression can be simplified
... 11 lines skipped ...
 error: aborting due to 31 previous errors
 

Full unnormalized output:
error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:17:13
   |
LL |     let _ = !true;
   |             ^^^^^
   |
   = note: `-D clippy::nonminimal-bool` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::nonminimal_bool)]`
help: try
   |
LL -     let _ = !true;
LL +     let _ = false;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:20:13
   |
LL |     let _ = !false;
   |             ^^^^^^
   |
help: try
   |
LL -     let _ = !false;
LL +     let _ = true;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:23:13
   |
LL |     let _ = !!a;
   |             ^^^
   |
help: try
   |
LL -     let _ = !!a;
LL +     let _ = a;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:26:13
   |
LL |     let _ = false || a;
   |             ^^^^^^^^^^
   |
help: try
   |
LL -     let _ = false || a;
LL +     let _ = a;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:32:13
   |
LL |     let _ = !(!a && b);
   |             ^^^^^^^^^^
   |
help: try
   |
LL -     let _ = !(!a && b);
LL +     let _ = a || !b;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:35:13
   |
LL |     let _ = !(!a || b);
   |             ^^^^^^^^^^
   |
help: try
   |
LL -     let _ = !(!a || b);
LL +     let _ = a && !b;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:38:13
   |
LL |     let _ = !a && !(b && c);
   |             ^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     let _ = !a && !(b && c);
LL +     let _ = !(a || b && c);
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:47:13
   |
LL |     let _ = a == b && c == 5 && a == b;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     let _ = a == b && c == 5 && a == b;
LL +     let _ = !(a != b || c != 5);
   |
LL -     let _ = a == b && c == 5 && a == b;
LL +     let _ = a == b && c == 5;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:50:13
   |
LL |     let _ = a == b || c == 5 || a == b;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     let _ = a == b || c == 5 || a == b;
LL +     let _ = !(a != b && c != 5);
   |
LL -     let _ = a == b || c == 5 || a == b;
LL +     let _ = a == b || c == 5;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:53:13
   |
LL |     let _ = a == b && c == 5 && b == a;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     let _ = a == b && c == 5 && b == a;
LL +     let _ = !(a != b || c != 5);
   |
LL -     let _ = a == b && c == 5 && b == a;
LL +     let _ = a == b && c == 5;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:56:13
   |
LL |     let _ = a != b || !(a != b || c == d);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     let _ = a != b || !(a != b || c == d);
LL +     let _ = !(a == b && c == d);
   |
LL -     let _ = a != b || !(a != b || c == d);
LL +     let _ = a != b || c != d;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:59:13
   |
LL |     let _ = a != b && !(a != b && c == d);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     let _ = a != b && !(a != b && c == d);
LL +     let _ = !(a == b || c == d);
   |
LL -     let _ = a != b && !(a != b && c == d);
LL +     let _ = a != b && c != d;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:90:8
   |
LL |     if matches!(true, true) && true {
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     if matches!(true, true) && true {
LL +     if matches!(true, true) {
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:171:8
   |
LL |     if !(12 == a) {}
   |        ^^^^^^^^^^ help: try: `(12 != a)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:173:8
   |
LL |     if !(a == 12) {}
   |        ^^^^^^^^^^ help: try: `(a != 12)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:175:8
   |
LL |     if !(12 != a) {}
   |        ^^^^^^^^^^ help: try: `(12 == a)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:177:8
   |
LL |     if !(a != 12) {}
   |        ^^^^^^^^^^ help: try: `(a == 12)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:182:8
   |
LL |     if !b == true {}
---

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:188:8
   |
LL |     if true == !b {}
   |        ^^^^^^^^^^ help: try: `true != b`

error: equality checks against true are unnecessary
##[error]  --> tests/ui/nonminimal_bool.rs:188:8
   |
LL |     if true == !b {}
   |        ^^^^^^^^^^ help: try: `!b`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:191:8
   |
LL |     if true != !b {}
   |        ^^^^^^^^^^ help: try: `true == b`

error: inequality checks against true can be replaced by a negation
##[error]  --> tests/ui/nonminimal_bool.rs:191:8
   |
LL |     if true != !b {}
   |        ^^^^^^^^^^ help: try: `b`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:194:8
   |
LL |     if !b == !c {}
   |        ^^^^^^^^ help: try: `b == c`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:196:8
   |
LL |     if !b != !c {}
   |        ^^^^^^^^ help: try: `b != c`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:212:8
   |
LL |     if !(a < 2.0 && !b) {
   |        ^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     if !(a < 2.0 && !b) {
LL +     if a >= 2.0 || b {
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:231:12
   |
LL |         if !(matches!(ty, TyKind::Ref(_, _, _)) && !is_mutable(&expr)) {
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -         if !(matches!(ty, TyKind::Ref(_, _, _)) && !is_mutable(&expr)) {
LL +         if !matches!(ty, TyKind::Ref(_, _, _)) || is_mutable(&expr) {
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:251:8
   |
LL |     if !S != true {}
   |        ^^^^^^^^^^ help: try: `S == true`

error: inequality checks against true can be replaced by a negation
##[error]  --> tests/ui/nonminimal_bool.rs:251:8
   |
LL |     if !S != true {}
   |        ^^^^^^^^^^ help: try: `!!S`

error: aborting due to 31 previous errors



full stderr:
error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:17:13
   |
LL |     let _ = !true;
   |             ^^^^^
   |
   = note: `-D clippy::nonminimal-bool` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::nonminimal_bool)]`
help: try
   |
LL -     let _ = !true;
LL +     let _ = false;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:20:13
   |
LL |     let _ = !false;
   |             ^^^^^^
   |
help: try
   |
LL -     let _ = !false;
LL +     let _ = true;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:23:13
   |
LL |     let _ = !!a;
   |             ^^^
   |
help: try
   |
LL -     let _ = !!a;
LL +     let _ = a;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:26:13
   |
LL |     let _ = false || a;
   |             ^^^^^^^^^^
   |
help: try
   |
LL -     let _ = false || a;
LL +     let _ = a;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:32:13
   |
LL |     let _ = !(!a && b);
   |             ^^^^^^^^^^
   |
help: try
   |
LL -     let _ = !(!a && b);
LL +     let _ = a || !b;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:35:13
   |
LL |     let _ = !(!a || b);
   |             ^^^^^^^^^^
   |
help: try
   |
LL -     let _ = !(!a || b);
LL +     let _ = a && !b;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:38:13
   |
LL |     let _ = !a && !(b && c);
   |             ^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     let _ = !a && !(b && c);
LL +     let _ = !(a || b && c);
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:47:13
   |
LL |     let _ = a == b && c == 5 && a == b;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     let _ = a == b && c == 5 && a == b;
LL +     let _ = !(a != b || c != 5);
   |
LL -     let _ = a == b && c == 5 && a == b;
LL +     let _ = a == b && c == 5;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:50:13
   |
LL |     let _ = a == b || c == 5 || a == b;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     let _ = a == b || c == 5 || a == b;
LL +     let _ = !(a != b && c != 5);
   |
LL -     let _ = a == b || c == 5 || a == b;
LL +     let _ = a == b || c == 5;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:53:13
   |
LL |     let _ = a == b && c == 5 && b == a;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     let _ = a == b && c == 5 && b == a;
LL +     let _ = !(a != b || c != 5);
   |
LL -     let _ = a == b && c == 5 && b == a;
LL +     let _ = a == b && c == 5;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:56:13
   |
LL |     let _ = a != b || !(a != b || c == d);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     let _ = a != b || !(a != b || c == d);
LL +     let _ = !(a == b && c == d);
   |
LL -     let _ = a != b || !(a != b || c == d);
LL +     let _ = a != b || c != d;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:59:13
   |
LL |     let _ = a != b && !(a != b && c == d);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     let _ = a != b && !(a != b && c == d);
LL +     let _ = !(a == b || c == d);
   |
LL -     let _ = a != b && !(a != b && c == d);
LL +     let _ = a != b && c != d;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:90:8
   |
LL |     if matches!(true, true) && true {
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     if matches!(true, true) && true {
LL +     if matches!(true, true) {
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:171:8
   |
LL |     if !(12 == a) {}
   |        ^^^^^^^^^^ help: try: `(12 != a)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:173:8
   |
LL |     if !(a == 12) {}
   |        ^^^^^^^^^^ help: try: `(a != 12)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:175:8
   |
LL |     if !(12 != a) {}
   |        ^^^^^^^^^^ help: try: `(12 == a)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:177:8
   |
LL |     if !(a != 12) {}
   |        ^^^^^^^^^^ help: try: `(a == 12)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:182:8
   |
LL |     if !b == true {}
---

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:188:8
   |
LL |     if true == !b {}
   |        ^^^^^^^^^^ help: try: `true != b`

error: equality checks against true are unnecessary
##[error]  --> tests/ui/nonminimal_bool.rs:188:8
   |
LL |     if true == !b {}
   |        ^^^^^^^^^^ help: try: `!b`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:191:8
   |
LL |     if true != !b {}
   |        ^^^^^^^^^^ help: try: `true == b`

error: inequality checks against true can be replaced by a negation
##[error]  --> tests/ui/nonminimal_bool.rs:191:8
   |
LL |     if true != !b {}
   |        ^^^^^^^^^^ help: try: `b`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:194:8
   |
LL |     if !b == !c {}
   |        ^^^^^^^^ help: try: `b == c`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:196:8
   |
LL |     if !b != !c {}
   |        ^^^^^^^^ help: try: `b != c`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:212:8
   |
LL |     if !(a < 2.0 && !b) {
   |        ^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     if !(a < 2.0 && !b) {
LL +     if a >= 2.0 || b {
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:231:12
   |
LL |         if !(matches!(ty, TyKind::Ref(_, _, _)) && !is_mutable(&expr)) {
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -         if !(matches!(ty, TyKind::Ref(_, _, _)) && !is_mutable(&expr)) {
LL +         if !matches!(ty, TyKind::Ref(_, _, _)) || is_mutable(&expr) {
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool.rs:251:8
   |
LL |     if !S != true {}
   |        ^^^^^^^^^^ help: try: `S == true`

error: inequality checks against true can be replaced by a negation
##[error]  --> tests/ui/nonminimal_bool.rs:251:8
   |
LL |     if !S != true {}
   |        ^^^^^^^^^^ help: try: `!!S`

error: aborting due to 31 previous errors


full stdout:



FAILED TEST: tests/ui/nonminimal_bool_methods.rs
command: CLIPPY_CONF_DIR="tests" RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui" "tests/ui/nonminimal_bool_methods.rs" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-fbb2c78a4397bb08.rlib" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-fbb2c78a4397bb08.rmeta" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-08cb6de3a10b25d1.rlib" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-08cb6de3a10b25d1.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-ac3195ae9071a567.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-ac3195ae9071a567.rmeta" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-cb20139ff7bab978.rlib" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-cb20139ff7bab978.rmeta" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-d52f64f9beb2b3e9.rlib" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-d52f64f9beb2b3e9.rmeta" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-099fa7d611da1769.rlib" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-099fa7d611da1769.rmeta" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-cc2552a331d3edc6.rlib" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-cc2552a331d3edc6.rmeta" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-6fe3ac6a29af0bce.rlib" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-6fe3ac6a29af0bce.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-115c8b7669715635.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-115c8b7669715635.rmeta" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/deps" "--edition" "2024"

error: actual output differed from expected
Execute `./x test src/tools/clippy --bless` to update `tests/ui/nonminimal_bool_methods.stderr` to the actual output
--- tests/ui/nonminimal_bool_methods.stderr
+++ <stderr output>
 error: this boolean expression can be simplified
   --> tests/ui/nonminimal_bool_methods.rs:8:13
... 27 lines skipped ...
    |
 LL |     let _ = !(a.is_some() && !c);
-   |             ^^^^^^^^^^^^^^^^^^^^ help: try: `a.is_none() || c`
+   |             ^^^^^^^^^^^^^^^^^^^^
+   |
+help: try
+   |
+LL -     let _ = !(a.is_some() && !c);
+LL +     let _ = a.is_none() || c;
+   |
 
 error: this boolean expression can be simplified
   --> tests/ui/nonminimal_bool_methods.rs:22:13
    |
 LL |     let _ = !(a.is_some() || !c);
-   |             ^^^^^^^^^^^^^^^^^^^^ help: try: `a.is_none() && c`
+   |             ^^^^^^^^^^^^^^^^^^^^
+   |
+help: try
+   |
+LL -     let _ = !(a.is_some() || !c);
+LL +     let _ = a.is_none() && c;
+   |
 
 error: this boolean expression can be simplified
... 215 lines skipped ...
 error: aborting due to 42 previous errors
 

Full unnormalized output:
error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:8:13
   |
LL |     let _ = !a.is_some();
   |             ^^^^^^^^^^^^ help: try: `a.is_none()`
   |
   = note: `-D clippy::nonminimal-bool` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::nonminimal_bool)]`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:11:13
   |
LL |     let _ = !a.is_none();
   |             ^^^^^^^^^^^^ help: try: `a.is_some()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:14:13
   |
LL |     let _ = !b.is_err();
   |             ^^^^^^^^^^^ help: try: `b.is_ok()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:17:13
   |
LL |     let _ = !b.is_ok();
   |             ^^^^^^^^^^ help: try: `b.is_err()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:20:13
   |
LL |     let _ = !(a.is_some() && !c);
   |             ^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     let _ = !(a.is_some() && !c);
LL +     let _ = a.is_none() || c;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:22:13
   |
LL |     let _ = !(a.is_some() || !c);
   |             ^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     let _ = !(a.is_some() || !c);
LL +     let _ = a.is_none() && c;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:24:26
   |
LL |     let _ = !(!c ^ c) || !a.is_some();
   |                          ^^^^^^^^^^^^ help: try: `a.is_none()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:26:25
   |
LL |     let _ = (!c ^ c) || !a.is_some();
   |                         ^^^^^^^^^^^^ help: try: `a.is_none()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:28:23
   |
LL |     let _ = !c ^ c || !a.is_some();
   |                       ^^^^^^^^^^^^ help: try: `a.is_none()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:101:8
   |
LL |     if !res.is_ok() {}
   |        ^^^^^^^^^^^^ help: try: `res.is_err()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:103:8
   |
LL |     if !res.is_err() {}
   |        ^^^^^^^^^^^^^ help: try: `res.is_ok()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:107:8
   |
LL |     if !res.is_some() {}
---

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:126:8
   |
LL |     if !(a as u64 >= b) {}
   |        ^^^^^^^^^^^^^^^^ help: try: `((a as u64) < b)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:128:8
   |
LL |     if !((a as u64) >= b) {}
   |        ^^^^^^^^^^^^^^^^^^ help: try: `((a as u64) < b)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:130:8
   |
LL |     if !(a as u64 <= b) {}
   |        ^^^^^^^^^^^^^^^^ help: try: `(a as u64 > b)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:138:8
   |
LL |     if !(a >= b) as i32 == c {}
   |        ^^^^^^^^^ help: try: `(a < b)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:140:8
   |
LL |     if !(a >= b) | !(a <= c) {}
   |        ^^^^^^^^^ help: try: `(a < b)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:140:20
   |
LL |     if !(a >= b) | !(a <= c) {}
   |                    ^^^^^^^^^ help: try: `(a > c)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:145:8
   |
LL |     if !res.is_ok() as i32 == c {}
   |        ^^^^^^^^^^^^ help: try: `res.is_err()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:147:8
   |
LL |     if !res.is_ok() | !opt.is_none() {}
   |        ^^^^^^^^^^^^ help: try: `res.is_err()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:147:23
   |
LL |     if !res.is_ok() | !opt.is_none() {}
   |                       ^^^^^^^^^^^^^^ help: try: `opt.is_some()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:152:9
   |
LL |         (!(4 > 3)).b()
   |         ^^^^^^^^^^ help: try: `(4 <= 3)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:178:9
   |
LL |     _ = !opt.is_some_and(|x| x < 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x >= 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:180:9
   |
LL |     _ = !opt.is_some_and(|x| x <= 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x > 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:182:9
   |
LL |     _ = !opt.is_some_and(|x| x > 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x <= 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:184:9
   |
LL |     _ = !opt.is_some_and(|x| x >= 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x < 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:186:9
   |
LL |     _ = !opt.is_some_and(|x| x == 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x != 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:188:9
   |
LL |     _ = !opt.is_some_and(|x| x != 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x == 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:198:9
   |
LL |     _ = !opt.is_none_or(|x| x < 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x >= 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:200:9
   |
LL |     _ = !opt.is_none_or(|x| x <= 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x > 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:202:9
   |
LL |     _ = !opt.is_none_or(|x| x > 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x <= 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:204:9
   |
LL |     _ = !opt.is_none_or(|x| x >= 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x < 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:206:9
   |
LL |     _ = !opt.is_none_or(|x| x == 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x != 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:208:9
   |
LL |     _ = !opt.is_none_or(|x| x != 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x == 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:216:9
   |
LL |     _ = !opt.is_some_and(|x| !x);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:221:9
   |
LL |     _ = !opt.is_none_or(|x| !x);
   |         ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:229:9
   |
LL |     _ = !opt.is_some_and(|x| x.is_ok());
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x.is_err())`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:231:9
   |
LL |     _ = !opt.is_some_and(|x| x.is_err());
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x.is_ok())`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:233:9
   |
LL |     _ = !opt.is_none_or(|x| x.is_ok());
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x.is_err())`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:235:9
   |
LL |     _ = !opt.is_none_or(|x| x.is_err());
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x.is_ok())`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:246:5
   |
LL |     !(vec![1, 2, 3] <= vec![1, 2, 3, 3]);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(vec![1, 2, 3] > vec![1, 2, 3, 3])`

error: aborting due to 42 previous errors



full stderr:
error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:8:13
   |
LL |     let _ = !a.is_some();
   |             ^^^^^^^^^^^^ help: try: `a.is_none()`
   |
   = note: `-D clippy::nonminimal-bool` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::nonminimal_bool)]`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:11:13
   |
LL |     let _ = !a.is_none();
   |             ^^^^^^^^^^^^ help: try: `a.is_some()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:14:13
   |
LL |     let _ = !b.is_err();
   |             ^^^^^^^^^^^ help: try: `b.is_ok()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:17:13
   |
LL |     let _ = !b.is_ok();
   |             ^^^^^^^^^^ help: try: `b.is_err()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:20:13
   |
LL |     let _ = !(a.is_some() && !c);
   |             ^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     let _ = !(a.is_some() && !c);
LL +     let _ = a.is_none() || c;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:22:13
   |
LL |     let _ = !(a.is_some() || !c);
   |             ^^^^^^^^^^^^^^^^^^^^
   |
help: try
   |
LL -     let _ = !(a.is_some() || !c);
LL +     let _ = a.is_none() && c;
   |

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:24:26
   |
LL |     let _ = !(!c ^ c) || !a.is_some();
   |                          ^^^^^^^^^^^^ help: try: `a.is_none()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:26:25
   |
LL |     let _ = (!c ^ c) || !a.is_some();
   |                         ^^^^^^^^^^^^ help: try: `a.is_none()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:28:23
   |
LL |     let _ = !c ^ c || !a.is_some();
   |                       ^^^^^^^^^^^^ help: try: `a.is_none()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:101:8
   |
LL |     if !res.is_ok() {}
   |        ^^^^^^^^^^^^ help: try: `res.is_err()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:103:8
   |
LL |     if !res.is_err() {}
   |        ^^^^^^^^^^^^^ help: try: `res.is_ok()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:107:8
   |
LL |     if !res.is_some() {}
---

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:126:8
   |
LL |     if !(a as u64 >= b) {}
   |        ^^^^^^^^^^^^^^^^ help: try: `((a as u64) < b)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:128:8
   |
LL |     if !((a as u64) >= b) {}
   |        ^^^^^^^^^^^^^^^^^^ help: try: `((a as u64) < b)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:130:8
   |
LL |     if !(a as u64 <= b) {}
   |        ^^^^^^^^^^^^^^^^ help: try: `(a as u64 > b)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:138:8
   |
LL |     if !(a >= b) as i32 == c {}
   |        ^^^^^^^^^ help: try: `(a < b)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:140:8
   |
LL |     if !(a >= b) | !(a <= c) {}
   |        ^^^^^^^^^ help: try: `(a < b)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:140:20
   |
LL |     if !(a >= b) | !(a <= c) {}
   |                    ^^^^^^^^^ help: try: `(a > c)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:145:8
   |
LL |     if !res.is_ok() as i32 == c {}
   |        ^^^^^^^^^^^^ help: try: `res.is_err()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:147:8
   |
LL |     if !res.is_ok() | !opt.is_none() {}
   |        ^^^^^^^^^^^^ help: try: `res.is_err()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:147:23
   |
LL |     if !res.is_ok() | !opt.is_none() {}
   |                       ^^^^^^^^^^^^^^ help: try: `opt.is_some()`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:152:9
   |
LL |         (!(4 > 3)).b()
   |         ^^^^^^^^^^ help: try: `(4 <= 3)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:178:9
   |
LL |     _ = !opt.is_some_and(|x| x < 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x >= 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:180:9
   |
LL |     _ = !opt.is_some_and(|x| x <= 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x > 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:182:9
   |
LL |     _ = !opt.is_some_and(|x| x > 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x <= 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:184:9
   |
LL |     _ = !opt.is_some_and(|x| x >= 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x < 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:186:9
   |
LL |     _ = !opt.is_some_and(|x| x == 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x != 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:188:9
   |
LL |     _ = !opt.is_some_and(|x| x != 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x == 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:198:9
   |
LL |     _ = !opt.is_none_or(|x| x < 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x >= 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:200:9
   |
LL |     _ = !opt.is_none_or(|x| x <= 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x > 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:202:9
   |
LL |     _ = !opt.is_none_or(|x| x > 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x <= 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:204:9
   |
LL |     _ = !opt.is_none_or(|x| x >= 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x < 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:206:9
   |
LL |     _ = !opt.is_none_or(|x| x == 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x != 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:208:9
   |
LL |     _ = !opt.is_none_or(|x| x != 1000);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x == 1000)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:216:9
   |
LL |     _ = !opt.is_some_and(|x| !x);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:221:9
   |
LL |     _ = !opt.is_none_or(|x| !x);
   |         ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x)`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:229:9
   |
LL |     _ = !opt.is_some_and(|x| x.is_ok());
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x.is_err())`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:231:9
   |
LL |     _ = !opt.is_some_and(|x| x.is_err());
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_none_or(|x| x.is_ok())`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:233:9
   |
LL |     _ = !opt.is_none_or(|x| x.is_ok());
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x.is_err())`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:235:9
   |
LL |     _ = !opt.is_none_or(|x| x.is_err());
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `opt.is_some_and(|x| x.is_ok())`

error: this boolean expression can be simplified
##[error]  --> tests/ui/nonminimal_bool_methods.rs:246:5
   |
LL |     !(vec![1, 2, 3] <= vec![1, 2, 3, 3]);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(vec![1, 2, 3] > vec![1, 2, 3, 3])`

error: aborting due to 42 previous errors


full stdout:



FAILED TEST: tests/ui/crashes/ice-96721.rs
command: CLIPPY_CONF_DIR="tests" RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/0/tests/ui/crashes" "tests/ui/crashes/ice-96721.rs" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-fbb2c78a4397bb08.rlib" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-fbb2c78a4397bb08.rmeta" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-08cb6de3a10b25d1.rlib" "--extern" "itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libitertools-08cb6de3a10b25d1.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-ac3195ae9071a567.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-ac3195ae9071a567.rmeta" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-cb20139ff7bab978.rlib" "--extern" "parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libparking_lot-cb20139ff7bab978.rmeta" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-d52f64f9beb2b3e9.rlib" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libquote-d52f64f9beb2b3e9.rmeta" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-099fa7d611da1769.rlib" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libregex-099fa7d611da1769.rmeta" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-cc2552a331d3edc6.rlib" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libserde-cc2552a331d3edc6.rmeta" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-6fe3ac6a29af0bce.rlib" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libsyn-6fe3ac6a29af0bce.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-115c8b7669715635.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-115c8b7669715635.rmeta" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/deps" "--edition" "2024"

error: actual output differed from expected
Execute `./x test src/tools/clippy --bless` to update `tests/ui/crashes/ice-96721.stderr` to the actual output
--- tests/ui/crashes/ice-96721.stderr
+++ <stderr output>
 error: malformed `path` attribute input
   --> tests/ui/crashes/ice-96721.rs:7:1
    |
 LL | #[path = foo!()]
-   | ^^^^^^^^^^^^^^^^ help: must be of the form: `#[path = "file"]`
+   | ^^^^^^^^^^^^^^^^
    |
    = note: for more information, visit <https://doc.rust-lang.org/reference/items/modules.html#the-path-attribute>
+help: must be of the form
+   |
+LL - #[path = foo!()]
+LL + #[path = "file"]
+   |
 
 error: aborting due to 1 previous error
 

Full unnormalized output:
error: malformed `path` attribute input
##[error]  --> tests/ui/crashes/ice-96721.rs:7:1
   |
LL | #[path = foo!()]
   | ^^^^^^^^^^^^^^^^
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/items/modules.html#the-path-attribute>
help: must be of the form
   |
LL - #[path = foo!()]
LL + #[path = "file"]
   |

error: aborting due to 1 previous error



full stderr:
error: malformed `path` attribute input
##[error]  --> tests/ui/crashes/ice-96721.rs:7:1
   |
LL | #[path = foo!()]
   | ^^^^^^^^^^^^^^^^
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/items/modules.html#the-path-attribute>
help: must be of the form
   |
LL - #[path = foo!()]
LL + #[path = "file"]
   |

error: aborting due to 1 previous error


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants