File tree 3 files changed +4
-6
lines changed
rustc_trait_selection/src/traits/error_reporting
3 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ impl<'tcx> InferCtxt<'tcx> {
84
84
selection_cache : self . selection_cache . clone ( ) ,
85
85
evaluation_cache : self . evaluation_cache . clone ( ) ,
86
86
reported_trait_errors : self . reported_trait_errors . clone ( ) ,
87
- reported_closure_mismatch : self . reported_closure_mismatch . clone ( ) ,
87
+ reported_signature_mismatch : self . reported_signature_mismatch . clone ( ) ,
88
88
tainted_by_errors : self . tainted_by_errors . clone ( ) ,
89
89
err_count_on_creation : self . err_count_on_creation ,
90
90
universe : self . universe . clone ( ) ,
Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ pub struct InferCtxt<'tcx> {
278
278
/// avoid reporting the same error twice.
279
279
pub reported_trait_errors : RefCell < FxIndexMap < Span , Vec < ty:: Predicate < ' tcx > > > > ,
280
280
281
- pub reported_closure_mismatch : RefCell < FxHashSet < ( Span , Option < Span > ) > > ,
281
+ pub reported_signature_mismatch : RefCell < FxHashSet < ( Span , Option < Span > ) > > ,
282
282
283
283
/// When an error occurs, we want to avoid reporting "derived"
284
284
/// errors that are due to this original failure. Normally, we
@@ -702,7 +702,7 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
702
702
selection_cache : Default :: default ( ) ,
703
703
evaluation_cache : Default :: default ( ) ,
704
704
reported_trait_errors : Default :: default ( ) ,
705
- reported_closure_mismatch : Default :: default ( ) ,
705
+ reported_signature_mismatch : Default :: default ( ) ,
706
706
tainted_by_errors : Cell :: new ( None ) ,
707
707
err_count_on_creation : tcx. dcx ( ) . err_count ( ) ,
708
708
universe : Cell :: new ( ty:: UniverseIndex :: ROOT ) ,
Original file line number Diff line number Diff line change @@ -3459,14 +3459,12 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
3459
3459
let found_node = found_did. and_then ( |did| self . tcx . hir ( ) . get_if_local ( did) ) ;
3460
3460
let found_span = found_did. and_then ( |did| self . tcx . hir ( ) . span_if_local ( did) ) ;
3461
3461
3462
- if self . reported_closure_mismatch . borrow ( ) . contains ( & ( span, found_span) ) {
3462
+ if ! self . reported_signature_mismatch . borrow_mut ( ) . insert ( ( span, found_span) ) {
3463
3463
// We check closures twice, with obligations flowing in different directions,
3464
3464
// but we want to complain about them only once.
3465
3465
return None ;
3466
3466
}
3467
3467
3468
- self . reported_closure_mismatch . borrow_mut ( ) . insert ( ( span, found_span) ) ;
3469
-
3470
3468
let mut not_tupled = false ;
3471
3469
3472
3470
let found = match found_trait_ref. skip_binder ( ) . args . type_at ( 1 ) . kind ( ) {
You can’t perform that action at this time.
0 commit comments