about summary refs log tree commit diff
path: root/src/librustc
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-02-09 16:51:36 +0100
committerRalf Jung <post@ralfj.de>2020-02-13 10:56:38 +0100
commitf3ff02bdd85255ad75bae40aad53e520e37a8e4a (patch)
treefb244e42a7fcbf5ee2644cd0c9d24d008c6e36ae /src/librustc
parentc5709ff6b779d88c0d432f6ed8731fde6e55c090 (diff)
downloadrust-f3ff02bdd85255ad75bae40aad53e520e37a8e4a.tar.gz
rust-f3ff02bdd85255ad75bae40aad53e520e37a8e4a.zip
remove PanicInfo::Panic variant that MIR does not use or need
Diffstat (limited to 'src/librustc')
-rw-r--r--src/librustc/mir/interpret/error.rs9
-rw-r--r--src/librustc/mir/mod.rs6
-rw-r--r--src/librustc/mir/visit.rs2
3 files changed, 5 insertions, 12 deletions
diff --git a/src/librustc/mir/interpret/error.rs b/src/librustc/mir/interpret/error.rs
index e819dfbacd8..da8c0bf266f 100644
--- a/src/librustc/mir/interpret/error.rs
+++ b/src/librustc/mir/interpret/error.rs
@@ -11,7 +11,6 @@ use hir::GeneratorKind;
 use rustc_errors::{struct_span_err, DiagnosticBuilder};
 use rustc_hir as hir;
 use rustc_macros::HashStable;
-use rustc_span::symbol::Symbol;
 use rustc_span::{Pos, Span};
 use rustc_target::spec::abi::Abi;
 use std::{any::Any, env, fmt};
@@ -272,7 +271,6 @@ impl<'tcx> From<InterpError<'tcx>> for InterpErrorInfo<'tcx> {
 /// FIXME: this is not actually an InterpError, and should probably be moved to another module.
 #[derive(Clone, RustcEncodable, RustcDecodable, HashStable, PartialEq)]
 pub enum PanicInfo<O> {
-    Panic { msg: Symbol, line: u32, col: u32, file: Symbol },
     BoundsCheck { len: O, index: O },
     Overflow(mir::BinOp),
     OverflowNeg,
@@ -288,7 +286,7 @@ pub type AssertMessage<'tcx> = PanicInfo<mir::Operand<'tcx>>;
 impl<O> PanicInfo<O> {
     /// Getting a description does not require `O` to be printable, and does not
     /// require allocation.
-    /// The caller is expected to handle `Panic` and `BoundsCheck` separately.
+    /// The caller is expected to handle `BoundsCheck` separately.
     pub fn description(&self) -> &'static str {
         use PanicInfo::*;
         match self {
@@ -307,7 +305,7 @@ impl<O> PanicInfo<O> {
             ResumedAfterReturn(GeneratorKind::Async(_)) => "`async fn` resumed after completion",
             ResumedAfterPanic(GeneratorKind::Gen) => "generator resumed after panicking",
             ResumedAfterPanic(GeneratorKind::Async(_)) => "`async fn` resumed after panicking",
-            Panic { .. } | BoundsCheck { .. } => bug!("Unexpected PanicInfo"),
+            BoundsCheck { .. } => bug!("Unexpected PanicInfo"),
         }
     }
 }
@@ -316,9 +314,6 @@ impl<O: fmt::Debug> fmt::Debug for PanicInfo<O> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         use PanicInfo::*;
         match self {
-            Panic { ref msg, line, col, ref file } => {
-                write!(f, "the evaluated program panicked at '{}', {}:{}:{}", msg, file, line, col)
-            }
             BoundsCheck { ref len, ref index } => {
                 write!(f, "index out of bounds: the len is {:?} but the index is {:?}", len, index)
             }
diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs
index f6c7174649f..05011241557 100644
--- a/src/librustc/mir/mod.rs
+++ b/src/librustc/mir/mod.rs
@@ -2671,8 +2671,7 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> {
                     BoundsCheck { ref len, ref index } => {
                         BoundsCheck { len: len.fold_with(folder), index: index.fold_with(folder) }
                     }
-                    Panic { .. }
-                    | Overflow(_)
+                    Overflow(_)
                     | OverflowNeg
                     | DivisionByZero
                     | RemainderByZero
@@ -2721,8 +2720,7 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> {
                         BoundsCheck { ref len, ref index } => {
                             len.visit_with(visitor) || index.visit_with(visitor)
                         }
-                        Panic { .. }
-                        | Overflow(_)
+                        Overflow(_)
                         | OverflowNeg
                         | DivisionByZero
                         | RemainderByZero
diff --git a/src/librustc/mir/visit.rs b/src/librustc/mir/visit.rs
index 2f094516a35..555beaa8ca7 100644
--- a/src/librustc/mir/visit.rs
+++ b/src/librustc/mir/visit.rs
@@ -539,7 +539,7 @@ macro_rules! make_mir_visitor {
                         self.visit_operand(len, location);
                         self.visit_operand(index, location);
                     }
-                    Panic { .. } | Overflow(_) | OverflowNeg | DivisionByZero | RemainderByZero |
+                    Overflow(_) | OverflowNeg | DivisionByZero | RemainderByZero |
                     ResumedAfterReturn(_) | ResumedAfterPanic(_) => {
                         // Nothing to visit
                     }