@@ -24,6 +24,7 @@ use util::nodemap::NodeSet;
24
24
use rustc_data_structures:: indexed_vec:: IndexVec ;
25
25
use std:: cell:: { RefCell , RefMut } ;
26
26
use std:: mem;
27
+ use std:: collections:: BTreeMap ;
27
28
use std:: ops:: Deref ;
28
29
use std:: rc:: Rc ;
29
30
use syntax_pos:: { Span , DUMMY_SP } ;
@@ -291,10 +292,16 @@ impl<'tcx> QueryDescription for queries::def_span<'tcx> {
291
292
}
292
293
}
293
294
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
+
294
301
macro_rules! define_maps {
295
302
( <$tcx: tt>
296
303
$( $( #[ $attr: meta] ) *
297
- [ $( $pub: tt) * ] $name: ident: $node: ident( $K: ty) -> $V: ty) , * ) => {
304
+ [ $( $pub: tt) * ] $name: ident: $node: ident( $K: ty) -> $V: ty, ) * ) => {
298
305
pub struct Maps <$tcx> {
299
306
providers: IndexVec <CrateNum , Providers <$tcx>>,
300
307
query_stack: RefCell <Vec <( Span , Query <$tcx>) >>,
@@ -577,7 +584,9 @@ define_maps! { <'tcx>
577
584
[ ] symbol_name: symbol_name_dep_node( ty:: Instance <' tcx>) -> ty:: SymbolName ,
578
585
579
586
[ ] 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 >>,
581
590
}
582
591
583
592
fn coherent_trait_dep_node ( ( _, def_id) : ( CrateNum , DefId ) ) -> DepNode < DefId > {
@@ -592,6 +601,10 @@ fn reachability_dep_node(_: CrateNum) -> DepNode<DefId> {
592
601
DepNode :: Reachability
593
602
}
594
603
604
+ fn metadata_dep_node ( def_id : DefId ) -> DepNode < DefId > {
605
+ DepNode :: MetaData ( def_id)
606
+ }
607
+
595
608
fn mir_shim_dep_node ( instance : ty:: InstanceDef ) -> DepNode < DefId > {
596
609
instance. dep_node ( )
597
610
}
@@ -608,4 +621,4 @@ fn typeck_item_bodies_dep_node(_: CrateNum) -> DepNode<DefId> {
608
621
609
622
fn const_eval_dep_node ( ( def_id, _) : ( DefId , & Substs ) ) -> DepNode < DefId > {
610
623
DepNode :: ConstEval ( def_id)
611
- }
624
+ }
0 commit comments