1
Fork 0

GenericParam does not need to be a HIR owner.

This commit is contained in:
Camille GILLOT 2021-03-23 22:47:22 +01:00
parent d04c3aa865
commit 4c0b7ac7ba
4 changed files with 6 additions and 54 deletions

View file

@ -520,10 +520,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
}
self.visit_fn_ret_ty(&f.decl.output)
}
TyKind::ImplTrait(def_node_id, _) => {
self.lctx.allocate_hir_id_counter(def_node_id);
visit::walk_ty(self, t);
}
_ => visit::walk_ty(self, t),
}
}
@ -1431,14 +1427,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
// Add a definition for the in-band `Param`.
let def_id = self.resolver.local_def_id(def_node_id);
self.allocate_hir_id_counter(def_node_id);
let hir_bounds = self.with_hir_id_owner(def_node_id, |this| {
this.lower_param_bounds(
bounds,
ImplTraitContext::Universal(in_band_ty_params, parent_def_id),
)
});
let hir_bounds = self.lower_param_bounds(
bounds,
ImplTraitContext::Universal(in_band_ty_params, parent_def_id),
);
// Set the name to `impl Bound1 + Bound2`.
let ident = Ident::from_str_and_span(&pprust::ty_to_string(t), span);
in_band_ty_params.push(hir::GenericParam {