}
fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) {
match stmt.kind {
- StmtKind::Local(local, _) => {
+ StmtKind::Local(local) => {
if let Local { init: Some(e), .. } = local {
DivergenceVisitor { cx }.visit_expr(e);
}
if parent_id == cur_id {
break;
}
- let parent_node = match map.find(parent_id) {
- Some(parent) => parent,
- None => break,
- };
+ let Some(parent_node) = map.find(parent_id) else { break };
let stop_early = match parent_node {
Node::Expr(expr) => check_expr(vis, expr),
Stop,
}
-fn check_expr<'a, 'tcx>(vis: &mut ReadVisitor<'a, 'tcx>, expr: &'tcx Expr<'_>) -> StopEarly {
+fn check_expr<'tcx>(vis: &mut ReadVisitor<'_, 'tcx>, expr: &'tcx Expr<'_>) -> StopEarly {
if expr.hir_id == vis.last_expr.hir_id {
return StopEarly::KeepGoing;
}
StopEarly::KeepGoing
}
-fn check_stmt<'a, 'tcx>(vis: &mut ReadVisitor<'a, 'tcx>, stmt: &'tcx Stmt<'_>) -> StopEarly {
+fn check_stmt<'tcx>(vis: &mut ReadVisitor<'_, 'tcx>, stmt: &'tcx Stmt<'_>) -> StopEarly {
match stmt.kind {
StmtKind::Expr(expr) | StmtKind::Semi(expr) => check_expr(vis, expr),
// If the declaration is of a local variable, check its initializer
// expression if it has one. Otherwise, keep going.
- StmtKind::Local(local, _) => local
+ StmtKind::Local(local) => local
.init
.as_ref()
.map_or(StopEarly::KeepGoing, |expr| check_expr(vis, expr)),