/// # print!("{}", f(1));
/// # }
/// ```
- #[clippy::version = "1.60.0"]
+ #[clippy::version = "1.61.0"]
pub ONLY_USED_IN_RECURSION,
nursery,
"arguments that is only used in recursion can be removed"
},
ExprKind::Match(expr, arms, _) => self.visit_match(expr, arms),
// since analysing the closure is not easy, just set all variables in it to side-effect
- ExprKind::Closure(_, _, body_id, _, _) => {
- let body = self.tcx.hir().body(body_id);
+ ExprKind::Closure { body, .. } => {
+ let body = self.tcx.hir().body(body);
self.visit_body(body);
let vars = std::mem::take(&mut self.ret_vars);
self.add_side_effect(vars);
let mut vars = std::mem::take(&mut self.ret_vars);
let _ = arm.guard.as_ref().map(|guard| {
self.visit_expr(match guard {
- Guard::If(expr) | Guard::IfLet(_, expr) => expr,
+ Guard::If(expr) | Guard::IfLet(Let { init: expr, .. }) => expr,
});
vars.append(&mut self.ret_vars);
});