merge DefKind::Coroutine into DefKind::Closure

This commit is contained in:
bohan 2023-11-26 21:05:08 +08:00
parent 274b5249eb
commit f23befe6c1
27 changed files with 83 additions and 94 deletions

View file

@ -395,7 +395,7 @@ fn inner_mir_for_ctfe(tcx: TyCtxt<'_>, def: LocalDefId) -> Body<'_> {
/// mir borrowck *before* doing so in order to ensure that borrowck can be run and doesn't
/// end up missing the source MIR due to stealing happening.
fn mir_drops_elaborated_and_const_checked(tcx: TyCtxt<'_>, def: LocalDefId) -> &Steal<Body<'_>> {
if let DefKind::Coroutine = tcx.def_kind(def) {
if tcx.is_coroutine(def.to_def_id()) {
tcx.ensure_with_value().mir_coroutine_witnesses(def);
}
let mir_borrowck = tcx.mir_borrowck(def);