1
Fork 0

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