File tree Expand file tree Collapse file tree 3 files changed +4
-6
lines changed 
rustc_trait_selection/src/traits/error_reporting Expand file tree Collapse file tree 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> {
8484 selection_cache :  self . selection_cache . clone ( ) , 
8585 evaluation_cache :  self . evaluation_cache . clone ( ) , 
8686 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 ( ) , 
8888 tainted_by_errors :  self . tainted_by_errors . clone ( ) , 
8989 err_count_on_creation :  self . err_count_on_creation , 
9090 universe :  self . universe . clone ( ) , 
Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ pub struct InferCtxt<'tcx> {
278278/// avoid reporting the same error twice. 
279279pub  reported_trait_errors :  RefCell < FxIndexMap < Span ,  Vec < ty:: Predicate < ' tcx > > > > , 
280280
281-  pub  reported_closure_mismatch :  RefCell < FxHashSet < ( Span ,  Option < Span > ) > > , 
281+  pub  reported_signature_mismatch :  RefCell < FxHashSet < ( Span ,  Option < Span > ) > > , 
282282
283283 /// When an error occurs, we want to avoid reporting "derived" 
284284/// errors that are due to this original failure. Normally, we 
@@ -702,7 +702,7 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
702702 selection_cache :  Default :: default ( ) , 
703703 evaluation_cache :  Default :: default ( ) , 
704704 reported_trait_errors :  Default :: default ( ) , 
705-  reported_closure_mismatch :  Default :: default ( ) , 
705+  reported_signature_mismatch :  Default :: default ( ) , 
706706 tainted_by_errors :  Cell :: new ( None ) , 
707707 err_count_on_creation :  tcx. dcx ( ) . err_count ( ) , 
708708 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> {
34593459 let  found_node = found_did. and_then ( |did| self . tcx . hir ( ) . get_if_local ( did) ) ; 
34603460 let  found_span = found_did. and_then ( |did| self . tcx . hir ( ) . span_if_local ( did) ) ; 
34613461
3462-  if  self . reported_closure_mismatch . borrow ( ) . contains ( & ( span,  found_span) )  { 
3462+  if  ! self . reported_signature_mismatch . borrow_mut ( ) . insert ( ( span,  found_span) )  { 
34633463 // We check closures twice, with obligations flowing in different directions, 
34643464 // but we want to complain about them only once. 
34653465 return  None ; 
34663466 } 
34673467
3468-  self . reported_closure_mismatch . borrow_mut ( ) . insert ( ( span,  found_span) ) ; 
3469- 
34703468 let  mut  not_tupled = false ; 
34713469
34723470 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