1
Fork 0

Rollup merge of #138929 - oli-obk:assoc-ctxt-of-trait, r=compiler-errors

Visitors track whether an assoc item is in a trait impl or an inherent impl

`AssocCtxt::Impl` now contains an `of_trait` field. This allows ast lowering and nameres to not have to track whether we're in a trait impl or an inherent impl.
This commit is contained in:
Matthias Krüger 2025-03-25 18:09:07 +01:00 committed by GitHub
commit 1107fc7ad2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 185 additions and 96 deletions

View file

@ -241,7 +241,7 @@ impl<'ast, 'ecx, 'tcx, T: EarlyLintPass> ast_visit::Visitor<'ast>
ast_visit::AssocCtxt::Trait => {
lint_callback!(cx, check_trait_item, item);
}
ast_visit::AssocCtxt::Impl => {
ast_visit::AssocCtxt::Impl { .. } => {
lint_callback!(cx, check_impl_item, item);
}
}
@ -250,7 +250,7 @@ impl<'ast, 'ecx, 'tcx, T: EarlyLintPass> ast_visit::Visitor<'ast>
ast_visit::AssocCtxt::Trait => {
lint_callback!(cx, check_trait_item_post, item);
}
ast_visit::AssocCtxt::Impl => {
ast_visit::AssocCtxt::Impl { .. } => {
lint_callback!(cx, check_impl_item_post, item);
}
}