Skip to content

Commit adf2bb7

Browse files
committed
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`.
1 parent 6496d69 commit adf2bb7

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_ast_lowering/src

1 file changed

+1
-1
lines changed

compiler/rustc_ast_lowering/src/item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1720,7 +1720,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
17201720

17211721
let bounds = self.lower_param_bounds(bounds, itctx);
17221722

1723-
let ident = self.lower_ident(ident);
17241723
let param_span = ident.span;
17251724

17261725
// Reconstruct the span of the entire predicate from the individual generic bounds.
@@ -1739,6 +1738,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
17391738
let def_id = self.local_def_id(id).to_def_id();
17401739
let hir_id = self.next_id();
17411740
let res = Res::Def(DefKind::TyParam, def_id);
1741+
let ident = self.lower_ident(ident);
17421742
let ty_path = self.arena.alloc(hir::Path {
17431743
span: param_span,
17441744
res,

0 commit comments

Comments
 (0)