@@ -65,8 +65,8 @@ use hir::map::DefPathHash;
65
65
use hir:: { HirId , ItemLocalId } ;
66
66
67
67
use ich:: Fingerprint ;
68
- use ty:: { TyCtxt , Instance , InstanceDef } ;
69
- use ty:: fast_reject :: SimplifiedType ;
68
+ use ty:: { TyCtxt , Instance , InstanceDef , ParamEnvAnd , Ty } ;
69
+ use ty:: subst :: Substs ;
70
70
use rustc_data_structures:: stable_hasher:: { StableHasher , HashStable } ;
71
71
use ich:: StableHashingContext ;
72
72
use std:: fmt;
@@ -347,7 +347,7 @@ impl fmt::Debug for DepNode {
347
347
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
348
348
write ! ( f, "{:?}" , self . kind) ?;
349
349
350
- if !self . kind . has_params ( ) {
350
+ if !self . kind . has_params ( ) && ! self . kind . is_anon ( ) {
351
351
return Ok ( ( ) ) ;
352
352
}
353
353
@@ -356,14 +356,14 @@ impl fmt::Debug for DepNode {
356
356
:: ty:: tls:: with_opt ( |opt_tcx| {
357
357
if let Some ( tcx) = opt_tcx {
358
358
if let Some ( def_id) = self . extract_def_id ( tcx) {
359
- write ! ( f, "{}" , tcx. item_path_str ( def_id) ) ?;
359
+ write ! ( f, "{}" , tcx. def_path ( def_id) . to_string ( tcx ) ) ?;
360
360
} else if let Some ( ref s) = tcx. dep_graph . dep_node_debug_str ( * self ) {
361
361
write ! ( f, "{}" , s) ?;
362
362
} else {
363
- write ! ( f, "{:? }" , self . hash) ?;
363
+ write ! ( f, "{}" , self . hash) ?;
364
364
}
365
365
} else {
366
- write ! ( f, "{:? }" , self . hash) ?;
366
+ write ! ( f, "{}" , self . hash) ?;
367
367
}
368
368
Ok ( ( ) )
369
369
} ) ?;
@@ -430,7 +430,6 @@ define_dep_nodes!( <'tcx>
430
430
[ ] RegionScopeTree ( DefId ) ,
431
431
[ ] Coherence ,
432
432
[ ] CoherenceInherentImplOverlapCheck ,
433
- [ ] Resolve ,
434
433
[ ] CoherenceCheckTrait ( DefId ) ,
435
434
[ ] PrivacyAccessLevels ( CrateNum ) ,
436
435
@@ -447,10 +446,8 @@ define_dep_nodes!( <'tcx>
447
446
[ ] MirBorrowCheck ( DefId ) ,
448
447
[ ] UnsafetyViolations ( DefId ) ,
449
448
450
- [ ] RvalueCheck ( DefId ) ,
451
449
[ ] Reachability ,
452
450
[ ] MirKeys ,
453
- [ ] TransWriteMetadata ,
454
451
[ ] CrateVariances ,
455
452
456
453
// Nodes representing bits of computed IR in the tcx. Each shared
@@ -484,32 +481,23 @@ define_dep_nodes!( <'tcx>
484
481
[ ] TypeckBodiesKrate ,
485
482
[ ] TypeckTables ( DefId ) ,
486
483
[ ] HasTypeckTables ( DefId ) ,
487
- [ anon ] ConstEval ,
484
+ [ ] ConstEval { param_env : ParamEnvAnd < ' tcx , ( DefId , & ' tcx Substs < ' tcx> ) > } ,
488
485
[ ] SymbolName ( DefId ) ,
489
486
[ ] InstanceSymbolName { instance: Instance <' tcx> } ,
490
487
[ ] SpecializationGraph ( DefId ) ,
491
488
[ ] ObjectSafety ( DefId ) ,
492
489
493
- [ anon ] IsCopy ,
494
- [ anon ] IsSized ,
495
- [ anon ] IsFreeze ,
496
- [ anon ] NeedsDrop ,
497
- [ anon ] Layout ,
490
+ [ ] IsCopy { param_env : ParamEnvAnd < ' tcx , Ty < ' tcx>> } ,
491
+ [ ] IsSized { param_env : ParamEnvAnd < ' tcx , Ty < ' tcx>> } ,
492
+ [ ] IsFreeze { param_env : ParamEnvAnd < ' tcx , Ty < ' tcx>> } ,
493
+ [ ] NeedsDrop { param_env : ParamEnvAnd < ' tcx , Ty < ' tcx>> } ,
494
+ [ ] Layout { param_env : ParamEnvAnd < ' tcx , Ty < ' tcx>> } ,
498
495
499
496
// The set of impls for a given trait.
500
497
[ ] TraitImpls ( DefId ) ,
501
- [ ] RelevantTraitImpls ( DefId , SimplifiedType ) ,
502
498
503
499
[ ] AllLocalTraitImpls ,
504
500
505
- // Nodes representing caches. To properly handle a true cache, we
506
- // don't use a DepTrackingMap, but rather we push a task node.
507
- // Otherwise the write into the map would be incorrectly
508
- // attributed to the first task that happened to fill the cache,
509
- // which would yield an overly conservative dep-graph.
510
- [ ] TraitItems ( DefId ) ,
511
- [ ] ReprHints ( DefId ) ,
512
-
513
501
// Trait selection cache is a little funny. Given a trait
514
502
// reference like `Foo: SomeTrait<Bar>`, there could be
515
503
// arbitrarily many def-ids to map on in there (e.g., `Foo`,
@@ -537,10 +525,6 @@ define_dep_nodes!( <'tcx>
537
525
// trait-select node.
538
526
[ anon] TraitSelect ,
539
527
540
- // For proj. cache, we just keep a list of all def-ids, since it is
541
- // not a hotspot.
542
- [ ] ProjectionCache { def_ids: DefIdList } ,
543
-
544
528
[ ] ParamEnv ( DefId ) ,
545
529
[ ] DescribeDef ( DefId ) ,
546
530
[ ] DefSpan ( DefId ) ,
@@ -598,7 +582,6 @@ define_dep_nodes!( <'tcx>
598
582
[ ] MissingLangItems ( CrateNum ) ,
599
583
[ ] ExternConstBody ( DefId ) ,
600
584
[ ] VisibleParentMap ,
601
- [ ] IsDirectExternCrate ( CrateNum ) ,
602
585
[ ] MissingExternCrateItem ( CrateNum ) ,
603
586
[ ] UsedCrateSource ( CrateNum ) ,
604
587
[ ] PostorderCnums ,
@@ -618,6 +601,9 @@ define_dep_nodes!( <'tcx>
618
601
[ ] CodegenUnit ( InternedString ) ,
619
602
[ ] CompileCodegenUnit ( InternedString ) ,
620
603
[ ] OutputFilenames ,
604
+
605
+ // We use this for most things when incr. comp. is turned off.
606
+ [ ] Null ,
621
607
) ;
622
608
623
609
trait DepNodeParams < ' a , ' gcx : ' tcx + ' a , ' tcx : ' a > : fmt:: Debug {
@@ -719,40 +705,6 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for (DefId, De
719
705
}
720
706
}
721
707
722
-
723
- impl < ' a , ' gcx : ' tcx + ' a , ' tcx : ' a > DepNodeParams < ' a , ' gcx , ' tcx > for ( DefIdList , ) {
724
- const CAN_RECONSTRUCT_QUERY_KEY : bool = false ;
725
-
726
- // We actually would not need to specialize the implementation of this
727
- // method but it's faster to combine the hashes than to instantiate a full
728
- // hashing context and stable-hashing state.
729
- fn to_fingerprint ( & self , tcx : TyCtxt ) -> Fingerprint {
730
- let mut fingerprint = Fingerprint :: zero ( ) ;
731
-
732
- for & def_id in self . 0 . iter ( ) {
733
- let def_path_hash = tcx. def_path_hash ( def_id) ;
734
- fingerprint = fingerprint. combine ( def_path_hash. 0 ) ;
735
- }
736
-
737
- fingerprint
738
- }
739
-
740
- fn to_debug_str ( & self , tcx : TyCtxt < ' a , ' gcx , ' tcx > ) -> String {
741
- use std:: fmt:: Write ;
742
-
743
- let mut s = String :: new ( ) ;
744
- write ! ( & mut s, "[" ) . unwrap ( ) ;
745
-
746
- for & def_id in self . 0 . iter ( ) {
747
- write ! ( & mut s, "{}" , tcx. def_path( def_id) . to_string( tcx) ) . unwrap ( ) ;
748
- }
749
-
750
- write ! ( & mut s, "]" ) . unwrap ( ) ;
751
-
752
- s
753
- }
754
- }
755
-
756
708
impl < ' a , ' gcx : ' tcx + ' a , ' tcx : ' a > DepNodeParams < ' a , ' gcx , ' tcx > for ( HirId , ) {
757
709
const CAN_RECONSTRUCT_QUERY_KEY : bool = false ;
758
710
@@ -811,4 +763,3 @@ impl_stable_hash_for!(struct ::dep_graph::WorkProductId {
811
763
hash
812
764
} ) ;
813
765
814
- type DefIdList = Vec < DefId > ;
0 commit comments