self.maybe_print_comment(st.span.lo());
match st.kind {
hir::StmtKind::Local(ref loc) => {
- self.print_local(loc.init.as_deref(), |this| this.print_local_decl(&loc));
+ self.print_local(loc.init, |this| this.print_local_decl(&loc));
}
hir::StmtKind::Item(item) => self.ann.nested(self, Nested::Item(item)),
hir::StmtKind::Expr(ref expr) => {
);
err.span_suggestion(
generics.where_clause.tail_span_for_suggestion(),
- "consider adding a where clause".into(),
+ "consider adding a where clause",
suggestion,
Applicability::MaybeIncorrect,
);
if blk.targeted_by_break {
self.break_ln.insert(blk.hir_id, succ);
}
- let succ = self.propagate_through_opt_expr(blk.expr.as_deref(), succ);
+ let succ = self.propagate_through_opt_expr(blk.expr, succ);
blk.stmts.iter().rev().fold(succ, |succ, stmt| self.propagate_through_stmt(stmt, succ))
}
// initialization, which is mildly more complex than checking
// once at the func header but otherwise equivalent.
- let succ = self.propagate_through_opt_expr(local.init.as_deref(), succ);
+ let succ = self.propagate_through_opt_expr(local.init, succ);
self.define_bindings_in_pat(&local.pat, succ)
}
hir::StmtKind::Item(..) => succ,
resolve_expr(self, ex);
}
fn visit_local(&mut self, l: &'tcx Local<'tcx>) {
- resolve_local(self, Some(&l.pat), l.init.as_deref());
+ resolve_local(self, Some(&l.pat), l.init);
}
}