File tree Expand file tree Collapse file tree
compiler/rustc_query_impl/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,25 +88,24 @@ pub(crate) fn find_cycle_in_stack<'tcx>(
8888 panic ! ( "did not find a cycle" )
8989}
9090
91+ /// Finds the job closest to the root with a `DepKind` matching the `DepKind` of `id`.
9192#[ cold]
9293#[ inline( never) ]
9394pub ( crate ) fn find_dep_kind_root < ' tcx > (
9495 id : QueryJobId ,
9596 job_map : QueryJobMap < ' tcx > ,
9697) -> ( QueryJobInfo < ' tcx > , usize ) {
9798 let mut depth = 1 ;
98- let info = & job_map. map [ & id] ;
99+ let mut info = & job_map. map [ & id] ;
99100 let dep_kind = info. frame . dep_kind ;
100- let mut current_id = info. job . parent ;
101101 let mut last_layout = ( info. clone ( ) , depth) ;
102102
103- while let Some ( id) = current_id {
104- let info = & job_map. map [ & id] ;
103+ while let Some ( id) = info . job . parent {
104+ info = & job_map. map [ & id] ;
105105 if info. frame . dep_kind == dep_kind {
106106 depth += 1 ;
107107 last_layout = ( info. clone ( ) , depth) ;
108108 }
109- current_id = info. job . parent ;
110109 }
111110 last_layout
112111}
You can’t perform that action at this time.
0 commit comments