Rename AsyncCoroutineKind
to CoroutineSource
similar to how we have `MatchSource`, it explains where the desugaring came from.
This commit is contained in:
parent
eb03d40a9c
commit
af8a998b1e
19 changed files with 59 additions and 59 deletions
|
@ -360,7 +360,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallUnstable {
|
|||
pub struct Coroutine(pub hir::CoroutineKind);
|
||||
impl<'tcx> NonConstOp<'tcx> for Coroutine {
|
||||
fn status_in_item(&self, _: &ConstCx<'_, 'tcx>) -> Status {
|
||||
if let hir::CoroutineKind::Async(hir::AsyncCoroutineKind::Block) = self.0 {
|
||||
if let hir::CoroutineKind::Async(hir::CoroutineSource::Block) = self.0 {
|
||||
Status::Unstable(sym::const_async_blocks)
|
||||
} else {
|
||||
Status::Forbidden
|
||||
|
@ -373,7 +373,7 @@ impl<'tcx> NonConstOp<'tcx> for Coroutine {
|
|||
span: Span,
|
||||
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
|
||||
let msg = format!("{}s are not allowed in {}s", self.0.descr(), ccx.const_kind());
|
||||
if let hir::CoroutineKind::Async(hir::AsyncCoroutineKind::Block) = self.0 {
|
||||
if let hir::CoroutineKind::Async(hir::CoroutineSource::Block) = self.0 {
|
||||
ccx.tcx.sess.create_feature_err(
|
||||
errors::UnallowedOpInConstContext { span, msg },
|
||||
sym::const_async_blocks,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue