diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-11-16 21:05:46 +0100 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-16 21:05:46 +0100 | 
| commit | 6b47c6d786df3fd5141174ee1fe04ec2fd957e3d (patch) | |
| tree | a2d76eb1f1e9a4e0249e5dbe969d8b019ef5adad /compiler/rustc_ast_passes/src/ast_validation.rs | |
| parent | eff2b7017dbea481295563f669c74edb018fe910 (diff) | |
| parent | 516a3b0c9b7f2a77a40db7d85479d4ef568bd261 (diff) | |
| download | rust-6b47c6d786df3fd5141174ee1fe04ec2fd957e3d.tar.gz rust-6b47c6d786df3fd5141174ee1fe04ec2fd957e3d.zip | |
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`
Diffstat (limited to 'compiler/rustc_ast_passes/src/ast_validation.rs')
| -rw-r--r-- | compiler/rustc_ast_passes/src/ast_validation.rs | 13 | 
1 files changed, 3 insertions, 10 deletions
| diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index dee48586f34..07a6f4e5ee7 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -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); } | 
