Remove machinery for halting error output

This commit is contained in:
Dylan MacKenzie 2020-09-29 18:58:45 -07:00
parent 4bbc79c5ae
commit 287993c961
2 changed files with 0 additions and 15 deletions

View File

@ -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

View File

@ -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<Diagnostic>,
}
@ -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<O: NonConstOp>(&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) {