]> git.lizzy.rs Git - rust.git/commitdiff
code review fixes
authorSaleem Jaffer <ssaleem1992@gmail.com>
Fri, 26 Jul 2019 13:38:12 +0000 (19:08 +0530)
committerSaleem Jaffer <ssaleem1992@gmail.com>
Mon, 29 Jul 2019 08:03:54 +0000 (13:33 +0530)
src/librustc/mir/interpret/error.rs

index d0f3df800e4d0ee841f500029df6ccb8a6aca121..dd06991b46aca9e094c261b53bfd422e06a6f4d5 100644 (file)
@@ -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<T, InterpErrorInfo<'tcx>>;