1
Fork 0

borrowck typeck children together with their parent

This commit is contained in:
lcnr 2025-03-14 16:01:09 +01:00
parent e643f59f6d
commit f05a23be5c
19 changed files with 335 additions and 217 deletions

View file

@ -498,8 +498,11 @@ fn mir_drops_elaborated_and_const_checked(tcx: TyCtxt<'_>, def: LocalDefId) -> &
}
// We only need to borrowck non-synthetic MIR.
let tainted_by_errors =
if !tcx.is_synthetic_mir(def) { tcx.mir_borrowck(def).tainted_by_errors } else { None };
let tainted_by_errors = if !tcx.is_synthetic_mir(def) {
tcx.mir_borrowck(tcx.typeck_root_def_id(def.to_def_id()).expect_local()).err()
} else {
None
};
let is_fn_like = tcx.def_kind(def).is_fn_like();
if is_fn_like {
@ -795,7 +798,7 @@ fn promoted_mir(tcx: TyCtxt<'_>, def: LocalDefId) -> &IndexVec<Promoted, Body<'_
}
if !tcx.is_synthetic_mir(def) {
tcx.ensure_done().mir_borrowck(def);
tcx.ensure_done().mir_borrowck(tcx.typeck_root_def_id(def.to_def_id()).expect_local());
}
let mut promoted = tcx.mir_promoted(def).1.steal();