about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-08-04 11:21:41 +0200
committerRalf Jung <post@ralfj.de>2019-08-04 11:21:41 +0200
commit18daa766f058217e0b2f53d34e02c8a64b341141 (patch)
treed0c90bad4018eebe5f4eb3dd575125678fc23980
parent89a370db0f6caef02b34cd42a151ef21613a8b44 (diff)
downloadrust-18daa766f058217e0b2f53d34e02c8a64b341141.tar.gz
rust-18daa766f058217e0b2f53d34e02c8a64b341141.zip
move AssumptionNotHeld to UB
-rw-r--r--src/librustc/mir/interpret/error.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustc/mir/interpret/error.rs b/src/librustc/mir/interpret/error.rs
index 5d60108f37c..f1baebd34a4 100644
--- a/src/librustc/mir/interpret/error.rs
+++ b/src/librustc/mir/interpret/error.rs
@@ -348,6 +348,8 @@ pub enum UndefinedBehaviorInfo {
     UbExperimental(String),
     /// Unreachable code was executed.
     Unreachable,
+    /// An `assume` was run on a `false` condition,
+    AssumptionNotHeld,
 }
 
 impl fmt::Debug for UndefinedBehaviorInfo {
@@ -358,6 +360,8 @@ impl fmt::Debug for UndefinedBehaviorInfo {
                 write!(f, "{}", msg),
             Unreachable =>
                 write!(f, "entered unreachable code"),
+            AssumptionNotHeld =>
+                write!(f, "`assume` argument was false"),
         }
     }
 }
@@ -408,7 +412,6 @@ pub enum UnsupportedOpInfo<'tcx> {
     VtableForArgumentlessMethod,
     ModifiedConstantMemory,
     ModifiedStatic,
-    AssumptionNotHeld,
     TypeNotPrimitive(Ty<'tcx>),
     ReallocatedWrongMemoryKind(String, String),
     DeallocatedWrongMemoryKind(String, String),
@@ -507,8 +510,6 @@ impl fmt::Debug for UnsupportedOpInfo<'tcx> {
             ModifiedStatic =>
                 write!(f, "tried to modify a static's initial value from another static's \
                     initializer"),
-            AssumptionNotHeld =>
-                write!(f, "`assume` argument was false"),
             ReallocateNonBasePtr =>
                 write!(f, "tried to reallocate with a pointer not to the beginning of an \
                     existing object"),