@@ -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,30 @@ 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
+
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
+
294
315
macro_rules! define_maps {
295
316
( <$tcx: tt>
296
317
$( $( #[ $attr: meta] ) *
297
- [ $( $pub: tt) * ] $name: ident: $node: ident( $K: ty) -> $V: ty) , * ) => {
318
+ [ $( $pub: tt) * ] $name: ident: $node: ident( $K: ty) -> $V: ty, ) * ) => {
298
319
pub struct Maps <$tcx> {
299
320
providers: IndexVec <CrateNum , Providers <$tcx>>,
300
321
query_stack: RefCell <Vec <( Span , Query <$tcx>) >>,
@@ -577,7 +598,11 @@ define_maps! { <'tcx>
577
598
[ ] symbol_name: symbol_name_dep_node( ty:: Instance <' tcx>) -> ty:: SymbolName ,
578
599
579
600
[ ] 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 ,
581
606
}
582
607
583
608
fn coherent_trait_dep_node ( ( _, def_id) : ( CrateNum , DefId ) ) -> DepNode < DefId > {
@@ -592,6 +617,10 @@ fn reachability_dep_node(_: CrateNum) -> DepNode<DefId> {
592
617
DepNode :: Reachability
593
618
}
594
619
620
+ fn metadata_dep_node ( def_id : DefId ) -> DepNode < DefId > {
621
+ DepNode :: MetaData ( def_id)
622
+ }
623
+
595
624
fn mir_shim_dep_node ( instance : ty:: InstanceDef ) -> DepNode < DefId > {
596
625
instance. dep_node ( )
597
626
}
@@ -608,4 +637,4 @@ fn typeck_item_bodies_dep_node(_: CrateNum) -> DepNode<DefId> {
608
637
609
638
fn const_eval_dep_node ( ( def_id, _) : ( DefId , & Substs ) ) -> DepNode < DefId > {
610
639
DepNode :: ConstEval ( def_id)
611
- }
640
+ }
0 commit comments