Rollup merge of #132787 - maxcabrajac:fnctxt, r=petrochenkov
Unify FnKind between AST visitors and make WalkItemKind more straight forward Unifying `FnKind` requires a bunch of changes to `WalkItemKind::walk` signature so I'll change them in one go related to #128974 r? `@petrochenkov`
This commit is contained in:
commit
6b47c6d786
10 changed files with 157 additions and 88 deletions
|
@ -946,8 +946,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
|
|||
|
||||
self.visit_vis(&item.vis);
|
||||
self.visit_ident(&item.ident);
|
||||
let kind =
|
||||
FnKind::Fn(FnCtxt::Free, item.ident, sig, &item.vis, generics, body.as_deref());
|
||||
let kind = FnKind::Fn(FnCtxt::Free, &item.ident, sig, &item.vis, generics, body);
|
||||
self.visit_fn(kind, item.span, item.id);
|
||||
walk_list!(self, visit_attribute, &item.attrs);
|
||||
return; // Avoid visiting again.
|
||||
|
@ -1476,14 +1475,8 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
|
|||
{
|
||||
self.visit_vis(&item.vis);
|
||||
self.visit_ident(&item.ident);
|
||||
let kind = FnKind::Fn(
|
||||
FnCtxt::Assoc(ctxt),
|
||||
item.ident,
|
||||
sig,
|
||||
&item.vis,
|
||||
generics,
|
||||
body.as_deref(),
|
||||
);
|
||||
let kind =
|
||||
FnKind::Fn(FnCtxt::Assoc(ctxt), &item.ident, sig, &item.vis, generics, body);
|
||||
walk_list!(self, visit_attribute, &item.attrs);
|
||||
self.visit_fn(kind, item.span, item.id);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue