@@ -459,10 +459,6 @@ define_dep_nodes!( <'tcx>
459459 // Represents metadata from an extern crate.
460460 [ input] CrateMetadata ( CrateNum ) ,
461461
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-
466462 // Represents different phases in the compiler.
467463 [ ] RegionScopeTree ( DefId ) ,
468464 [ eval_always] Coherence ,
@@ -537,38 +533,19 @@ define_dep_nodes!( <'tcx>
537533 // The set of impls for a given trait.
538534 [ ] TraitImpls ( DefId ) ,
539535
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+
567538 [ anon] TraitSelect ,
568539
569540 [ ] ParamEnv ( DefId ) ,
570541 [ ] 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 ) ,
572549 [ ] LookupStability ( DefId ) ,
573550 [ ] LookupDeprecationEntry ( DefId ) ,
574551 [ ] ItemBodyNestedBodies ( DefId ) ,
@@ -588,7 +565,7 @@ define_dep_nodes!( <'tcx>
588565 [ eval_always] LintLevels ,
589566 [ ] Specializes { impl1: DefId , impl2: DefId } ,
590567 [ input] InScopeTraits ( DefIndex ) ,
591- [ ] ModuleExports ( DefId ) ,
568+ [ input ] ModuleExports ( DefId ) ,
592569 [ ] IsSanitizerRuntime ( CrateNum ) ,
593570 [ ] IsProfilerRuntime ( CrateNum ) ,
594571 [ ] GetPanicStrategy ( CrateNum ) ,
@@ -598,37 +575,37 @@ define_dep_nodes!( <'tcx>
598575 [ ] NativeLibraries ( CrateNum ) ,
599576 [ ] PluginRegistrarFn ( CrateNum ) ,
600577 [ ] DeriveRegistrarFn ( CrateNum ) ,
601- [ ] CrateDisambiguator ( CrateNum ) ,
602- [ ] CrateHash ( CrateNum ) ,
603- [ ] OriginalCrateName ( CrateNum ) ,
578+ [ input ] CrateDisambiguator ( CrateNum ) ,
579+ [ input ] CrateHash ( CrateNum ) ,
580+ [ input ] OriginalCrateName ( CrateNum ) ,
604581
605582 [ ] ImplementationsOfTrait { krate: CrateNum , trait_id: DefId } ,
606583 [ ] AllTraitImplementations ( CrateNum ) ,
607584
608585 [ ] IsDllimportForeignItem ( DefId ) ,
609586 [ ] IsStaticallyIncludedForeignItem ( DefId ) ,
610587 [ ] NativeLibraryKind ( DefId ) ,
611- [ ] LinkArgs ,
588+ [ input ] LinkArgs ,
612589
613- [ ] NamedRegion ( DefIndex ) ,
614- [ ] IsLateBound ( DefIndex ) ,
615- [ ] ObjectLifetimeDefaults ( DefIndex ) ,
590+ [ input ] NamedRegion ( DefIndex ) ,
591+ [ input ] IsLateBound ( DefIndex ) ,
592+ [ input ] ObjectLifetimeDefaults ( DefIndex ) ,
616593
617594 [ ] Visibility ( DefId ) ,
618595 [ ] DepKind ( CrateNum ) ,
619- [ ] CrateName ( CrateNum ) ,
596+ [ input ] CrateName ( CrateNum ) ,
620597 [ ] ItemChildren ( DefId ) ,
621598 [ ] ExternModStmtCnum ( DefId ) ,
622- [ ] GetLangItems ,
599+ [ input ] GetLangItems ,
623600 [ ] DefinedLangItems ( CrateNum ) ,
624601 [ ] MissingLangItems ( CrateNum ) ,
625602 [ ] ExternConstBody ( DefId ) ,
626603 [ ] VisibleParentMap ,
627604 [ ] MissingExternCrateItem ( CrateNum ) ,
628605 [ ] UsedCrateSource ( CrateNum ) ,
629- [ ] PostorderCnums ,
630- [ ] HasCloneClosures ( CrateNum ) ,
631- [ ] HasCopyClosures ( CrateNum ) ,
606+ [ input ] PostorderCnums ,
607+ [ input ] HasCloneClosures ( CrateNum ) ,
608+ [ input ] HasCopyClosures ( CrateNum ) ,
632609
633610 // This query is not expected to have inputs -- as a result, it's
634611 // not a good candidate for "replay" because it's essentially a
@@ -638,19 +615,19 @@ define_dep_nodes!( <'tcx>
638615 // may save a bit of time.
639616 [ anon] EraseRegionsTy { ty: Ty <' tcx> } ,
640617
641- [ ] Freevars ( DefId ) ,
642- [ ] MaybeUnusedTraitImport ( DefId ) ,
618+ [ input ] Freevars ( DefId ) ,
619+ [ input ] MaybeUnusedTraitImport ( DefId ) ,
643620 [ ] MaybeUnusedExternCrates ,
644621 [ ] StabilityIndex ,
645- [ ] AllCrateNums ,
622+ [ input ] AllCrateNums ,
646623 [ ] ExportedSymbols ( CrateNum ) ,
647624 [ eval_always] CollectAndPartitionTranslationItems ,
648625 [ ] ExportName ( DefId ) ,
649626 [ ] ContainsExternIndicator ( DefId ) ,
650627 [ ] IsTranslatedFunction ( DefId ) ,
651628 [ ] CodegenUnit ( InternedString ) ,
652629 [ ] CompileCodegenUnit ( InternedString ) ,
653- [ ] OutputFilenames ,
630+ [ input ] OutputFilenames ,
654631 [ anon] NormalizeTy ,
655632 // We use this for most things when incr. comp. is turned off.
656633 [ ] Null ,
@@ -800,13 +777,6 @@ impl WorkProductId {
800777 hash : fingerprint
801778 }
802779 }
803-
804- pub fn to_dep_node ( self ) -> DepNode {
805- DepNode {
806- kind : DepKind :: WorkProduct ,
807- hash : self . hash ,
808- }
809- }
810780}
811781
812782impl_stable_hash_for ! ( struct :: dep_graph:: WorkProductId {
0 commit comments