Skip to content

Commit 28dc116

Browse files
Don't ICE when dumping MIR of a synthetic coroutine body
1 parent ac77e88 commit 28dc116

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc_middle/src/mir/pretty.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,9 @@ fn write_mir_sig(tcx: TyCtxt<'_>, body: &Body<'_>, w: &mut dyn io::Write) -> io:
562562
let def_id = body.source.def_id();
563563
let kind = tcx.def_kind(def_id);
564564
let is_function = match kind {
565-
DefKind::Fn | DefKind::AssocFn | DefKind::Ctor(..) => true,
565+
DefKind::Fn | DefKind::AssocFn | DefKind::Ctor(..) | DefKind::SyntheticCoroutineBody => {
566+
true
567+
}
566568
_ => tcx.is_closure_like(def_id),
567569
};
568570
match (kind, body.source.promoted) {

0 commit comments

Comments
 (0)