diff options
| author | Ralf Jung <post@ralfj.de> | 2022-09-21 13:05:20 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-10-07 18:08:49 +0200 |
| commit | fd59d44f5880fea109fe68e31fab2486cd686fc6 (patch) | |
| tree | 3eef90caf77fefc09fc993e511f9a9b8f5470cb2 /compiler/rustc_middle/src | |
| parent | 58546803885164d488185fb9cb9fb04fcbe64e30 (diff) | |
| download | rust-fd59d44f5880fea109fe68e31fab2486cd686fc6.tar.gz rust-fd59d44f5880fea109fe68e31fab2486cd686fc6.zip | |
make const_err a hard error
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/mir/interpret/error.rs | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/compiler/rustc_middle/src/mir/interpret/error.rs b/compiler/rustc_middle/src/mir/interpret/error.rs index e4039cc7c68..b5a50cc1527 100644 --- a/compiler/rustc_middle/src/mir/interpret/error.rs +++ b/compiler/rustc_middle/src/mir/interpret/error.rs @@ -479,12 +479,7 @@ impl<T: Any> AsAny for T { } /// A trait for machine-specific errors (or other "machine stop" conditions). -pub trait MachineStopType: AsAny + fmt::Display + Send { - /// If `true`, emit a hard error instead of going through the `CONST_ERR` lint - fn is_hard_err(&self) -> bool { - false - } -} +pub trait MachineStopType: AsAny + fmt::Display + Send {} impl dyn MachineStopType { #[inline(always)] @@ -543,16 +538,4 @@ impl InterpError<'_> { | InterpError::UndefinedBehavior(UndefinedBehaviorInfo::Ub(_)) ) } - - /// Should this error be reported as a hard error, preventing compilation, or a soft error, - /// causing a deny-by-default lint? - pub fn is_hard_err(&self) -> bool { - use InterpError::*; - match *self { - MachineStop(ref err) => err.is_hard_err(), - UndefinedBehavior(_) => true, - ResourceExhaustion(ResourceExhaustionInfo::MemoryExhausted) => true, - _ => false, - } - } } |
