Auto merge of #83424 - cjgillot:noparam, r=lcnr
GenericParam does not need to be a HIR owner. The special case is not required. Universal impl traits design to regular generic parameters, and their content is owned by the enclosing item. Existential (and opaque) impl traits generate their own enclosing item, and are collected through it.
This commit is contained in:
commit
cb473c2c5b
4 changed files with 6 additions and 54 deletions
|
@ -373,26 +373,8 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
|
|||
}
|
||||
|
||||
fn visit_generic_param(&mut self, param: &'hir GenericParam<'hir>) {
|
||||
if let hir::GenericParamKind::Type {
|
||||
synthetic: Some(hir::SyntheticTyParamKind::ImplTrait),
|
||||
..
|
||||
} = param.kind
|
||||
{
|
||||
debug_assert_eq!(
|
||||
param.hir_id.owner,
|
||||
self.definitions.opt_hir_id_to_local_def_id(param.hir_id).unwrap()
|
||||
);
|
||||
self.with_dep_node_owner(param.hir_id.owner, param, |this, hash| {
|
||||
this.insert_with_hash(param.span, param.hir_id, Node::GenericParam(param), hash);
|
||||
|
||||
this.with_parent(param.hir_id, |this| {
|
||||
intravisit::walk_generic_param(this, param);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
self.insert(param.span, param.hir_id, Node::GenericParam(param));
|
||||
intravisit::walk_generic_param(self, param);
|
||||
}
|
||||
self.insert(param.span, param.hir_id, Node::GenericParam(param));
|
||||
intravisit::walk_generic_param(self, param);
|
||||
}
|
||||
|
||||
fn visit_const_param_default(&mut self, param: HirId, ct: &'hir AnonConst) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue