From 1b132a2f413f2bd1ae7dea0e8f3519b2765a5a71 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 2 Aug 2019 23:24:27 +0200 Subject: [PATCH] be less British --- src/librustc/mir/interpret/error.rs | 10 +++++----- src/librustc/mir/interpret/mod.rs | 6 +++--- src/librustc_mir/transform/const_prop.rs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) 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 @@ impl fmt::Debug for InvalidProgramInfo<'tcx> { } #[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 @@ impl fmt::Debug for InterpError<'_> { 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 @@ mod pointer; 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 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> { match diagnostic.error { Exit(_) => bug!("the CTFE program cannot exit"), Unsupported(_) - | UndefinedBehaviour(_) + | UndefinedBehavior(_) | InvalidProgram(_) | ResourceExhaustion(_) => { // Ignore these errors.