@@ -16,37 +16,38 @@ use rustc_middle::query::plumbing::CyclePlaceholder;
1616use rustc_middle:: ty:: layout:: { LayoutError , TyAndLayout } ;
1717use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
1818use rustc_middle:: { bug, span_bug} ;
19- use rustc_span:: def_id:: LocalDefId ;
19+ use rustc_span:: def_id:: { DefId , LocalDefId } ;
2020use rustc_span:: { ErrorGuaranteed , Span } ;
2121
2222use crate :: job:: report_cycle;
2323
2424pub ( crate ) fn specialize_query_vtables < ' tcx > ( vtables : & mut QueryVTables < ' tcx > ) {
2525 vtables. type_of . value_from_cycle_error =
26- |tcx, _, guar| erase_val ( ty:: EarlyBinder :: bind ( Ty :: new_error ( tcx, guar) ) ) ;
26+ |tcx, _, _ , guar| erase_val ( ty:: EarlyBinder :: bind ( Ty :: new_error ( tcx, guar) ) ) ;
2727
2828 vtables. type_of_opaque_hir_typeck . value_from_cycle_error =
29- |tcx, _, guar| erase_val ( ty:: EarlyBinder :: bind ( Ty :: new_error ( tcx, guar) ) ) ;
29+ |tcx, _, _ , guar| erase_val ( ty:: EarlyBinder :: bind ( Ty :: new_error ( tcx, guar) ) ) ;
3030
3131 vtables. erase_and_anonymize_regions_ty . value_from_cycle_error =
32- |tcx, _, guar| erase_val ( Ty :: new_error ( tcx, guar) ) ;
32+ |tcx, _, _ , guar| erase_val ( Ty :: new_error ( tcx, guar) ) ;
3333
3434 vtables. type_of_opaque . value_from_cycle_error =
35- |_, _, guar| erase_val ( Err ( CyclePlaceholder ( guar) ) ) ;
35+ |_, _, _ , guar| erase_val ( Err ( CyclePlaceholder ( guar) ) ) ;
3636
37- vtables. fn_sig . value_from_cycle_error = |tcx, cycle, guar| erase_val ( fn_sig ( tcx, cycle, guar) ) ;
37+ vtables. fn_sig . value_from_cycle_error =
38+ |tcx, key, _cycle, guar| erase_val ( fn_sig ( tcx, key, guar) ) ;
3839
3940 vtables. check_representability . value_from_cycle_error =
40- |tcx, cycle, guar| check_representability ( tcx, cycle, guar) ;
41+ |tcx, _key , cycle, guar| check_representability ( tcx, cycle, guar) ;
4142
4243 vtables. check_representability_adt_ty . value_from_cycle_error =
43- |tcx, cycle, guar| check_representability ( tcx, cycle, guar) ;
44+ |tcx, _key , cycle, guar| check_representability ( tcx, cycle, guar) ;
4445
4546 vtables. variances_of . value_from_cycle_error =
46- |tcx, cycle, guar| erase_val ( variances_of ( tcx, cycle, guar) ) ;
47+ |tcx, _key , cycle, guar| erase_val ( variances_of ( tcx, cycle, guar) ) ;
4748
4849 vtables. layout_of . value_from_cycle_error =
49- |tcx, cycle, guar| erase_val ( layout_of ( tcx, cycle, guar) ) ;
50+ |tcx, _key , cycle, guar| erase_val ( layout_of ( tcx, cycle, guar) ) ;
5051}
5152
5253pub ( crate ) fn default < ' tcx > ( tcx : TyCtxt < ' tcx > , cycle_error : CycleError , query_name : & str ) -> ! {
@@ -61,15 +62,12 @@ pub(crate) fn default<'tcx>(tcx: TyCtxt<'tcx>, cycle_error: CycleError, query_na
6162
6263fn fn_sig < ' tcx > (
6364 tcx : TyCtxt < ' tcx > ,
64- cycle_error : CycleError ,
65+ def_id : DefId ,
6566 guar : ErrorGuaranteed ,
6667) -> ty:: EarlyBinder < ' tcx , ty:: PolyFnSig < ' tcx > > {
6768 let err = Ty :: new_error ( tcx, guar) ;
6869
69- let arity = if let Some ( info) = cycle_error. cycle . get ( 0 )
70- && info. frame . dep_kind == DepKind :: fn_sig
71- && let Some ( def_id) = info. frame . def_id
72- && let Some ( node) = tcx. hir_get_if_local ( def_id)
70+ let arity = if let Some ( node) = tcx. hir_get_if_local ( def_id)
7371 && let Some ( sig) = node. fn_sig ( )
7472 {
7573 sig. decl . inputs . len ( )
0 commit comments