Remove machinery for halting error output
This commit is contained in:
parent
4bbc79c5ae
commit
287993c961
2 changed files with 0 additions and 15 deletions
|
@ -29,8 +29,6 @@ pub enum DiagnosticImportance {
|
||||||
|
|
||||||
/// An operation that is not *always* allowed in a const context.
|
/// An operation that is not *always* allowed in a const context.
|
||||||
pub trait NonConstOp: std::fmt::Debug {
|
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.
|
/// Returns an enum indicating whether this operation is allowed within the given item.
|
||||||
fn status_in_item(&self, _ccx: &ConstCx<'_, '_>) -> Status {
|
fn status_in_item(&self, _ccx: &ConstCx<'_, '_>) -> Status {
|
||||||
Status::Forbidden
|
Status::Forbidden
|
||||||
|
|
|
@ -181,8 +181,6 @@ pub struct Validator<'mir, 'tcx> {
|
||||||
/// The span of the current statement.
|
/// The span of the current statement.
|
||||||
span: Span,
|
span: Span,
|
||||||
|
|
||||||
const_checking_stopped: bool,
|
|
||||||
|
|
||||||
error_emitted: bool,
|
error_emitted: bool,
|
||||||
secondary_errors: Vec<Diagnostic>,
|
secondary_errors: Vec<Diagnostic>,
|
||||||
}
|
}
|
||||||
|
@ -201,7 +199,6 @@ impl Validator<'mir, 'tcx> {
|
||||||
span: ccx.body.span,
|
span: ccx.body.span,
|
||||||
ccx,
|
ccx,
|
||||||
qualifs: Default::default(),
|
qualifs: Default::default(),
|
||||||
const_checking_stopped: false,
|
|
||||||
error_emitted: false,
|
error_emitted: false,
|
||||||
secondary_errors: Vec::new(),
|
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
|
/// Emits an error at the given `span` if an expression cannot be evaluated in the current
|
||||||
/// context.
|
/// context.
|
||||||
pub fn check_op_spanned<O: NonConstOp>(&mut self, op: O, span: Span) {
|
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) {
|
let gate = match op.status_in_item(self.ccx) {
|
||||||
Status::Allowed => return,
|
Status::Allowed => return,
|
||||||
|
|
||||||
|
@ -328,10 +319,6 @@ impl Validator<'mir, 'tcx> {
|
||||||
|
|
||||||
ops::DiagnosticImportance::Secondary => err.buffer(&mut self.secondary_errors),
|
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) {
|
fn check_static(&mut self, def_id: DefId, span: Span) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue