@@ -459,10 +459,6 @@ define_dep_nodes!( <'tcx>
459
459
// Represents metadata from an extern crate.
460
460
[ input] CrateMetadata ( CrateNum ) ,
461
461
462
- // Represents some artifact that we save to disk. Note that these
463
- // do not have a def-id as part of their identifier.
464
- [ ] WorkProduct ( WorkProductId ) ,
465
-
466
462
// Represents different phases in the compiler.
467
463
[ ] RegionScopeTree ( DefId ) ,
468
464
[ eval_always] Coherence ,
@@ -537,38 +533,19 @@ define_dep_nodes!( <'tcx>
537
533
// The set of impls for a given trait.
538
534
[ ] TraitImpls ( DefId ) ,
539
535
540
- [ ] AllLocalTraitImpls ,
541
-
542
- // Trait selection cache is a little funny. Given a trait
543
- // reference like `Foo: SomeTrait<Bar>`, there could be
544
- // arbitrarily many def-ids to map on in there (e.g., `Foo`,
545
- // `SomeTrait`, `Bar`). We could have a vector of them, but it
546
- // requires heap-allocation, and trait sel in general can be a
547
- // surprisingly hot path. So instead we pick two def-ids: the
548
- // trait def-id, and the first def-id in the input types. If there
549
- // is no def-id in the input types, then we use the trait def-id
550
- // again. So for example:
551
- //
552
- // - `i32: Clone` -> `TraitSelect { trait_def_id: Clone, self_def_id: Clone }`
553
- // - `u32: Clone` -> `TraitSelect { trait_def_id: Clone, self_def_id: Clone }`
554
- // - `Clone: Clone` -> `TraitSelect { trait_def_id: Clone, self_def_id: Clone }`
555
- // - `Vec<i32>: Clone` -> `TraitSelect { trait_def_id: Clone, self_def_id: Vec }`
556
- // - `String: Clone` -> `TraitSelect { trait_def_id: Clone, self_def_id: String }`
557
- // - `Foo: Trait<Bar>` -> `TraitSelect { trait_def_id: Trait, self_def_id: Foo }`
558
- // - `Foo: Trait<i32>` -> `TraitSelect { trait_def_id: Trait, self_def_id: Foo }`
559
- // - `(Foo, Bar): Trait` -> `TraitSelect { trait_def_id: Trait, self_def_id: Foo }`
560
- // - `i32: Trait<Foo>` -> `TraitSelect { trait_def_id: Trait, self_def_id: Foo }`
561
- //
562
- // You can see that we map many trait refs to the same
563
- // trait-select node. This is not a problem, it just means
564
- // imprecision in our dep-graph tracking. The important thing is
565
- // that for any given trait-ref, we always map to the **same**
566
- // trait-select node.
536
+ [ input] AllLocalTraitImpls ,
537
+
567
538
[ anon] TraitSelect ,
568
539
569
540
[ ] ParamEnv ( DefId ) ,
570
541
[ ] DescribeDef ( DefId ) ,
571
- [ ] DefSpan ( DefId ) ,
542
+
543
+ // FIXME(mw): DefSpans are not really inputs since they are derived from
544
+ // HIR. But at the moment HIR hashing still contains some hacks that allow
545
+ // to make type debuginfo to be source location independent. Declaring
546
+ // DefSpan an input makes sure that changes to these are always detected
547
+ // regardless of HIR hashing.
548
+ [ input] DefSpan ( DefId ) ,
572
549
[ ] LookupStability ( DefId ) ,
573
550
[ ] LookupDeprecationEntry ( DefId ) ,
574
551
[ ] ItemBodyNestedBodies ( DefId ) ,
@@ -588,7 +565,7 @@ define_dep_nodes!( <'tcx>
588
565
[ eval_always] LintLevels ,
589
566
[ ] Specializes { impl1: DefId , impl2: DefId } ,
590
567
[ input] InScopeTraits ( DefIndex ) ,
591
- [ ] ModuleExports ( DefId ) ,
568
+ [ input ] ModuleExports ( DefId ) ,
592
569
[ ] IsSanitizerRuntime ( CrateNum ) ,
593
570
[ ] IsProfilerRuntime ( CrateNum ) ,
594
571
[ ] GetPanicStrategy ( CrateNum ) ,
@@ -598,37 +575,37 @@ define_dep_nodes!( <'tcx>
598
575
[ ] NativeLibraries ( CrateNum ) ,
599
576
[ ] PluginRegistrarFn ( CrateNum ) ,
600
577
[ ] DeriveRegistrarFn ( CrateNum ) ,
601
- [ ] CrateDisambiguator ( CrateNum ) ,
602
- [ ] CrateHash ( CrateNum ) ,
603
- [ ] OriginalCrateName ( CrateNum ) ,
578
+ [ input ] CrateDisambiguator ( CrateNum ) ,
579
+ [ input ] CrateHash ( CrateNum ) ,
580
+ [ input ] OriginalCrateName ( CrateNum ) ,
604
581
605
582
[ ] ImplementationsOfTrait { krate: CrateNum , trait_id: DefId } ,
606
583
[ ] AllTraitImplementations ( CrateNum ) ,
607
584
608
585
[ ] IsDllimportForeignItem ( DefId ) ,
609
586
[ ] IsStaticallyIncludedForeignItem ( DefId ) ,
610
587
[ ] NativeLibraryKind ( DefId ) ,
611
- [ ] LinkArgs ,
588
+ [ input ] LinkArgs ,
612
589
613
- [ ] NamedRegion ( DefIndex ) ,
614
- [ ] IsLateBound ( DefIndex ) ,
615
- [ ] ObjectLifetimeDefaults ( DefIndex ) ,
590
+ [ input ] NamedRegion ( DefIndex ) ,
591
+ [ input ] IsLateBound ( DefIndex ) ,
592
+ [ input ] ObjectLifetimeDefaults ( DefIndex ) ,
616
593
617
594
[ ] Visibility ( DefId ) ,
618
595
[ ] DepKind ( CrateNum ) ,
619
- [ ] CrateName ( CrateNum ) ,
596
+ [ input ] CrateName ( CrateNum ) ,
620
597
[ ] ItemChildren ( DefId ) ,
621
598
[ ] ExternModStmtCnum ( DefId ) ,
622
- [ ] GetLangItems ,
599
+ [ input ] GetLangItems ,
623
600
[ ] DefinedLangItems ( CrateNum ) ,
624
601
[ ] MissingLangItems ( CrateNum ) ,
625
602
[ ] ExternConstBody ( DefId ) ,
626
603
[ ] VisibleParentMap ,
627
604
[ ] MissingExternCrateItem ( CrateNum ) ,
628
605
[ ] UsedCrateSource ( CrateNum ) ,
629
- [ ] PostorderCnums ,
630
- [ ] HasCloneClosures ( CrateNum ) ,
631
- [ ] HasCopyClosures ( CrateNum ) ,
606
+ [ input ] PostorderCnums ,
607
+ [ input ] HasCloneClosures ( CrateNum ) ,
608
+ [ input ] HasCopyClosures ( CrateNum ) ,
632
609
633
610
// This query is not expected to have inputs -- as a result, it's
634
611
// not a good candidate for "replay" because it's essentially a
@@ -638,19 +615,19 @@ define_dep_nodes!( <'tcx>
638
615
// may save a bit of time.
639
616
[ anon] EraseRegionsTy { ty: Ty <' tcx> } ,
640
617
641
- [ ] Freevars ( DefId ) ,
642
- [ ] MaybeUnusedTraitImport ( DefId ) ,
618
+ [ input ] Freevars ( DefId ) ,
619
+ [ input ] MaybeUnusedTraitImport ( DefId ) ,
643
620
[ ] MaybeUnusedExternCrates ,
644
621
[ ] StabilityIndex ,
645
- [ ] AllCrateNums ,
622
+ [ input ] AllCrateNums ,
646
623
[ ] ExportedSymbols ( CrateNum ) ,
647
624
[ eval_always] CollectAndPartitionTranslationItems ,
648
625
[ ] ExportName ( DefId ) ,
649
626
[ ] ContainsExternIndicator ( DefId ) ,
650
627
[ ] IsTranslatedFunction ( DefId ) ,
651
628
[ ] CodegenUnit ( InternedString ) ,
652
629
[ ] CompileCodegenUnit ( InternedString ) ,
653
- [ ] OutputFilenames ,
630
+ [ input ] OutputFilenames ,
654
631
[ anon] NormalizeTy ,
655
632
// We use this for most things when incr. comp. is turned off.
656
633
[ ] Null ,
@@ -800,13 +777,6 @@ impl WorkProductId {
800
777
hash : fingerprint
801
778
}
802
779
}
803
-
804
- pub fn to_dep_node ( self ) -> DepNode {
805
- DepNode {
806
- kind : DepKind :: WorkProduct ,
807
- hash : self . hash ,
808
- }
809
- }
810
780
}
811
781
812
782
impl_stable_hash_for ! ( struct :: dep_graph:: WorkProductId {
0 commit comments