be less British
This commit is contained in:
parent
cf048cc115
commit
1b132a2f41
@ -341,16 +341,16 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
}
|
||||
|
||||
#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)]
|
||||
pub enum UndefinedBehaviourInfo {
|
||||
pub enum UndefinedBehaviorInfo {
|
||||
/// Handle cases which for which we do not have a fixed variant.
|
||||
Ub(String),
|
||||
/// Unreachable code was executed.
|
||||
Unreachable,
|
||||
}
|
||||
|
||||
impl fmt::Debug for UndefinedBehaviourInfo {
|
||||
impl fmt::Debug for UndefinedBehaviorInfo {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
use UndefinedBehaviourInfo::*;
|
||||
use UndefinedBehaviorInfo::*;
|
||||
match self {
|
||||
Ub(ref msg) =>
|
||||
write!(f, "{}", msg),
|
||||
@ -572,7 +572,7 @@ pub enum InterpError<'tcx> {
|
||||
/// The program panicked.
|
||||
Panic(PanicInfo<u64>),
|
||||
/// The program caused undefined behavior.
|
||||
UndefinedBehaviour(UndefinedBehaviourInfo),
|
||||
UndefinedBehavior(UndefinedBehaviorInfo),
|
||||
/// The program did something the interpreter does not support (some of these *might* be UB
|
||||
/// but the interpreter is not sure).
|
||||
Unsupported(UnsupportedOpInfo<'tcx>),
|
||||
@ -603,7 +603,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{:?}", msg),
|
||||
InvalidProgram(ref msg) =>
|
||||
write!(f, "{:?}", msg),
|
||||
UndefinedBehaviour(ref msg) =>
|
||||
UndefinedBehavior(ref msg) =>
|
||||
write!(f, "{:?}", msg),
|
||||
ResourceExhaustion(ref msg) =>
|
||||
write!(f, "{:?}", msg),
|
||||
|
@ -21,8 +21,8 @@ macro_rules! err_inval {
|
||||
#[macro_export]
|
||||
macro_rules! err_ub {
|
||||
($($tt:tt)*) => {
|
||||
$crate::mir::interpret::InterpError::UndefinedBehaviour(
|
||||
$crate::mir::interpret::UndefinedBehaviourInfo::$($tt)*
|
||||
$crate::mir::interpret::InterpError::UndefinedBehavior(
|
||||
$crate::mir::interpret::UndefinedBehaviorInfo::$($tt)*
|
||||
)
|
||||
};
|
||||
}
|
||||
@ -78,7 +78,7 @@ macro_rules! throw_exhaust {
|
||||
pub use self::error::{
|
||||
InterpErrorInfo, InterpResult, InterpError, AssertMessage, ConstEvalErr, struct_error,
|
||||
FrameInfo, ConstEvalRawResult, ConstEvalResult, ErrorHandled, PanicInfo, UnsupportedOpInfo,
|
||||
InvalidProgramInfo, ResourceExhaustionInfo, UndefinedBehaviourInfo,
|
||||
InvalidProgramInfo, ResourceExhaustionInfo, UndefinedBehaviorInfo,
|
||||
};
|
||||
|
||||
pub use self::value::{Scalar, ScalarMaybeUndef, RawConst, ConstValue};
|
||||
|
@ -260,7 +260,7 @@ fn use_ecx<F, T>(
|
||||
match diagnostic.error {
|
||||
Exit(_) => bug!("the CTFE program cannot exit"),
|
||||
Unsupported(_)
|
||||
| UndefinedBehaviour(_)
|
||||
| UndefinedBehavior(_)
|
||||
| InvalidProgram(_)
|
||||
| ResourceExhaustion(_) => {
|
||||
// Ignore these errors.
|
||||
|
Loading…
Reference in New Issue
Block a user