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:
commit
a3d9d13d7a
7 changed files with 66 additions and 28 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue