add variant for experimental UB (like Stacked Borrows)

This commit is contained in:
Ralf Jung 2019-08-03 20:36:05 +02:00
parent fe08d9e2d2
commit 89a370db0f

View File

@ -342,8 +342,10 @@ impl fmt::Debug for InvalidProgramInfo<'tcx> {
#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)]
pub enum UndefinedBehaviorInfo {
/// Handle cases which for which we do not have a fixed variant.
/// Free-form case. Only for errors that are never caught!
Ub(String),
/// Free-form case for experimental UB. Only for errors that are never caught!
UbExperimental(String),
/// Unreachable code was executed.
Unreachable,
}
@ -352,7 +354,7 @@ impl fmt::Debug for UndefinedBehaviorInfo {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
use UndefinedBehaviorInfo::*;
match self {
Ub(ref msg) =>
Ub(msg) | UbExperimental(msg) =>
write!(f, "{}", msg),
Unreachable =>
write!(f, "entered unreachable code"),
@ -362,7 +364,7 @@ impl fmt::Debug for UndefinedBehaviorInfo {
#[derive(Clone, RustcEncodable, RustcDecodable, HashStable)]
pub enum UnsupportedOpInfo<'tcx> {
/// Handle cases which for which we do not have a fixed variant.
/// Free-form case. Only for errors that are never caught!
Unsupported(String),
// -- Everything below is not classified yet --