Skip to content

Commit 287993c

Browse files
Remove machinery for halting error output
1 parent 4bbc79c commit 287993c

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

compiler/rustc_mir/src/transform/check_consts/ops.rs

-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ pub enum DiagnosticImportance {
2929

3030
/// An operation that is not *always* allowed in a const context.
3131
pub trait NonConstOp: std::fmt::Debug {
32-
const STOPS_CONST_CHECKING: bool = false;
33-
3432
/// Returns an enum indicating whether this operation is allowed within the given item.
3533
fn status_in_item(&self, _ccx: &ConstCx<'_, '_>) -> Status {
3634
Status::Forbidden

compiler/rustc_mir/src/transform/check_consts/validation.rs

-13
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ pub struct Validator<'mir, 'tcx> {
181181
/// The span of the current statement.
182182
span: Span,
183183

184-
const_checking_stopped: bool,
185-
186184
error_emitted: bool,
187185
secondary_errors: Vec<Diagnostic>,
188186
}
@@ -201,7 +199,6 @@ impl Validator<'mir, 'tcx> {
201199
span: ccx.body.span,
202200
ccx,
203201
qualifs: Default::default(),
204-
const_checking_stopped: false,
205202
error_emitted: false,
206203
secondary_errors: Vec::new(),
207204
}
@@ -289,12 +286,6 @@ impl Validator<'mir, 'tcx> {
289286
/// Emits an error at the given `span` if an expression cannot be evaluated in the current
290287
/// context.
291288
pub fn check_op_spanned<O: NonConstOp>(&mut self, op: O, span: Span) {
292-
// HACK: This is for strict equivalence with the old `qualify_min_const_fn` pass, which
293-
// only emitted one error per function. It should be removed and the test output updated.
294-
if self.const_checking_stopped {
295-
return;
296-
}
297-
298289
let gate = match op.status_in_item(self.ccx) {
299290
Status::Allowed => return,
300291

@@ -328,10 +319,6 @@ impl Validator<'mir, 'tcx> {
328319

329320
ops::DiagnosticImportance::Secondary => err.buffer(&mut self.secondary_errors),
330321
}
331-
332-
if O::STOPS_CONST_CHECKING {
333-
self.const_checking_stopped = true;
334-
}
335322
}
336323

337324
fn check_static(&mut self, def_id: DefId, span: Span) {

0 commit comments

Comments
 (0)