@@ -15,34 +15,34 @@ use rustc_middle::query::erase::erase_val;
1515use rustc_middle:: ty:: layout:: { LayoutError , TyAndLayout } ;
1616use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
1717use rustc_middle:: { bug, span_bug} ;
18- use rustc_span:: def_id:: LocalDefId ;
18+ use rustc_span:: def_id:: { DefId , LocalDefId } ;
1919use rustc_span:: { ErrorGuaranteed , Span } ;
2020
2121use crate :: job:: report_cycle;
2222
2323pub ( crate ) fn specialize_query_vtables < ' tcx > ( vtables : & mut QueryVTables < ' tcx > ) {
2424 vtables. type_of . value_from_cycle_error =
25- |tcx, _, guar| erase_val ( ty:: EarlyBinder :: bind ( Ty :: new_error ( tcx, guar) ) ) ;
25+ |tcx, _, _ , guar| erase_val ( ty:: EarlyBinder :: bind ( Ty :: new_error ( tcx, guar) ) ) ;
2626
2727 vtables. type_of_opaque_hir_typeck . value_from_cycle_error =
28- |tcx, _, guar| erase_val ( ty:: EarlyBinder :: bind ( Ty :: new_error ( tcx, guar) ) ) ;
28+ |tcx, _, _ , guar| erase_val ( ty:: EarlyBinder :: bind ( Ty :: new_error ( tcx, guar) ) ) ;
2929
3030 vtables. erase_and_anonymize_regions_ty . value_from_cycle_error =
31- |tcx, _, guar| erase_val ( Ty :: new_error ( tcx, guar) ) ;
31+ |tcx, _, _ , guar| erase_val ( Ty :: new_error ( tcx, guar) ) ;
3232
33- vtables. fn_sig . value_from_cycle_error = |tcx, cycle , guar| erase_val ( fn_sig ( tcx, cycle , guar) ) ;
33+ vtables. fn_sig . value_from_cycle_error = |tcx, key , _ , guar| erase_val ( fn_sig ( tcx, key , guar) ) ;
3434
3535 vtables. check_representability . value_from_cycle_error =
36- |tcx, cycle, guar| check_representability ( tcx, cycle, guar) ;
36+ |tcx, _ , cycle, guar| check_representability ( tcx, cycle, guar) ;
3737
3838 vtables. check_representability_adt_ty . value_from_cycle_error =
39- |tcx, cycle, guar| check_representability ( tcx, cycle, guar) ;
39+ |tcx, _ , cycle, guar| check_representability ( tcx, cycle, guar) ;
4040
4141 vtables. variances_of . value_from_cycle_error =
42- |tcx, cycle, guar| erase_val ( variances_of ( tcx, cycle, guar) ) ;
42+ |tcx, _ , cycle, guar| erase_val ( variances_of ( tcx, cycle, guar) ) ;
4343
4444 vtables. layout_of . value_from_cycle_error =
45- |tcx, cycle, guar| erase_val ( layout_of ( tcx, cycle, guar) ) ;
45+ |tcx, _ , cycle, guar| erase_val ( layout_of ( tcx, cycle, guar) ) ;
4646}
4747
4848pub ( crate ) fn default < ' tcx > ( tcx : TyCtxt < ' tcx > , cycle_error : CycleError , query_name : & str ) -> ! {
@@ -57,15 +57,12 @@ pub(crate) fn default<'tcx>(tcx: TyCtxt<'tcx>, cycle_error: CycleError, query_na
5757
5858fn fn_sig < ' tcx > (
5959 tcx : TyCtxt < ' tcx > ,
60- cycle_error : CycleError ,
60+ def_id : DefId ,
6161 guar : ErrorGuaranteed ,
6262) -> ty:: EarlyBinder < ' tcx , ty:: PolyFnSig < ' tcx > > {
6363 let err = Ty :: new_error ( tcx, guar) ;
6464
65- let arity = if let Some ( info) = cycle_error. cycle . get ( 0 )
66- && info. frame . dep_kind == DepKind :: fn_sig
67- && let Some ( def_id) = info. frame . def_id
68- && let Some ( node) = tcx. hir_get_if_local ( def_id)
65+ let arity = if let Some ( node) = tcx. hir_get_if_local ( def_id)
6966 && let Some ( sig) = node. fn_sig ( )
7067 {
7168 sig. decl . inputs . len ( )
0 commit comments