]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir/src/const_eval/error.rs
abort() now takes a msg parameter
[rust.git] / compiler / rustc_mir / src / const_eval / error.rs
index 39358e03e7590932fec370cb1fb55957f7b8232b..345a3d7e79bc2ec5039abbad13e62a4e1435c33f 100644 (file)
@@ -20,6 +20,7 @@ pub enum ConstEvalErrKind {
     ModifiedGlobal,
     AssertFailure(AssertKind<ConstInt>),
     Panic { msg: Symbol, line: u32, col: u32, file: Symbol },
+    Abort(String),
 }
 
 // The errors become `MachineStop` with plain strings when being raised.
@@ -46,6 +47,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
             Panic { msg, line, col, file } => {
                 write!(f, "the evaluated program panicked at '{}', {}:{}:{}", msg, file, line, col)
             }
+            Abort(ref msg) => write!(f, "{}", msg)
         }
     }
 }