// an if/if let expr, check both exprs
// note, if without else is going to be a type checking error anyways
// (except for unit type functions) so we don't match it
- ExprKind::Match(_, arms, source) => match source {
- MatchSource::Normal => {
- for arm in arms.iter() {
- check_final_expr(cx, arm.body, Some(arm.body.span), RetReplacement::Block);
- }
- },
- MatchSource::IfLetDesugar {
- contains_else_clause: true,
- } => {
- if let ExprKind::Block(ifblock, _) = arms[0].body.kind {
- check_block_return(cx, ifblock);
- }
- check_final_expr(cx, arms[1].body, None, RetReplacement::Empty);
- },
- _ => (),
+ ExprKind::Match(_, arms, MatchSource::Normal) => {
+ for arm in arms.iter() {
+ check_final_expr(cx, arm.body, Some(arm.body.span), RetReplacement::Block);
+ }
},
ExprKind::DropTemps(expr) => check_final_expr(cx, expr, None, RetReplacement::Empty),
_ => (),
.fn_sig(def_id)
.output()
.skip_binder()
- .walk()
+ .walk(self.cx.tcx)
.any(|arg| matches!(arg.unpack(), GenericArgKind::Lifetime(_)));
}