Make panic/assert calls in rustc compatible with Rust 2021.

This commit is contained in:
Mara Bos
2021-02-02 00:17:51 +01:00
parent a616f8267e
commit 34d5ac25c5
3 changed files with 5 additions and 5 deletions

View File

@@ -3,7 +3,7 @@
use crate::ty::{tls, TyCtxt};
use rustc_span::{MultiSpan, Span};
use std::fmt;
use std::panic::Location;
use std::panic::{panic_any, Location};
#[cold]
#[inline(never)]
@@ -32,7 +32,7 @@ fn opt_span_bug_fmt<S: Into<MultiSpan>>(
match (tcx, span) {
(Some(tcx), Some(span)) => tcx.sess.diagnostic().span_bug(span, &msg),
(Some(tcx), None) => tcx.sess.diagnostic().bug(&msg),
(None, _) => panic!(msg),
(None, _) => panic_any(msg),
}
});
unreachable!();