diff options
| author | Ralf Jung <post@ralfj.de> | 2019-08-03 20:36:05 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2019-08-03 20:36:05 +0200 |
| commit | 89a370db0f6caef02b34cd42a151ef21613a8b44 (patch) | |
| tree | 67b1d0dc6a0ce0c95bb9a82fc9ec0268dff22511 | |
| parent | fe08d9e2d270d97be5a33a2d505d4a9ea56d258a (diff) | |
add variant for experimental UB (like Stacked Borrows)
| -rw-r--r-- | src/librustc/mir/interpret/error.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/librustc/mir/interpret/error.rs b/src/librustc/mir/interpret/error.rs index 6a8cd9b46ae..5d60108f37c 100644 --- a/src/librustc/mir/interpret/error.rs +++ b/src/librustc/mir/interpret/error.rs @@ -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 -- |
