diff options
| author | Cameron Steffen <cam.steffen94@gmail.com> | 2021-06-09 14:44:42 -0500 |
|---|---|---|
| committer | Cameron Steffen <cam.steffen94@gmail.com> | 2021-07-13 08:57:16 -0500 |
| commit | 3fc8dae46c0b4e4e297dcbd34e789af25da0dd37 (patch) | |
| tree | e84a1df79b3b02efa6995bc8fdd3caa86315135e | |
| parent | 94d6be4c0a03d0149630bce7e6f373e327dd7471 (diff) | |
| download | rust-3fc8dae46c0b4e4e297dcbd34e789af25da0dd37.tar.gz rust-3fc8dae46c0b4e4e297dcbd34e789af25da0dd37.zip | |
Allow needless_bool in macro
| -rw-r--r-- | clippy_lints/src/needless_bool.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clippy_lints/src/needless_bool.rs b/clippy_lints/src/needless_bool.rs index 3b3736fd3a1..780690548e5 100644 --- a/clippy_lints/src/needless_bool.rs +++ b/clippy_lints/src/needless_bool.rs @@ -71,6 +71,9 @@ declare_lint_pass!(NeedlessBool => [NEEDLESS_BOOL]); impl<'tcx> LateLintPass<'tcx> for NeedlessBool { fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { use self::Expression::{Bool, RetBool}; + if e.span.from_expansion() { + return; + } if let ExprKind::If(pred, then_block, Some(else_expr)) = e.kind { let reduce = |ret, not| { let mut applicability = Applicability::MachineApplicable; |
