Skip to content

Commit e955ec0

Browse files
committed
Use ensure_with_value in a few more places.
1 parent 382cc90 commit e955ec0

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

compiler/rustc_ast_lowering/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,9 @@ fn compute_hir_hash(
435435

436436
pub fn lower_to_hir(tcx: TyCtxt<'_>, (): ()) -> hir::Crate<'_> {
437437
let sess = tcx.sess;
438-
tcx.ensure().output_filenames(());
439-
let _ = tcx.early_lint_checks(()); // Borrows `resolver_for_lowering`.
438+
// Queries that borrow `resolver_for_lowering`.
439+
tcx.ensure_with_value().output_filenames(());
440+
tcx.ensure_with_value().early_lint_checks(());
440441
let (mut resolver, krate) = tcx.resolver_for_lowering(()).steal();
441442

442443
let ast_index = index_crate(&resolver.node_id_to_def_id, &krate);

compiler/rustc_metadata/src/rmeta/encoder.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2050,13 +2050,13 @@ fn prefetch_mir(tcx: TyCtxt<'_>) {
20502050
let (encode_const, encode_opt) = should_encode_mir(tcx, def_id);
20512051

20522052
if encode_const {
2053-
tcx.ensure().mir_for_ctfe(def_id);
2053+
tcx.ensure_with_value().mir_for_ctfe(def_id);
20542054
}
20552055
if encode_opt {
2056-
tcx.ensure().optimized_mir(def_id);
2056+
tcx.ensure_with_value().optimized_mir(def_id);
20572057
}
20582058
if encode_opt || encode_const {
2059-
tcx.ensure().promoted_mir(def_id);
2059+
tcx.ensure_with_value().promoted_mir(def_id);
20602060
}
20612061
})
20622062
}

compiler/rustc_mir_transform/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ fn mir_drops_elaborated_and_const_checked(
444444

445445
// Do not compute the mir call graph without said call graph actually being used.
446446
if inline::Inline.is_enabled(&tcx.sess) {
447-
let _ = tcx.mir_inliner_callees(ty::InstanceDef::Item(def));
447+
tcx.ensure_with_value().mir_inliner_callees(ty::InstanceDef::Item(def));
448448
}
449449
}
450450

0 commit comments

Comments
 (0)