move else block into the Local struct

This commit is contained in:
Ding Xiang Fei 2022-07-05 23:31:18 +02:00
parent 6c529ded86
commit 1cd30e7b32
No known key found for this signature in database
GPG key ID: 3CD748647EEF6359
59 changed files with 138 additions and 131 deletions

View file

@ -1414,14 +1414,14 @@ impl<'tcx> Visitor<'tcx> for DumpVisitor<'tcx> {
intravisit::walk_stmt(self, s)
}
fn visit_local(&mut self, l: &'tcx hir::Local<'tcx>, e: Option<&'tcx hir::Block<'tcx>>) {
fn visit_local(&mut self, l: &'tcx hir::Local<'tcx>) {
self.process_macro_use(l.span);
self.process_var_decl(&l.pat);
// Just walk the initializer, the else branch and type (don't want to walk the pattern again).
walk_list!(self, visit_ty, &l.ty);
walk_list!(self, visit_expr, &l.init);
walk_list!(self, visit_block, e);
walk_list!(self, visit_block, l.els);
}
fn visit_foreign_item(&mut self, item: &'tcx hir::ForeignItem<'tcx>) {