Skip to content

Commit 1037e75

Browse files
authored
Rollup merge of rust-lang#119898 - compiler-errors:error-reporting, r=oli-obk
Remove unused `ErrorReporting` variant from overflow handling r? oli-obk
2 parents 9696ef7 + 322694e commit 1037e75

File tree

6 files changed

+3
-16
lines changed

6 files changed

+3
-16
lines changed

compiler/rustc_middle/src/traits/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -611,9 +611,6 @@ pub enum SelectionError<'tcx> {
611611
NotConstEvaluatable(NotConstEvaluatable),
612612
/// Exceeded the recursion depth during type projection.
613613
Overflow(OverflowError),
614-
/// Signaling that an error has already been emitted, to avoid
615-
/// multiple errors being shown.
616-
ErrorReporting,
617614
/// Computing an opaque type's hidden type caused an error (e.g. a cycle error).
618615
/// We can thus not know whether the hidden type implements an auto trait, so
619616
/// we should not presume anything about it.

compiler/rustc_middle/src/traits/select.rs

-2
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ impl EvaluationResult {
302302
pub enum OverflowError {
303303
Error(ErrorGuaranteed),
304304
Canonical,
305-
ErrorReporting,
306305
}
307306

308307
impl From<ErrorGuaranteed> for OverflowError {
@@ -318,7 +317,6 @@ impl<'tcx> From<OverflowError> for SelectionError<'tcx> {
318317
match overflow_error {
319318
OverflowError::Error(e) => SelectionError::Overflow(OverflowError::Error(e)),
320319
OverflowError::Canonical => SelectionError::Overflow(OverflowError::Canonical),
321-
OverflowError::ErrorReporting => SelectionError::ErrorReporting,
322320
}
323321
}
324322
}

compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs

-3
Original file line numberDiff line numberDiff line change
@@ -947,9 +947,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
947947
Overflow(_) => {
948948
bug!("overflow should be handled before the `report_selection_error` path");
949949
}
950-
SelectionError::ErrorReporting => {
951-
bug!("ErrorReporting Overflow should not reach `report_selection_err` call")
952-
}
953950
};
954951

955952
self.note_obligation_cause(&mut err, &obligation);

compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs

-2
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,9 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
116116
r,
117117
)
118118
}
119-
OverflowError::ErrorReporting => EvaluationResult::EvaluatedToErr,
120119
OverflowError::Error(_) => EvaluationResult::EvaluatedToErr,
121120
})
122121
}
123-
Err(OverflowError::ErrorReporting) => EvaluationResult::EvaluatedToErr,
124122
Err(OverflowError::Error(_)) => EvaluationResult::EvaluatedToErr,
125123
}
126124
}

compiler/rustc_trait_selection/src/traits/select/mod.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ use super::util;
1414
use super::util::closure_trait_ref_and_return_type;
1515
use super::wf;
1616
use super::{
17-
ErrorReporting, ImplDerivedObligation, ImplDerivedObligationCause, Normalized, Obligation,
18-
ObligationCause, ObligationCauseCode, Overflow, PolyTraitObligation, PredicateObligation,
19-
Selection, SelectionError, SelectionResult, TraitQueryMode,
17+
ImplDerivedObligation, ImplDerivedObligationCause, Normalized, Obligation, ObligationCause,
18+
ObligationCauseCode, Overflow, PolyTraitObligation, PredicateObligation, Selection,
19+
SelectionError, SelectionResult, TraitQueryMode,
2020
};
2121

2222
use crate::infer::{InferCtxt, InferOk, TypeFreshener};
@@ -496,7 +496,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
496496
}
497497
Ok(_) => Ok(None),
498498
Err(OverflowError::Canonical) => Err(Overflow(OverflowError::Canonical)),
499-
Err(OverflowError::ErrorReporting) => Err(ErrorReporting),
500499
Err(OverflowError::Error(e)) => Err(Overflow(OverflowError::Error(e))),
501500
})
502501
.flat_map(Result::transpose)
@@ -1233,7 +1232,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
12331232
Ok(Some(c)) => self.evaluate_candidate(stack, &c),
12341233
Ok(None) => Ok(EvaluatedToAmbig),
12351234
Err(Overflow(OverflowError::Canonical)) => Err(OverflowError::Canonical),
1236-
Err(ErrorReporting) => Err(OverflowError::ErrorReporting),
12371235
Err(..) => Ok(EvaluatedToErr),
12381236
}
12391237
}

src/librustdoc/clean/blanket_impl.rs

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
8181
match infcx.evaluate_obligation(&obligation) {
8282
Ok(eval_result) if eval_result.may_apply() => {}
8383
Err(traits::OverflowError::Canonical) => {}
84-
Err(traits::OverflowError::ErrorReporting) => {}
8584
_ => continue 'blanket_impls,
8685
}
8786
}

0 commit comments

Comments
 (0)