]> git.lizzy.rs Git - rust.git/commitdiff
moving remaining variants to UnsupportedInfo
authorSaleem Jaffer <ssaleem1992@gmail.com>
Fri, 26 Jul 2019 11:01:12 +0000 (16:31 +0530)
committerSaleem Jaffer <ssaleem1992@gmail.com>
Mon, 29 Jul 2019 08:03:54 +0000 (13:33 +0530)
src/librustc/mir/interpret/error.rs

index 2897c70d71d25066466f4b0d8f41f3de7a5762f6..d0f3df800e4d0ee841f500029df6ccb8a6aca121 100644 (file)
@@ -359,31 +359,6 @@ pub enum UnsupportedInfo<'tcx> {
     UnimplementedTraitSelection,
     CalledClosureAsFunction,
     NoMirFor(String),
-}
-
-#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)]
-pub enum ResourceExhaustionInfo {
-    StackFrameLimitReached,
-    InfiniteLoop,
-}
-
-#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)]
-pub enum InterpError<'tcx> {
-    /// The program panicked.
-    Panic(PanicMessage<u64>),
-    /// The program caused undefined behavior.
-    UndefinedBehaviour(UndefinedBehaviourInfo),
-    /// The program did something the interpreter does not support (some of these *might* be UB
-    /// but the interpreter is not sure).
-    Unsupported(UnsupportedInfo<'tcx>),
-    /// The program was invalid (ill-typed, not sufficiently monomorphized, ...).
-    InvalidProgram(InvalidProgramInfo<'tcx>),
-    /// The program exhausted the interpreter's resources (stack/heap too big,
-    /// execution takes too long, ..).
-    ResourceExhaustion(ResourceExhaustionInfo),
-
-    /// THe above 5 variants are what we want to group all the remaining InterpError variants into
-
     /// This variant is used by machines to signal their own errors that do not
     /// match an existing variant.
     MachineError(String),
@@ -421,6 +396,28 @@ pub enum InterpError<'tcx> {
     PathNotFound(Vec<String>),
 }
 
+#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)]
+pub enum ResourceExhaustionInfo {
+    StackFrameLimitReached,
+    InfiniteLoop,
+}
+
+#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)]
+pub enum InterpError<'tcx> {
+    /// The program panicked.
+    Panic(PanicMessage<u64>),
+    /// The program caused undefined behavior.
+    UndefinedBehaviour(UndefinedBehaviourInfo),
+    /// The program did something the interpreter does not support (some of these *might* be UB
+    /// but the interpreter is not sure).
+    Unsupported(UnsupportedInfo<'tcx>),
+    /// The program was invalid (ill-typed, not sufficiently monomorphized, ...).
+    InvalidProgram(InvalidProgramInfo<'tcx>),
+    /// The program exhausted the interpreter's resources (stack/heap too big,
+    /// execution takes too long, ..).
+    ResourceExhaustion(ResourceExhaustionInfo),
+}
+
 pub type InterpResult<'tcx, T = ()> = Result<T, InterpErrorInfo<'tcx>>;
 
 impl fmt::Display for InterpError<'_> {