diff options
| author | Michael Goulet <michael@errs.io> | 2024-08-28 18:28:46 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-09-03 16:22:28 -0400 |
| commit | a4f2a311db7622f73d6c0fa29ac0397064a75686 (patch) | |
| tree | ed86099b3ae758654228c6b929c624e8ae2775dc | |
| parent | d6c8169c186ab16a3404cd0d0866674018e8a19e (diff) | |
| download | rust-a4f2a311db7622f73d6c0fa29ac0397064a75686.tar.gz rust-a4f2a311db7622f73d6c0fa29ac0397064a75686.zip | |
Don't ICE when dumping MIR of a synthetic coroutine body
| -rw-r--r-- | compiler/rustc_middle/src/mir/pretty.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/mir/pretty.rs b/compiler/rustc_middle/src/mir/pretty.rs index 9906be60e3e..a98e6943d68 100644 --- a/compiler/rustc_middle/src/mir/pretty.rs +++ b/compiler/rustc_middle/src/mir/pretty.rs @@ -612,7 +612,9 @@ fn write_mir_sig(tcx: TyCtxt<'_>, body: &Body<'_>, w: &mut dyn io::Write) -> io: let def_id = body.source.def_id(); let kind = tcx.def_kind(def_id); let is_function = match kind { - DefKind::Fn | DefKind::AssocFn | DefKind::Ctor(..) => true, + DefKind::Fn | DefKind::AssocFn | DefKind::Ctor(..) | DefKind::SyntheticCoroutineBody => { + true + } _ => tcx.is_closure_like(def_id), }; match (kind, body.source.promoted) { |
