diff --git a/src/librustc/mir/interpret/error.rs b/src/librustc/mir/interpret/error.rs index 8d41b019c22..ab1af155a4b 100644 --- a/src/librustc/mir/interpret/error.rs +++ b/src/librustc/mir/interpret/error.rs @@ -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), /// 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), diff --git a/src/librustc/mir/interpret/mod.rs b/src/librustc/mir/interpret/mod.rs index 723a30792fd..855232b3334 100644 --- a/src/librustc/mir/interpret/mod.rs +++ b/src/librustc/mir/interpret/mod.rs @@ -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}; diff --git a/src/librustc_mir/transform/const_prop.rs b/src/librustc_mir/transform/const_prop.rs index a450ec32e1a..38d26d0ba50 100644 --- a/src/librustc_mir/transform/const_prop.rs +++ b/src/librustc_mir/transform/const_prop.rs @@ -260,7 +260,7 @@ fn use_ecx( match diagnostic.error { Exit(_) => bug!("the CTFE program cannot exit"), Unsupported(_) - | UndefinedBehaviour(_) + | UndefinedBehavior(_) | InvalidProgram(_) | ResourceExhaustion(_) => { // Ignore these errors.