@@ -279,27 +279,14 @@ pub struct InferCtxt<'tcx> {
279
279
pub reported_signature_mismatch : RefCell < FxHashSet < ( Span , Option < Span > ) > > ,
280
280
281
281
/// When an error occurs, we want to avoid reporting "derived"
282
- /// errors that are due to this original failure. Normally, we
283
- /// handle this with the `err_count_on_creation` count, which
284
- /// basically just tracks how many errors were reported when we
285
- /// started type-checking a fn and checks to see if any new errors
286
- /// have been reported since then. Not great, but it works.
287
- ///
288
- /// However, when errors originated in other passes -- notably
289
- /// resolve -- this heuristic breaks down. Therefore, we have this
290
- /// auxiliary flag that one can set whenever one creates a
291
- /// type-error that is due to an error in a prior pass.
282
+ /// errors that are due to this original failure. We have this
283
+ /// flag that one can set whenever one creates a type-error that
284
+ /// is due to an error in a prior pass.
292
285
///
293
286
/// Don't read this flag directly, call `is_tainted_by_errors()`
294
287
/// and `set_tainted_by_errors()`.
295
288
tainted_by_errors : Cell < Option < ErrorGuaranteed > > ,
296
289
297
- /// Track how many errors were reported when this infcx is created.
298
- /// If the number of errors increases, that's also a sign (like
299
- /// `tainted_by_errors`) to avoid reporting certain kinds of errors.
300
- // FIXME(matthewjasper) Merge into `tainted_by_errors`
301
- err_count_on_creation : usize ,
302
-
303
290
/// What is the innermost universe we have created? Starts out as
304
291
/// `UniverseIndex::root()` but grows from there as we enter
305
292
/// universal quantifiers.
@@ -656,7 +643,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
656
643
reported_trait_errors : Default :: default ( ) ,
657
644
reported_signature_mismatch : Default :: default ( ) ,
658
645
tainted_by_errors : Cell :: new ( None ) ,
659
- err_count_on_creation : tcx. dcx ( ) . err_count_excluding_lint_errs ( ) ,
660
646
universe : Cell :: new ( ty:: UniverseIndex :: ROOT ) ,
661
647
intercrate,
662
648
next_trait_solver,
0 commit comments