about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/lib.rs
diff options
context:
space:
mode:
authorbohan <bohan-zhang@foxmail.com>2023-11-26 21:05:08 +0800
committerbohan <bohan-zhang@foxmail.com>2023-11-26 21:05:08 +0800
commitf23befe6c118573a2ca041bc89f959a8813b43a2 (patch)
treedc0185a1375a527e7112b07412295916683cff7e /compiler/rustc_mir_transform/src/lib.rs
parent274b5249eb1014b441fd9fe45e9373111f61e413 (diff)
downloadrust-f23befe6c118573a2ca041bc89f959a8813b43a2.tar.gz
rust-f23befe6c118573a2ca041bc89f959a8813b43a2.zip
merge `DefKind::Coroutine` into `DefKind::Closure`
Diffstat (limited to 'compiler/rustc_mir_transform/src/lib.rs')
-rw-r--r--compiler/rustc_mir_transform/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs
index 5c05446a981..fff760ba399 100644
--- a/compiler/rustc_mir_transform/src/lib.rs
+++ b/compiler/rustc_mir_transform/src/lib.rs
@@ -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);