Skip to content

Commit

Permalink
Rollup merge of #70286 - RalfJung:no-experiments, r=petrochenkov
Browse files Browse the repository at this point in the history
Miri error type: remove UbExperimental variant

In rust-lang/miri#1250, I will move Miri away from that variant, and use a custom `MachineStop` exception instead.
  • Loading branch information
Centril authored Mar 23, 2020
2 parents bb85308 + 29df39b commit 07e1043
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/librustc/mir/interpret/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,6 @@ impl fmt::Debug for InvalidProgramInfo<'_> {
pub enum UndefinedBehaviorInfo {
/// 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,
/// An enum discriminant was set to a value which was outside the range of valid values.
Expand Down Expand Up @@ -381,7 +379,7 @@ impl fmt::Debug for UndefinedBehaviorInfo {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
use UndefinedBehaviorInfo::*;
match self {
Ub(msg) | UbExperimental(msg) => write!(f, "{}", msg),
Ub(msg) => write!(f, "{}", msg),
Unreachable => write!(f, "entering unreachable code"),
InvalidDiscriminant(val) => write!(f, "encountering invalid enum discriminant {}", val),
BoundsCheckFailed { ref len, ref index } => write!(
Expand Down Expand Up @@ -563,8 +561,7 @@ impl InterpError<'_> {
InterpError::MachineStop(_)
| InterpError::Unsupported(UnsupportedOpInfo::Unsupported(_))
| InterpError::UndefinedBehavior(UndefinedBehaviorInfo::ValidationFailure(_))
| InterpError::UndefinedBehavior(UndefinedBehaviorInfo::Ub(_))
| InterpError::UndefinedBehavior(UndefinedBehaviorInfo::UbExperimental(_)) => true,
| InterpError::UndefinedBehavior(UndefinedBehaviorInfo::Ub(_)) => true,
_ => false,
}
}
Expand Down

0 comments on commit 07e1043

Please sign in to comment.