@@ -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,16 @@ 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+
294301macro_rules! define_maps {
295302 ( <$tcx: tt>
296303 $( $( #[ $attr: meta] ) *
297- [ $( $pub: tt) * ] $name: ident: $node: ident( $K: ty) -> $V: ty) , * ) => {
304+ [ $( $pub: tt) * ] $name: ident: $node: ident( $K: ty) -> $V: ty, ) * ) => {
298305 pub struct Maps <$tcx> {
299306 providers: IndexVec <CrateNum , Providers <$tcx>>,
300307 query_stack: RefCell <Vec <( Span , Query <$tcx>) >>,
@@ -577,7 +584,9 @@ define_maps! { <'tcx>
577584 [ ] symbol_name: symbol_name_dep_node( ty:: Instance <' tcx>) -> ty:: SymbolName ,
578585
579586 [ ] describe_def: DescribeDef ( DefId ) -> Option <Def >,
580- [ ] def_span: DefSpan ( DefId ) -> Span
587+ [ ] def_span: DefSpan ( DefId ) -> Span ,
588+
589+ [ ] item_body_nested_bodies: metadata_dep_node( DefId ) -> Rc <BTreeMap <hir:: BodyId , hir:: Body >>,
581590}
582591
583592fn coherent_trait_dep_node ( ( _, def_id) : ( CrateNum , DefId ) ) -> DepNode < DefId > {
@@ -592,6 +601,10 @@ fn reachability_dep_node(_: CrateNum) -> DepNode<DefId> {
592601 DepNode :: Reachability
593602}
594603
604+ fn metadata_dep_node ( def_id : DefId ) -> DepNode < DefId > {
605+ DepNode :: MetaData ( def_id)
606+ }
607+
595608fn mir_shim_dep_node ( instance : ty:: InstanceDef ) -> DepNode < DefId > {
596609 instance. dep_node ( )
597610}
@@ -608,4 +621,4 @@ fn typeck_item_bodies_dep_node(_: CrateNum) -> DepNode<DefId> {
608621
609622fn const_eval_dep_node ( ( def_id, _) : ( DefId , & Substs ) ) -> DepNode < DefId > {
610623 DepNode :: ConstEval ( def_id)
611- }
624+ }
0 commit comments