1
Fork 0

Rename tcx.ensure_with_value() to tcx.ensure_done()

This commit is contained in:
Zalathar 2025-01-30 16:28:44 +11:00
parent 24cdaa146a
commit 9e4f10db65
8 changed files with 37 additions and 25 deletions

View file

@ -47,7 +47,7 @@ pub(crate) fn closure_saved_names_of_captured_variables<'tcx>(
/// Create the MIR for a given `DefId`, including unreachable code. Do not call
/// this directly; instead use the cached version via `mir_built`.
pub fn build_mir<'tcx>(tcx: TyCtxt<'tcx>, def: LocalDefId) -> Body<'tcx> {
tcx.ensure_with_value().thir_abstract_const(def);
tcx.ensure_done().thir_abstract_const(def);
if let Err(e) = tcx.check_match(def) {
return construct_error(tcx, def, e);
}

View file

@ -200,7 +200,7 @@ impl<'tcx> UnsafetyVisitor<'_, 'tcx> {
fn visit_inner_body(&mut self, def: LocalDefId) {
if let Ok((inner_thir, expr)) = self.tcx.thir_body(def) {
// Runs all other queries that depend on THIR.
self.tcx.ensure_with_value().mir_built(def);
self.tcx.ensure_done().mir_built(def);
let inner_thir = &inner_thir.steal();
let hir_context = self.tcx.local_def_id_to_hir_id(def);
let safety_context = mem::replace(&mut self.safety_context, SafetyContext::Safe);
@ -1112,7 +1112,7 @@ pub(crate) fn check_unsafety(tcx: TyCtxt<'_>, def: LocalDefId) {
let Ok((thir, expr)) = tcx.thir_body(def) else { return };
// Runs all other queries that depend on THIR.
tcx.ensure_with_value().mir_built(def);
tcx.ensure_done().mir_built(def);
let thir = &thir.steal();
let hir_id = tcx.local_def_id_to_hir_id(def);