1
Fork 0

Properly deny const gen/async gen fns

This commit is contained in:
Michael Goulet 2024-09-11 18:22:37 -04:00
parent 8d6b88b168
commit 594de02cba
6 changed files with 57 additions and 21 deletions

View file

@ -2602,6 +2602,14 @@ impl CoroutineKind {
}
}
pub fn as_str(self) -> &'static str {
match self {
CoroutineKind::Async { .. } => "async",
CoroutineKind::Gen { .. } => "gen",
CoroutineKind::AsyncGen { .. } => "async gen",
}
}
pub fn is_async(self) -> bool {
matches!(self, CoroutineKind::Async { .. })
}