Skip to content

Commit 3fc8dae

Browse files
committed
Allow needless_bool in macro
1 parent 94d6be4 commit 3fc8dae

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clippy_lints/src/needless_bool.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ declare_lint_pass!(NeedlessBool => [NEEDLESS_BOOL]);
7171
impl<'tcx> LateLintPass<'tcx> for NeedlessBool {
7272
fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) {
7373
use self::Expression::{Bool, RetBool};
74+
if e.span.from_expansion() {
75+
return;
76+
}
7477
if let ExprKind::If(pred, then_block, Some(else_expr)) = e.kind {
7578
let reduce = |ret, not| {
7679
let mut applicability = Applicability::MachineApplicable;

0 commit comments

Comments
 (0)