Rollup merge of #130252 - compiler-errors:const-gen, r=chenyukang

Properly report error on `const gen fn`

Fixes #130232

Also removes some (what I thought were unused) functions, and fixes a bug in clippy where we considered `gen fn` to be the same as `fn` because it was only built to consider asyncness.
This commit is contained in:
Stuart Cook 2024-09-12 20:37:18 +10:00 committed by GitHub
commit a3d9d13d7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 66 additions and 28 deletions

View file

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