Avoid double lowering of generic identifiers.
`lower_generic_bound_predicate` calls `lower_ident`, and then passes the lowered ident into `new_named_lifetime`, which lowers it again. This commit avoids the first lowering. This requires adding a `lower_ident` call on a path that doesn't involve `new_named_lifetime`.
This commit is contained in:
parent
6496d6943f
commit
adf2bb75ea
1 changed files with 1 additions and 1 deletions
|
@ -1720,7 +1720,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
|
||||
let bounds = self.lower_param_bounds(bounds, itctx);
|
||||
|
||||
let ident = self.lower_ident(ident);
|
||||
let param_span = ident.span;
|
||||
|
||||
// Reconstruct the span of the entire predicate from the individual generic bounds.
|
||||
|
@ -1739,6 +1738,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
let def_id = self.local_def_id(id).to_def_id();
|
||||
let hir_id = self.next_id();
|
||||
let res = Res::Def(DefKind::TyParam, def_id);
|
||||
let ident = self.lower_ident(ident);
|
||||
let ty_path = self.arena.alloc(hir::Path {
|
||||
span: param_span,
|
||||
res,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue