Skip to content

Commit 4ff2132

Browse files
authored
Unrolled build for rust-lang#120316
Rollup merge of rust-lang#120316 - GuillaumeGomez:fix-ast-visitor, r=compiler-errors Don't call `walk_` functions directly if there is an equivalent `visit_` method I was working on rust-lang#77773 and realized in one of my experiments that the `visit_path` method was not always called whereas it should have. This fixes it. r? ``@davidtwco``
2 parents 5bd5d21 + bdc9ce0 commit 4ff2132

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/rustc_ast/src/visit.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,11 @@ pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) {
375375
}
376376
ItemKind::MacCall(mac) => visitor.visit_mac_call(mac),
377377
ItemKind::MacroDef(ts) => visitor.visit_mac_def(ts, item.id),
378-
ItemKind::Delegation(box Delegation { id: _, qself, path, body }) => {
378+
ItemKind::Delegation(box Delegation { id, qself, path, body }) => {
379379
if let Some(qself) = qself {
380380
visitor.visit_ty(&qself.ty);
381381
}
382-
walk_path(visitor, path);
382+
visitor.visit_path(path, *id);
383383
if let Some(body) = body {
384384
visitor.visit_block(body);
385385
}
@@ -502,7 +502,7 @@ where
502502
}
503503
GenericArgs::Parenthesized(data) => {
504504
walk_list!(visitor, visit_ty, &data.inputs);
505-
walk_fn_ret_ty(visitor, &data.output);
505+
visitor.visit_fn_ret_ty(&data.output);
506506
}
507507
}
508508
}
@@ -713,11 +713,11 @@ pub fn walk_assoc_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a AssocItem,
713713
AssocItemKind::MacCall(mac) => {
714714
visitor.visit_mac_call(mac);
715715
}
716-
AssocItemKind::Delegation(box Delegation { id: _, qself, path, body }) => {
716+
AssocItemKind::Delegation(box Delegation { id, qself, path, body }) => {
717717
if let Some(qself) = qself {
718718
visitor.visit_ty(&qself.ty);
719719
}
720-
walk_path(visitor, path);
720+
visitor.visit_path(path, *id);
721721
if let Some(body) = body {
722722
visitor.visit_block(body);
723723
}

0 commit comments

Comments
 (0)