Fix diagnostic for qualifier in extern block
Closes: https://github.com/rust-lang/rust/issues/123306
This commit is contained in:
@@ -2483,6 +2483,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 { .. })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user