From 4f0ab6ccce86bb9742090b97f1e130360ac7734a Mon Sep 17 00:00:00 2001 From: Saleem Jaffer Date: Fri, 26 Jul 2019 19:08:12 +0530 Subject: [PATCH] code review fixes --- src/librustc/mir/interpret/error.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/librustc/mir/interpret/error.rs b/src/librustc/mir/interpret/error.rs index d0f3df800e4..dd06991b46a 100644 --- a/src/librustc/mir/interpret/error.rs +++ b/src/librustc/mir/interpret/error.rs @@ -321,16 +321,20 @@ pub enum InvalidProgramInfo<'tcx> { ReferencedConstant, /// Abort in case type errors are reached TypeckError, + /// An error occurred during layout computation. Layout(layout::LayoutError<'tcx>), } #[derive(Clone, RustcEncodable, RustcDecodable, HashStable)] pub enum UndefinedBehaviourInfo { + /// Handle cases which for which we do not have a fixed variant + Ub(String), Unreachable, } #[derive(Clone, RustcEncodable, RustcDecodable, HashStable)] pub enum UnsupportedInfo<'tcx> { + Unimplemented(String), FunctionAbiMismatch(Abi, Abi), FunctionArgMismatch(Ty<'tcx>, Ty<'tcx>), FunctionRetMismatch(Ty<'tcx>, Ty<'tcx>), @@ -362,12 +366,6 @@ pub enum UnsupportedInfo<'tcx> { /// This variant is used by machines to signal their own errors that do not /// match an existing variant. MachineError(String), - - /// Not actually an interpreter error -- used to signal that execution has exited - /// with the given status code. Used by Miri, but not by CTFE. - Exit(i32), - - Unimplemented(String), DerefFunctionPointer, ExecuteMemory, Intrinsic(String), @@ -416,6 +414,9 @@ pub enum InterpError<'tcx> { /// The program exhausted the interpreter's resources (stack/heap too big, /// execution takes too long, ..). ResourceExhaustion(ResourceExhaustionInfo), + /// Not actually an interpreter error -- used to signal that execution has exited + /// with the given status code. Used by Miri, but not by CTFE. + Exit(i32), } pub type InterpResult<'tcx, T = ()> = Result>; -- 2.44.0