Skip to content

Commit 7c62e78

Browse files
committed
Hoist ItemLowerer out of a loop.
1 parent 0c0b2cb commit 7c62e78

File tree

1 file changed

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

1 file changed

+7
-7
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -444,14 +444,14 @@ pub fn lower_to_hir(tcx: TyCtxt<'_>, (): ()) -> hir::Crate<'_> {
444444
tcx.definitions_untracked().def_index_count(),
445445
);
446446

447+
let mut lowerer = item::ItemLowerer {
448+
tcx,
449+
resolver: &mut resolver,
450+
ast_index: &ast_index,
451+
owners: &mut owners,
452+
};
447453
for def_id in ast_index.indices() {
448-
item::ItemLowerer {
449-
tcx,
450-
resolver: &mut resolver,
451-
ast_index: &ast_index,
452-
owners: &mut owners,
453-
}
454-
.lower_node(def_id);
454+
lowerer.lower_node(def_id);
455455
}
456456

457457
drop(ast_index);

0 commit comments

Comments
 (0)