@@ -9,7 +9,7 @@ use rustc_errors::{Applicability, Diag, MultiSpan, pluralize, struct_span_code_e
99use rustc_hir as hir;
1010use rustc_hir:: def:: { DefKind , Res } ;
1111use rustc_middle:: dep_graph:: DepKind ;
12- use rustc_middle:: queries:: QueryVTables ;
12+ use rustc_middle:: queries:: { QueryVTables , TaggedQueryKey } ;
1313use rustc_middle:: query:: CycleError ;
1414use rustc_middle:: query:: erase:: erase_val;
1515use rustc_middle:: ty:: layout:: LayoutError ;
@@ -91,9 +91,9 @@ fn check_representability<'tcx>(tcx: TyCtxt<'tcx>, cycle_error: CycleError<'tcx>
9191 }
9292 }
9393 for info in & cycle_error. cycle {
94- if info . frame . dep_kind == DepKind :: check_representability_adt_ty
95- && let Some ( def_id ) = info . frame . def_id_for_ty_in_cycle
96- && let Some ( def_id) = def_id . as_local ( )
94+ if let TaggedQueryKey :: check_representability_adt_ty( key ) = info . frame . tagged_key
95+ && let Some ( adt ) = key . ty_adt_def ( )
96+ && let Some ( def_id) = adt . did ( ) . as_local ( )
9797 && !item_and_field_ids. iter ( ) . any ( |& ( id, _) | id == def_id)
9898 {
9999 representable_ids. insert ( def_id) ;
@@ -154,8 +154,8 @@ fn layout_of<'tcx>(
154154 let diag = search_for_cycle_permutation (
155155 & cycle_error. cycle ,
156156 |cycle| {
157- if cycle[ 0 ] . frame . dep_kind == DepKind :: layout_of
158- && let Some ( def_id) = cycle [ 0 ] . frame . def_id_for_ty_in_cycle
157+ if let TaggedQueryKey :: layout_of ( key ) = cycle[ 0 ] . frame . tagged_key
158+ && let ty :: Coroutine ( def_id, _ ) = key . value . kind ( )
159159 && let Some ( def_id) = def_id. as_local ( )
160160 && let def_kind = tcx. def_kind ( def_id)
161161 && matches ! ( def_kind, DefKind :: Closure )
@@ -179,10 +179,10 @@ fn layout_of<'tcx>(
179179 tcx. def_kind_descr( def_kind, def_id. to_def_id( ) ) ,
180180 ) ;
181181 for ( i, info) in cycle. iter ( ) . enumerate ( ) {
182- if info. frame . dep_kind != DepKind :: layout_of {
182+ let TaggedQueryKey :: layout_of ( frame_key ) = info. frame . tagged_key else {
183183 continue ;
184- }
185- let Some ( frame_def_id) = info . frame . def_id_for_ty_in_cycle else {
184+ } ;
185+ let & ty :: Coroutine ( frame_def_id, _ ) = frame_key . value . kind ( ) else {
186186 continue ;
187187 } ;
188188 let Some ( frame_coroutine_kind) = tcx. coroutine_kind ( frame_def_id) else {
0 commit comments