Closed
Description
Summary
Suggestion produced by nonminimal_bool
is broken when it handles macros. It replaces the macro callsite with macro definition instead.
Reproducer
I tried this code:
if matches!(true, true) && true {
println!("foo");
}
I expected to see this happen:
Suggestion does not expand macros
Instead, this happened:
It replace macros with its definition.
error: this boolean expression can be simplified
--> $DIR/nonminimal_bool.rs:22:8
|
LL | if matches!(true, true) && true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try
|
LL ~ if match $expression {
LL + $( $pattern )|+ $( if $guard )? => true,
LL + _ => false
LL ~ } {}
|
Version
rustc 1.65.0-nightly (c07a8b4e0 2022-08-26)
binary: rustc
commit-hash: c07a8b4e09f356c7468b69c50cac7fc5b5000b8a
commit-date: 2022-08-26
host: aarch64-apple-darwin
release: 1.65.0-nightly
LLVM version: 15.0.0
Additional Labels
No response