@@ -65,8 +65,7 @@ use crate::traits::query::{
6565 CanonicalTypeOpEqGoal , CanonicalTypeOpSubtypeGoal , CanonicalPredicateGoal ,
6666 CanonicalTypeOpProvePredicateGoal , CanonicalTypeOpNormalizeGoal ,
6767} ;
68- use crate :: ty:: { TyCtxt , FnSig , Instance , InstanceDef ,
69- ParamEnv , ParamEnvAnd , Predicate , PolyFnSig , PolyTraitRef , Ty } ;
68+ use crate :: ty:: { self , TyCtxt , ParamEnvAnd , Ty } ;
7069use crate :: ty:: subst:: SubstsRef ;
7170
7271// erase!() just makes tokens go away. It's used to specify which macro argument
@@ -432,211 +431,13 @@ rustc_dep_node_append!([define_dep_nodes!][ <'tcx>
432431 // Represents metadata from an extern crate.
433432 [ eval_always] CrateMetadata ( CrateNum ) ,
434433
435- // Represents different phases in the compiler.
436- [ ] RegionScopeTree ( DefId ) ,
437- [ eval_always] Coherence ,
438- [ eval_always] CoherenceInherentImplOverlapCheck ,
439- [ ] CoherenceCheckTrait ( DefId ) ,
440- [ eval_always] PrivacyAccessLevels ( CrateNum ) ,
441- [ eval_always] CheckPrivateInPublic ( CrateNum ) ,
442- [ eval_always] Analysis ( CrateNum ) ,
443-
444- // Represents the MIR for a fn; also used as the task node for
445- // things read/modify that MIR.
446- [ ] MirShim { instance_def: InstanceDef <' tcx> } ,
447-
448- [ ] BorrowCheckKrate ,
449- [ ] BorrowCheck ( DefId ) ,
450- [ ] MirBorrowCheck ( DefId ) ,
451- [ ] UnsafetyCheckResult ( DefId ) ,
452- [ ] UnsafeDeriveOnReprPacked ( DefId ) ,
453-
454- [ ] LintMod ( DefId ) ,
455- [ ] CheckModAttrs ( DefId ) ,
456- [ ] CheckModLoops ( DefId ) ,
457- [ ] CheckModUnstableApiUsage ( DefId ) ,
458- [ ] CheckModItemTypes ( DefId ) ,
459- [ ] CheckModPrivacy ( DefId ) ,
460- [ ] CheckModIntrinsics ( DefId ) ,
461- [ ] CheckModLiveness ( DefId ) ,
462- [ ] CheckModImplWf ( DefId ) ,
463- [ ] CollectModItemTypes ( DefId ) ,
464-
465- [ ] Reachability ,
466- [ ] CrateVariances ,
467-
468- // Nodes representing bits of computed IR in the tcx. Each shared
469- // table in the tcx (or elsewhere) maps to one of these
470- // nodes.
471- [ ] AssociatedItems ( DefId ) ,
472- [ ] ExplicitPredicatesOfItem ( DefId ) ,
473- [ ] PredicatesDefinedOnItem ( DefId ) ,
474- [ ] InferredOutlivesOf ( DefId ) ,
475- [ ] InferredOutlivesCrate ( CrateNum ) ,
476- [ ] SuperPredicatesOfItem ( DefId ) ,
477- [ ] TraitDefOfItem ( DefId ) ,
478- [ ] AdtDefOfItem ( DefId ) ,
479- [ ] ImplTraitRef ( DefId ) ,
480- [ ] ImplPolarity ( DefId ) ,
481- [ ] Issue33140SelfTy ( DefId ) ,
482- [ ] FnSignature ( DefId ) ,
483- [ ] CoerceUnsizedInfo ( DefId ) ,
484-
485- [ ] ItemVarianceConstraints ( DefId ) ,
486- [ ] ItemVariances ( DefId ) ,
487- [ ] IsConstFn ( DefId ) ,
488- [ ] IsPromotableConstFn ( DefId ) ,
489- [ ] IsForeignItem ( DefId ) ,
490- [ ] TypeParamPredicates { item_id: DefId , param_id: DefId } ,
491- [ ] SizedConstraint ( DefId ) ,
492- [ ] DtorckConstraint ( DefId ) ,
493- [ ] AdtDestructor ( DefId ) ,
494- [ ] AssociatedItemDefIds ( DefId ) ,
495- [ eval_always] InherentImpls ( DefId ) ,
496- [ ] TypeckBodiesKrate ,
497- [ ] TypeckTables ( DefId ) ,
498- [ ] UsedTraitImports ( DefId ) ,
499- [ ] HasTypeckTables ( DefId ) ,
500- [ ] ConstEval { param_env: ParamEnvAnd <' tcx, GlobalId <' tcx>> } ,
501- [ ] ConstEvalRaw { param_env: ParamEnvAnd <' tcx, GlobalId <' tcx>> } ,
502- [ ] CheckMatch ( DefId ) ,
503- [ ] SymbolName { instance: Instance <' tcx> } ,
504- [ ] SpecializationGraph ( DefId ) ,
505- [ ] ObjectSafety ( DefId ) ,
506- [ ] FulfillObligation { param_env: ParamEnv <' tcx>, trait_ref: PolyTraitRef <' tcx> } ,
507- [ ] VtableMethods { trait_ref: PolyTraitRef <' tcx> } ,
508-
509- [ ] IsCopy { param_env: ParamEnvAnd <' tcx, Ty <' tcx>> } ,
510- [ ] IsSized { param_env: ParamEnvAnd <' tcx, Ty <' tcx>> } ,
511- [ ] IsFreeze { param_env: ParamEnvAnd <' tcx, Ty <' tcx>> } ,
512- [ ] NeedsDrop { param_env: ParamEnvAnd <' tcx, Ty <' tcx>> } ,
513- [ ] Layout { param_env: ParamEnvAnd <' tcx, Ty <' tcx>> } ,
514-
515- // The set of impls for a given trait.
516- [ ] TraitImpls ( DefId ) ,
517-
518434 [ eval_always] AllLocalTraitImpls ,
519435
520436 [ anon] TraitSelect ,
521437
522- [ ] ParamEnv ( DefId ) ,
523- [ ] DescribeDef ( DefId ) ,
524-
525- // FIXME(mw): DefSpans are not really inputs since they are derived from
526- // HIR. But at the moment HIR hashing still contains some hacks that allow
527- // to make type debuginfo to be source location independent. Declaring
528- // DefSpan an input makes sure that changes to these are always detected
529- // regardless of HIR hashing.
530- [ eval_always] DefSpan ( DefId ) ,
531- [ ] LookupStability ( DefId ) ,
532- [ ] LookupDeprecationEntry ( DefId ) ,
533- [ ] ConstIsRvaluePromotableToStatic ( DefId ) ,
534- [ ] RvaluePromotableMap ( DefId ) ,
535- [ ] ImplParent ( DefId ) ,
536- [ ] TraitOfItem ( DefId ) ,
537- [ ] IsReachableNonGeneric ( DefId ) ,
538- [ ] IsUnreachableLocalDefinition ( DefId ) ,
539- [ ] IsMirAvailable ( DefId ) ,
540- [ ] ItemAttrs ( DefId ) ,
541- [ ] CodegenFnAttrs ( DefId ) ,
542- [ ] FnArgNames ( DefId ) ,
543- [ ] RenderedConst ( DefId ) ,
544- [ ] DylibDepFormats ( CrateNum ) ,
545- [ ] IsCompilerBuiltins ( CrateNum ) ,
546- [ ] HasGlobalAllocator ( CrateNum ) ,
547- [ ] HasPanicHandler ( CrateNum ) ,
548- [ eval_always] ExternCrate ( DefId ) ,
549- [ ] Specializes { impl1: DefId , impl2: DefId } ,
550- [ eval_always] InScopeTraits ( DefIndex ) ,
551- [ eval_always] ModuleExports ( DefId ) ,
552- [ ] IsSanitizerRuntime ( CrateNum ) ,
553- [ ] IsProfilerRuntime ( CrateNum ) ,
554- [ ] GetPanicStrategy ( CrateNum ) ,
555- [ ] IsNoBuiltins ( CrateNum ) ,
556- [ ] ImplDefaultness ( DefId ) ,
557- [ ] CheckItemWellFormed ( DefId ) ,
558- [ ] CheckTraitItemWellFormed ( DefId ) ,
559- [ ] CheckImplItemWellFormed ( DefId ) ,
560- [ ] ReachableNonGenerics ( CrateNum ) ,
561- [ ] EntryFn ( CrateNum ) ,
562- [ ] PluginRegistrarFn ( CrateNum ) ,
563- [ ] ProcMacroDeclsStatic ( CrateNum ) ,
564- [ eval_always] CrateDisambiguator ( CrateNum ) ,
565- [ eval_always] CrateHash ( CrateNum ) ,
566- [ eval_always] OriginalCrateName ( CrateNum ) ,
567- [ eval_always] ExtraFileName ( CrateNum ) ,
568-
569- [ ] ImplementationsOfTrait { krate: CrateNum , trait_id: DefId } ,
570- [ ] AllTraitImplementations ( CrateNum ) ,
571-
572- [ ] DllimportForeignItems ( CrateNum ) ,
573- [ ] IsDllimportForeignItem ( DefId ) ,
574- [ ] IsStaticallyIncludedForeignItem ( DefId ) ,
575- [ ] NativeLibraryKind ( DefId ) ,
576- [ eval_always] LinkArgs ,
577-
578- [ ] ResolveLifetimes ( CrateNum ) ,
579- [ ] NamedRegion ( DefIndex ) ,
580- [ ] IsLateBound ( DefIndex ) ,
581- [ ] ObjectLifetimeDefaults ( DefIndex ) ,
582-
583- [ ] Visibility ( DefId ) ,
584- [ eval_always] DepKind ( CrateNum ) ,
585- [ eval_always] CrateName ( CrateNum ) ,
586- [ ] ItemChildren ( DefId ) ,
587- [ ] ExternModStmtCnum ( DefId ) ,
588- [ eval_always] GetLibFeatures ,
589- [ ] DefinedLibFeatures ( CrateNum ) ,
590- [ eval_always] GetLangItems ,
591- [ ] DefinedLangItems ( CrateNum ) ,
592- [ ] MissingLangItems ( CrateNum ) ,
593- [ ] VisibleParentMap ,
594- [ eval_always] MissingExternCrateItem ( CrateNum ) ,
595- [ eval_always] UsedCrateSource ( CrateNum ) ,
596- [ eval_always] PostorderCnums ,
597-
598- [ eval_always] Freevars ( DefId ) ,
599- [ eval_always] MaybeUnusedTraitImport ( DefId ) ,
600- [ eval_always] MaybeUnusedExternCrates ,
601- [ eval_always] NamesImportedByGlobUse ( DefId ) ,
602- [ eval_always] StabilityIndex ,
603- [ eval_always] AllTraits ,
604- [ eval_always] AllCrateNums ,
605- [ ] ExportedSymbols ( CrateNum ) ,
606- [ eval_always] CollectAndPartitionMonoItems ,
607- [ ] IsCodegenedItem ( DefId ) ,
608- [ ] CodegenUnit ( InternedString ) ,
609- [ ] BackendOptimizationLevel ( CrateNum ) ,
610438 [ ] CompileCodegenUnit ( InternedString ) ,
611- [ eval_always] OutputFilenames ,
612- [ ] NormalizeProjectionTy ( CanonicalProjectionGoal <' tcx>) ,
613- [ ] NormalizeTyAfterErasingRegions ( ParamEnvAnd <' tcx, Ty <' tcx>>) ,
614- [ ] ImpliedOutlivesBounds ( CanonicalTyGoal <' tcx>) ,
615- [ ] DropckOutlives ( CanonicalTyGoal <' tcx>) ,
616- [ ] EvaluateObligation ( CanonicalPredicateGoal <' tcx>) ,
617- [ ] EvaluateGoal ( traits:: ChalkCanonicalGoal <' tcx>) ,
618- [ ] TypeOpAscribeUserType ( CanonicalTypeOpAscribeUserTypeGoal <' tcx>) ,
619- [ ] TypeOpEq ( CanonicalTypeOpEqGoal <' tcx>) ,
620- [ ] TypeOpSubtype ( CanonicalTypeOpSubtypeGoal <' tcx>) ,
621- [ ] TypeOpProvePredicate ( CanonicalTypeOpProvePredicateGoal <' tcx>) ,
622- [ ] TypeOpNormalizeTy ( CanonicalTypeOpNormalizeGoal <' tcx, Ty <' tcx>>) ,
623- [ ] TypeOpNormalizePredicate ( CanonicalTypeOpNormalizeGoal <' tcx, Predicate <' tcx>>) ,
624- [ ] TypeOpNormalizePolyFnSig ( CanonicalTypeOpNormalizeGoal <' tcx, PolyFnSig <' tcx>>) ,
625- [ ] TypeOpNormalizeFnSig ( CanonicalTypeOpNormalizeGoal <' tcx, FnSig <' tcx>>) ,
626-
627- [ ] SubstituteNormalizeAndTestPredicates { key: ( DefId , SubstsRef <' tcx>) } ,
628- [ ] MethodAutoderefSteps ( CanonicalTyGoal <' tcx>) ,
629-
630- [ eval_always] TargetFeaturesWhitelist ,
631-
632- [ ] InstanceDefSizeEstimate { instance_def: InstanceDef <' tcx> } ,
633-
634- [ eval_always] Features ,
635-
636- [ ] ForeignModules ( CrateNum ) ,
637-
638- [ ] UpstreamMonomorphizations ( CrateNum ) ,
639- [ ] UpstreamMonomorphizationsFor ( DefId ) ,
439+
440+ [ eval_always] Analysis ( CrateNum ) ,
640441] ) ;
641442
642443pub trait RecoverKey < ' tcx > : Sized {
@@ -655,6 +456,12 @@ impl RecoverKey<'tcx> for DefId {
655456 }
656457}
657458
459+ impl RecoverKey < ' tcx > for DefIndex {
460+ fn recover ( tcx : TyCtxt < ' _ , ' tcx , ' tcx > , dep_node : & DepNode ) -> Option < Self > {
461+ dep_node. extract_def_id ( tcx) . map ( |id| id. index )
462+ }
463+ }
464+
658465trait DepNodeParams < ' a , ' gcx : ' tcx + ' a , ' tcx : ' a > : fmt:: Debug {
659466 const CAN_RECONSTRUCT_QUERY_KEY : bool ;
660467
0 commit comments