Skip to content

Commit 87457f6

Browse files
committed
Inline and remove LoweringContext::new_named_lifetime_with_res.
It has a single call site.
1 parent 8b87fef commit 87457f6

File tree

1 file changed

+4
-14
lines changed
  • compiler/rustc_ast_lowering/src

1 file changed

+4
-14
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,12 +1774,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
17741774
}
17751775

17761776
#[instrument(level = "debug", skip(self))]
1777-
fn new_named_lifetime_with_res(
1777+
fn new_named_lifetime(
17781778
&mut self,
17791779
id: NodeId,
1780+
new_id: NodeId,
17801781
ident: Ident,
1781-
res: LifetimeRes,
17821782
) -> &'hir hir::Lifetime {
1783+
let res = self.resolver.get_lifetime_res(id).unwrap_or(LifetimeRes::Error);
17831784
let res = match res {
17841785
LifetimeRes::Param { param, .. } => hir::LifetimeName::Param(param),
17851786
LifetimeRes::Fresh { param, .. } => {
@@ -1797,23 +1798,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
17971798

17981799
debug!(?res);
17991800
self.arena.alloc(hir::Lifetime {
1800-
hir_id: self.lower_node_id(id),
1801+
hir_id: self.lower_node_id(new_id),
18011802
ident: self.lower_ident(ident),
18021803
res,
18031804
})
18041805
}
18051806

1806-
#[instrument(level = "debug", skip(self))]
1807-
fn new_named_lifetime(
1808-
&mut self,
1809-
id: NodeId,
1810-
new_id: NodeId,
1811-
ident: Ident,
1812-
) -> &'hir hir::Lifetime {
1813-
let res = self.resolver.get_lifetime_res(id).unwrap_or(LifetimeRes::Error);
1814-
self.new_named_lifetime_with_res(new_id, ident, res)
1815-
}
1816-
18171807
fn lower_generic_params_mut(
18181808
&mut self,
18191809
params: &[GenericParam],

0 commit comments

Comments
 (0)