Properly deny const gen/async gen fns
This commit is contained in:
parent
8d6b88b168
commit
594de02cba
6 changed files with 57 additions and 21 deletions
|
@ -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 { .. })
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue