1
Fork 0

Add hir::GeneratorKind::Gen

This commit is contained in:
Oli Scherer 2023-10-20 19:21:24 +00:00
parent a61cf673cd
commit 14423080f1
12 changed files with 99 additions and 22 deletions

View file

@ -2505,6 +2505,11 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
};
let kind = match use_span.coroutine_kind() {
Some(coroutine_kind) => match coroutine_kind {
CoroutineKind::Gen(kind) => match kind {
CoroutineSource::Block => "gen block",
CoroutineSource::Closure => "gen closure",
_ => bug!("gen block/closure expected, but gen function found."),
},
CoroutineKind::Async(async_kind) => match async_kind {
CoroutineSource::Block => "async block",
CoroutineSource::Closure => "async closure",