use rustc_target::spec::abi::Abi;
use syntax_pos::{Pos, Span};
use syntax::symbol::Symbol;
-
+use hir::GeneratorKind;
use std::{fmt, env};
use rustc_error_codes::*;
OverflowNeg,
DivisionByZero,
RemainderByZero,
- GeneratorResumedAfterReturn,
- GeneratorResumedAfterPanic,
- AsyncResumedAfterReturn,
- AsyncResumedAfterPanic,
+ ResumedAfterReturn(GeneratorKind),
+ ResumedAfterPanic(GeneratorKind),
}
/// Type for MIR `Assert` terminator error messages.
"attempt to divide by zero",
RemainderByZero =>
"attempt to calculate the remainder with a divisor of zero",
- GeneratorResumedAfterReturn =>
+ ResumedAfterReturn(GeneratorKind::Gen) =>
"generator resumed after completion",
- GeneratorResumedAfterPanic =>
- "generator resumed after panicking",
- AsyncResumedAfterReturn =>
+ // FIXME: Do we want a separate message for each Async variant (Block, Closure, Fn)?
+ ResumedAfterReturn(GeneratorKind::Async(_)) =>
"`async fn` resumed after completion",
- AsyncResumedAfterPanic =>
- "`async fn` resumed after panic",
+ ResumedAfterPanic(GeneratorKind::Gen) =>
+ "generator resumed after panicking",
+ // FIXME: Do we want a separate message for each Async variant (Block, Closure, Fn)?
+ ResumedAfterPanic(GeneratorKind::Async(_)) =>
+ "`async fn` resumed after panicking",
Panic { .. } | BoundsCheck { .. } =>
bug!("Unexpected PanicInfo"),
}