diff --git a/compiler/rustc_mir/src/transform/check_consts/ops.rs b/compiler/rustc_mir/src/transform/check_consts/ops.rs index 6d1125e352e..bbfe92ef141 100644 --- a/compiler/rustc_mir/src/transform/check_consts/ops.rs +++ b/compiler/rustc_mir/src/transform/check_consts/ops.rs @@ -29,8 +29,6 @@ pub enum DiagnosticImportance { /// An operation that is not *always* allowed in a const context. pub trait NonConstOp: std::fmt::Debug { - const STOPS_CONST_CHECKING: bool = false; - /// Returns an enum indicating whether this operation is allowed within the given item. fn status_in_item(&self, _ccx: &ConstCx<'_, '_>) -> Status { Status::Forbidden diff --git a/compiler/rustc_mir/src/transform/check_consts/validation.rs b/compiler/rustc_mir/src/transform/check_consts/validation.rs index a2dff46982b..7588c01ed3c 100644 --- a/compiler/rustc_mir/src/transform/check_consts/validation.rs +++ b/compiler/rustc_mir/src/transform/check_consts/validation.rs @@ -181,8 +181,6 @@ pub struct Validator<'mir, 'tcx> { /// The span of the current statement. span: Span, - const_checking_stopped: bool, - error_emitted: bool, secondary_errors: Vec, } @@ -201,7 +199,6 @@ impl Validator<'mir, 'tcx> { span: ccx.body.span, ccx, qualifs: Default::default(), - const_checking_stopped: false, error_emitted: false, secondary_errors: Vec::new(), } @@ -289,12 +286,6 @@ impl Validator<'mir, 'tcx> { /// Emits an error at the given `span` if an expression cannot be evaluated in the current /// context. pub fn check_op_spanned(&mut self, op: O, span: Span) { - // HACK: This is for strict equivalence with the old `qualify_min_const_fn` pass, which - // only emitted one error per function. It should be removed and the test output updated. - if self.const_checking_stopped { - return; - } - let gate = match op.status_in_item(self.ccx) { Status::Allowed => return, @@ -328,10 +319,6 @@ impl Validator<'mir, 'tcx> { ops::DiagnosticImportance::Secondary => err.buffer(&mut self.secondary_errors), } - - if O::STOPS_CONST_CHECKING { - self.const_checking_stopped = true; - } } fn check_static(&mut self, def_id: DefId, span: Span) {