delegation: Implement list delegation
```rust reuse prefix::{a, b, c} ```
This commit is contained in:
parent
8387315ab3
commit
c30b41012d
29 changed files with 511 additions and 60 deletions
|
@ -522,7 +522,8 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> {
|
|||
Impl,
|
||||
MacCall,
|
||||
MacroDef,
|
||||
Delegation
|
||||
Delegation,
|
||||
DelegationMac
|
||||
]
|
||||
);
|
||||
ast_visit::walk_item(self, i)
|
||||
|
@ -650,7 +651,7 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> {
|
|||
fn visit_assoc_item(&mut self, i: &'v ast::AssocItem, ctxt: ast_visit::AssocCtxt) {
|
||||
record_variants!(
|
||||
(self, i, i.kind, Id::None, ast, AssocItem, AssocItemKind),
|
||||
[Const, Fn, Type, MacCall, Delegation]
|
||||
[Const, Fn, Type, MacCall, Delegation, DelegationMac]
|
||||
);
|
||||
ast_visit::walk_assoc_item(self, i, ctxt);
|
||||
}
|
||||
|
|
|
@ -285,7 +285,9 @@ impl<'ast, 'tcx> visit::Visitor<'ast> for LanguageItemCollector<'ast, 'tcx> {
|
|||
ast::ItemKind::TraitAlias(_, _) => Target::TraitAlias,
|
||||
ast::ItemKind::Impl(_) => Target::Impl,
|
||||
ast::ItemKind::MacroDef(_) => Target::MacroDef,
|
||||
ast::ItemKind::MacCall(_) => unreachable!("macros should have been expanded"),
|
||||
ast::ItemKind::MacCall(_) | ast::ItemKind::DelegationMac(_) => {
|
||||
unreachable!("macros should have been expanded")
|
||||
}
|
||||
};
|
||||
|
||||
self.check_for_lang(
|
||||
|
@ -340,7 +342,9 @@ impl<'ast, 'tcx> visit::Visitor<'ast> for LanguageItemCollector<'ast, 'tcx> {
|
|||
}
|
||||
ast::AssocItemKind::Const(ct) => (Target::AssocConst, Some(&ct.generics)),
|
||||
ast::AssocItemKind::Type(ty) => (Target::AssocTy, Some(&ty.generics)),
|
||||
ast::AssocItemKind::MacCall(_) => unreachable!("macros should have been expanded"),
|
||||
ast::AssocItemKind::MacCall(_) | ast::AssocItemKind::DelegationMac(_) => {
|
||||
unreachable!("macros should have been expanded")
|
||||
}
|
||||
};
|
||||
|
||||
self.check_for_lang(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue