diff options
| author | Michael Goulet <michael@errs.io> | 2023-12-21 18:49:20 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-12-22 23:58:29 +0000 |
| commit | 004450506e1302239fa9ea09d50d9dc5a3261a32 (patch) | |
| tree | 1eeff59a02cdb0512f147a06514b756c57208f25 /compiler/rustc_codegen_ssa/src/debuginfo | |
| parent | d6d7a93866f2ffcfb51828b8859bdad760b54ce0 (diff) | |
| download | rust-004450506e1302239fa9ea09d50d9dc5a3261a32.tar.gz rust-004450506e1302239fa9ea09d50d9dc5a3261a32.zip | |
Split coroutine desugaring kind from source
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/debuginfo')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs index dda30046bfb..2ecc5ad4fe4 100644 --- a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs +++ b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs @@ -15,7 +15,7 @@ use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::stable_hasher::{Hash64, HashStable, StableHasher}; use rustc_hir::def_id::DefId; use rustc_hir::definitions::{DefPathData, DefPathDataName, DisambiguatedDefPathData}; -use rustc_hir::{CoroutineKind, CoroutineSource, Mutability}; +use rustc_hir::{CoroutineDesugaring, CoroutineKind, CoroutineSource, Mutability}; use rustc_middle::ty::layout::{IntegerExt, TyAndLayout}; use rustc_middle::ty::{self, ExistentialProjection, ParamEnv, Ty, TyCtxt}; use rustc_middle::ty::{GenericArgKind, GenericArgsRef}; @@ -560,15 +560,31 @@ pub fn push_item_name(tcx: TyCtxt<'_>, def_id: DefId, qualified: bool, output: & fn coroutine_kind_label(coroutine_kind: Option<CoroutineKind>) -> &'static str { match coroutine_kind { - Some(CoroutineKind::Gen(CoroutineSource::Block)) => "gen_block", - Some(CoroutineKind::Gen(CoroutineSource::Closure)) => "gen_closure", - Some(CoroutineKind::Gen(CoroutineSource::Fn)) => "gen_fn", - Some(CoroutineKind::Async(CoroutineSource::Block)) => "async_block", - Some(CoroutineKind::Async(CoroutineSource::Closure)) => "async_closure", - Some(CoroutineKind::Async(CoroutineSource::Fn)) => "async_fn", - Some(CoroutineKind::AsyncGen(CoroutineSource::Block)) => "async_gen_block", - Some(CoroutineKind::AsyncGen(CoroutineSource::Closure)) => "async_gen_closure", - Some(CoroutineKind::AsyncGen(CoroutineSource::Fn)) => "async_gen_fn", + Some(CoroutineKind::Desugared(CoroutineDesugaring::Gen, CoroutineSource::Block)) => { + "gen_block" + } + Some(CoroutineKind::Desugared(CoroutineDesugaring::Gen, CoroutineSource::Closure)) => { + "gen_closure" + } + Some(CoroutineKind::Desugared(CoroutineDesugaring::Gen, CoroutineSource::Fn)) => "gen_fn", + Some(CoroutineKind::Desugared(CoroutineDesugaring::Async, CoroutineSource::Block)) => { + "async_block" + } + Some(CoroutineKind::Desugared(CoroutineDesugaring::Async, CoroutineSource::Closure)) => { + "async_closure" + } + Some(CoroutineKind::Desugared(CoroutineDesugaring::Async, CoroutineSource::Fn)) => { + "async_fn" + } + Some(CoroutineKind::Desugared(CoroutineDesugaring::AsyncGen, CoroutineSource::Block)) => { + "async_gen_block" + } + Some(CoroutineKind::Desugared(CoroutineDesugaring::AsyncGen, CoroutineSource::Closure)) => { + "async_gen_closure" + } + Some(CoroutineKind::Desugared(CoroutineDesugaring::AsyncGen, CoroutineSource::Fn)) => { + "async_gen_fn" + } Some(CoroutineKind::Coroutine) => "coroutine", None => "closure", } |
