Rename CoroutineKind::Gen to ::Coroutine
This commit is contained in:
@@ -139,9 +139,9 @@ impl<O> AssertKind<O> {
|
||||
Overflow(op, _, _) => bug!("{:?} cannot overflow", op),
|
||||
DivisionByZero(_) => "attempt to divide by zero",
|
||||
RemainderByZero(_) => "attempt to calculate the remainder with a divisor of zero",
|
||||
ResumedAfterReturn(CoroutineKind::Gen) => "coroutine resumed after completion",
|
||||
ResumedAfterReturn(CoroutineKind::Coroutine) => "coroutine resumed after completion",
|
||||
ResumedAfterReturn(CoroutineKind::Async(_)) => "`async fn` resumed after completion",
|
||||
ResumedAfterPanic(CoroutineKind::Gen) => "coroutine resumed after panicking",
|
||||
ResumedAfterPanic(CoroutineKind::Coroutine) => "coroutine resumed after panicking",
|
||||
ResumedAfterPanic(CoroutineKind::Async(_)) => "`async fn` resumed after panicking",
|
||||
BoundsCheck { .. } | MisalignedPointerDereference { .. } => {
|
||||
bug!("Unexpected AssertKind")
|
||||
@@ -229,9 +229,13 @@ impl<O> AssertKind<O> {
|
||||
DivisionByZero(_) => middle_assert_divide_by_zero,
|
||||
RemainderByZero(_) => middle_assert_remainder_by_zero,
|
||||
ResumedAfterReturn(CoroutineKind::Async(_)) => middle_assert_async_resume_after_return,
|
||||
ResumedAfterReturn(CoroutineKind::Gen) => middle_assert_coroutine_resume_after_return,
|
||||
ResumedAfterReturn(CoroutineKind::Coroutine) => {
|
||||
middle_assert_coroutine_resume_after_return
|
||||
}
|
||||
ResumedAfterPanic(CoroutineKind::Async(_)) => middle_assert_async_resume_after_panic,
|
||||
ResumedAfterPanic(CoroutineKind::Gen) => middle_assert_coroutine_resume_after_panic,
|
||||
ResumedAfterPanic(CoroutineKind::Coroutine) => {
|
||||
middle_assert_coroutine_resume_after_panic
|
||||
}
|
||||
|
||||
MisalignedPointerDereference { .. } => middle_assert_misaligned_ptr_deref,
|
||||
}
|
||||
|
||||
@@ -788,7 +788,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
|
||||
p!(write("{{"));
|
||||
let coroutine_kind = self.tcx().coroutine_kind(did).unwrap();
|
||||
let should_print_movability =
|
||||
self.should_print_verbose() || coroutine_kind == hir::CoroutineKind::Gen;
|
||||
self.should_print_verbose() || coroutine_kind == hir::CoroutineKind::Coroutine;
|
||||
|
||||
if should_print_movability {
|
||||
match movability {
|
||||
|
||||
@@ -748,7 +748,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||
DefKind::AssocFn if self.associated_item(def_id).fn_has_self_parameter => "method",
|
||||
DefKind::Coroutine => match self.coroutine_kind(def_id).unwrap() {
|
||||
rustc_hir::CoroutineKind::Async(..) => "async closure",
|
||||
rustc_hir::CoroutineKind::Gen => "coroutine",
|
||||
rustc_hir::CoroutineKind::Coroutine => "coroutine",
|
||||
},
|
||||
_ => def_kind.descr(def_id),
|
||||
}
|
||||
@@ -765,7 +765,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||
DefKind::AssocFn if self.associated_item(def_id).fn_has_self_parameter => "a",
|
||||
DefKind::Coroutine => match self.coroutine_kind(def_id).unwrap() {
|
||||
rustc_hir::CoroutineKind::Async(..) => "an",
|
||||
rustc_hir::CoroutineKind::Gen => "a",
|
||||
rustc_hir::CoroutineKind::Coroutine => "a",
|
||||
},
|
||||
_ => def_kind.article(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user