Rollup merge of #123397 - krtab:foreign_fn_qualif_diag, r=petrochenkov

Fix diagnostic for qualifier in extern block

Closes: https://github.com/rust-lang/rust/issues/123306
This commit is contained in:
Matthias Krüger 2024-04-04 14:51:17 +02:00 committed by GitHub
commit f254ab08f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 93 additions and 72 deletions

View file

@ -2484,6 +2484,14 @@ pub enum CoroutineKind {
}
impl CoroutineKind {
pub fn span(self) -> Span {
match self {
CoroutineKind::Async { span, .. } => span,
CoroutineKind::Gen { span, .. } => span,
CoroutineKind::AsyncGen { span, .. } => span,
}
}
pub fn is_async(self) -> bool {
matches!(self, CoroutineKind::Async { .. })
}