diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-05-20 14:04:24 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-05-20 14:04:24 +1000 |
| commit | 7c62e78cf95daf69f8b0bec232f48fec6c8b935c (patch) | |
| tree | ff39f2d971f300e798c7c79e12ffcbe88388612d /compiler/rustc_ast_lowering/src/lib.rs | |
| parent | 0c0b2cbcb597bac8cf7fa34b99d5dbe7a35419e1 (diff) | |
| download | rust-7c62e78cf95daf69f8b0bec232f48fec6c8b935c.tar.gz rust-7c62e78cf95daf69f8b0bec232f48fec6c8b935c.zip | |
Hoist `ItemLowerer` out of a loop.
Diffstat (limited to 'compiler/rustc_ast_lowering/src/lib.rs')
| -rw-r--r-- | compiler/rustc_ast_lowering/src/lib.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 19095f2e01e..422e79ca82f 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -444,14 +444,14 @@ pub fn lower_to_hir(tcx: TyCtxt<'_>, (): ()) -> hir::Crate<'_> { tcx.definitions_untracked().def_index_count(), ); + let mut lowerer = item::ItemLowerer { + tcx, + resolver: &mut resolver, + ast_index: &ast_index, + owners: &mut owners, + }; for def_id in ast_index.indices() { - item::ItemLowerer { - tcx, - resolver: &mut resolver, - ast_index: &ast_index, - owners: &mut owners, - } - .lower_node(def_id); + lowerer.lower_node(def_id); } drop(ast_index); |
