Skip to content

Commit

Permalink
Fix clippy build
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Feb 8, 2024
1 parent 97ad3cb commit 3717857
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/tools/clippy/clippy_lints/src/loops/never_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ fn never_loop_expr<'tcx>(
NeverLoopResult::Normal
},
})),
ExprKind::Unreachable => NeverLoopResult::Diverging,
ExprKind::OffsetOf(_, _)
| ExprKind::Yield(_, _)
| ExprKind::Closure { .. }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ impl<'a, 'tcx> Visitor<'tcx> for SigDropHelper<'a, 'tcx> {
ExprKind::Loop(_, _, _, _) |
ExprKind::Path(_) |
ExprKind::Struct(_, _, _) |
ExprKind::Type(_, _) => {
ExprKind::Type(_, _) |
ExprKind::Unreachable => {
return;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/tools/clippy/clippy_lints/src/utils/author.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
},
}
},
ExprKind::Unreachable => kind!("Unreachable"),
ExprKind::Err(_) => kind!("Err(_)"),
ExprKind::DropTemps(expr) => {
bind!(self, expr);
Expand Down
1 change: 1 addition & 0 deletions src/tools/clippy/clippy_utils/src/eager_or_lazy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ fn expr_eagerness<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) -> EagernessS
| ExprKind::Let(..)
| ExprKind::If(..)
| ExprKind::Match(..)
| ExprKind::Unreachable
| ExprKind::Closure { .. }
| ExprKind::Field(..)
| ExprKind::AddrOf(..)
Expand Down
4 changes: 3 additions & 1 deletion src/tools/clippy/clippy_utils/src/hir_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ impl HirEqInterExpr<'_, '_, '_> {
},
(&ExprKind::Tup(l_tup), &ExprKind::Tup(r_tup)) => self.eq_exprs(l_tup, r_tup),
(&ExprKind::Type(le, lt), &ExprKind::Type(re, rt)) => self.eq_expr(le, re) && self.eq_ty(lt, rt),
(&ExprKind::Unreachable, &ExprKind::Unreachable) => true,
(&ExprKind::Unary(l_op, le), &ExprKind::Unary(r_op, re)) => l_op == r_op && self.eq_expr(le, re),
(&ExprKind::Yield(le, _), &ExprKind::Yield(re, _)) => return self.eq_expr(le, re),
(
Expand Down Expand Up @@ -381,6 +382,7 @@ impl HirEqInterExpr<'_, '_, '_> {
| &ExprKind::Tup(..)
| &ExprKind::Type(..)
| &ExprKind::Unary(..)
| &ExprKind::Unreachable
| &ExprKind::Yield(..)

// --- Special cases that do not have a positive branch.
Expand Down Expand Up @@ -915,7 +917,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
std::mem::discriminant(&lop).hash(&mut self.s);
self.hash_expr(le);
},
ExprKind::Err(_) => {},
ExprKind::Unreachable | ExprKind::Err(_) => {},
}
}

Expand Down
1 change: 1 addition & 0 deletions src/tools/clippy/clippy_utils/src/sugg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ impl<'a> Sugg<'a> {
| hir::ExprKind::Path(..)
| hir::ExprKind::Repeat(..)
| hir::ExprKind::Ret(..)
| hir::ExprKind::Unreachable
| hir::ExprKind::Become(..)
| hir::ExprKind::Struct(..)
| hir::ExprKind::Tup(..)
Expand Down
1 change: 1 addition & 0 deletions src/tools/clippy/clippy_utils/src/visitors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ pub fn for_each_unconsumed_temporary<'tcx, B>(
| ExprKind::Continue(_)
| ExprKind::InlineAsm(_)
| ExprKind::OffsetOf(..)
| ExprKind::Unreachable
| ExprKind::Err(_) => (),
}
ControlFlow::Continue(())
Expand Down

0 comments on commit 3717857

Please sign in to comment.