@@ -24,6 +24,7 @@ use util::nodemap::NodeSet;
2424use rustc_data_structures:: indexed_vec:: IndexVec ;
2525use std:: cell:: { RefCell , RefMut } ;
2626use std:: mem;
27+ use std:: collections:: BTreeMap ;
2728use std:: ops:: Deref ;
2829use std:: rc:: Rc ;
2930use syntax_pos:: { Span , DUMMY_SP } ;
@@ -291,10 +292,30 @@ impl<'tcx> QueryDescription for queries::def_span<'tcx> {
291292 }
292293}
293294
295+ impl < ' tcx > QueryDescription for queries:: item_body_nested_bodies < ' tcx > {
296+ fn describe ( tcx : TyCtxt , def_id : DefId ) -> String {
297+ format ! ( "nested item bodies of `{}`" , tcx. item_path_str( def_id) )
298+ }
299+ }
300+
301+ impl < ' tcx > QueryDescription for queries:: const_is_rvalue_promotable_to_static < ' tcx > {
302+ fn describe ( tcx : TyCtxt , def_id : DefId ) -> String {
303+ format ! ( "const checking if rvalue is promotable to static `{}`" ,
304+ tcx. item_path_str( def_id) )
305+ }
306+ }
307+
308+ impl < ' tcx > QueryDescription for queries:: is_item_mir_available < ' tcx > {
309+ fn describe ( tcx : TyCtxt , def_id : DefId ) -> String {
310+ format ! ( "checking if item is mir available: `{}`" ,
311+ tcx. item_path_str( def_id) )
312+ }
313+ }
314+
294315macro_rules! define_maps {
295316 ( <$tcx: tt>
296317 $( $( #[ $attr: meta] ) *
297- [ $( $pub: tt) * ] $name: ident: $node: ident( $K: ty) -> $V: ty) , * ) => {
318+ [ $( $pub: tt) * ] $name: ident: $node: ident( $K: ty) -> $V: ty, ) * ) => {
298319 pub struct Maps <$tcx> {
299320 providers: IndexVec <CrateNum , Providers <$tcx>>,
300321 query_stack: RefCell <Vec <( Span , Query <$tcx>) >>,
@@ -577,7 +598,11 @@ define_maps! { <'tcx>
577598 [ ] symbol_name: symbol_name_dep_node( ty:: Instance <' tcx>) -> ty:: SymbolName ,
578599
579600 [ ] describe_def: DescribeDef ( DefId ) -> Option <Def >,
580- [ ] def_span: DefSpan ( DefId ) -> Span
601+ [ ] def_span: DefSpan ( DefId ) -> Span ,
602+
603+ [ ] item_body_nested_bodies: metadata_dep_node( DefId ) -> Rc <BTreeMap <hir:: BodyId , hir:: Body >>,
604+ [ ] const_is_rvalue_promotable_to_static: metadata_dep_node( DefId ) -> bool ,
605+ [ ] is_item_mir_available: metadata_dep_node( DefId ) -> bool ,
581606}
582607
583608fn coherent_trait_dep_node ( ( _, def_id) : ( CrateNum , DefId ) ) -> DepNode < DefId > {
@@ -592,6 +617,10 @@ fn reachability_dep_node(_: CrateNum) -> DepNode<DefId> {
592617 DepNode :: Reachability
593618}
594619
620+ fn metadata_dep_node ( def_id : DefId ) -> DepNode < DefId > {
621+ DepNode :: MetaData ( def_id)
622+ }
623+
595624fn mir_shim_dep_node ( instance : ty:: InstanceDef ) -> DepNode < DefId > {
596625 instance. dep_node ( )
597626}
@@ -608,4 +637,4 @@ fn typeck_item_bodies_dep_node(_: CrateNum) -> DepNode<DefId> {
608637
609638fn const_eval_dep_node ( ( def_id, _) : ( DefId , & Substs ) ) -> DepNode < DefId > {
610639 DepNode :: ConstEval ( def_id)
611- }
640+ }
0 commit comments