@@ -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,212 +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 ( DefId ) ,
504- [ ] InstanceSymbolName { instance: Instance <' tcx> } ,
505- [ ] SpecializationGraph ( DefId ) ,
506- [ ] ObjectSafety ( DefId ) ,
507- [ ] FulfillObligation { param_env: ParamEnv <' tcx>, trait_ref: PolyTraitRef <' tcx> } ,
508- [ ] VtableMethods { trait_ref: PolyTraitRef <' tcx> } ,
509-
510- [ ] IsCopy { param_env: ParamEnvAnd <' tcx, Ty <' tcx>> } ,
511- [ ] IsSized { param_env: ParamEnvAnd <' tcx, Ty <' tcx>> } ,
512- [ ] IsFreeze { param_env: ParamEnvAnd <' tcx, Ty <' tcx>> } ,
513- [ ] NeedsDrop { param_env: ParamEnvAnd <' tcx, Ty <' tcx>> } ,
514- [ ] Layout { param_env: ParamEnvAnd <' tcx, Ty <' tcx>> } ,
515-
516- // The set of impls for a given trait.
517- [ ] TraitImpls ( DefId ) ,
518-
519434 [ eval_always] AllLocalTraitImpls ,
520435
521436 [ anon] TraitSelect ,
522437
523- [ ] ParamEnv ( DefId ) ,
524- [ ] DescribeDef ( DefId ) ,
525-
526- // FIXME(mw): DefSpans are not really inputs since they are derived from
527- // HIR. But at the moment HIR hashing still contains some hacks that allow
528- // to make type debuginfo to be source location independent. Declaring
529- // DefSpan an input makes sure that changes to these are always detected
530- // regardless of HIR hashing.
531- [ eval_always] DefSpan ( DefId ) ,
532- [ ] LookupStability ( DefId ) ,
533- [ ] LookupDeprecationEntry ( DefId ) ,
534- [ ] ConstIsRvaluePromotableToStatic ( DefId ) ,
535- [ ] RvaluePromotableMap ( DefId ) ,
536- [ ] ImplParent ( DefId ) ,
537- [ ] TraitOfItem ( DefId ) ,
538- [ ] IsReachableNonGeneric ( DefId ) ,
539- [ ] IsUnreachableLocalDefinition ( DefId ) ,
540- [ ] IsMirAvailable ( DefId ) ,
541- [ ] ItemAttrs ( DefId ) ,
542- [ ] CodegenFnAttrs ( DefId ) ,
543- [ ] FnArgNames ( DefId ) ,
544- [ ] RenderedConst ( DefId ) ,
545- [ ] DylibDepFormats ( CrateNum ) ,
546- [ ] IsCompilerBuiltins ( CrateNum ) ,
547- [ ] HasGlobalAllocator ( CrateNum ) ,
548- [ ] HasPanicHandler ( CrateNum ) ,
549- [ eval_always] ExternCrate ( DefId ) ,
550- [ ] Specializes { impl1: DefId , impl2: DefId } ,
551- [ eval_always] InScopeTraits ( DefIndex ) ,
552- [ eval_always] ModuleExports ( DefId ) ,
553- [ ] IsSanitizerRuntime ( CrateNum ) ,
554- [ ] IsProfilerRuntime ( CrateNum ) ,
555- [ ] GetPanicStrategy ( CrateNum ) ,
556- [ ] IsNoBuiltins ( CrateNum ) ,
557- [ ] ImplDefaultness ( DefId ) ,
558- [ ] CheckItemWellFormed ( DefId ) ,
559- [ ] CheckTraitItemWellFormed ( DefId ) ,
560- [ ] CheckImplItemWellFormed ( DefId ) ,
561- [ ] ReachableNonGenerics ( CrateNum ) ,
562- [ ] EntryFn ( CrateNum ) ,
563- [ ] PluginRegistrarFn ( CrateNum ) ,
564- [ ] ProcMacroDeclsStatic ( CrateNum ) ,
565- [ eval_always] CrateDisambiguator ( CrateNum ) ,
566- [ eval_always] CrateHash ( CrateNum ) ,
567- [ eval_always] OriginalCrateName ( CrateNum ) ,
568- [ eval_always] ExtraFileName ( CrateNum ) ,
569-
570- [ ] ImplementationsOfTrait { krate: CrateNum , trait_id: DefId } ,
571- [ ] AllTraitImplementations ( CrateNum ) ,
572-
573- [ ] DllimportForeignItems ( CrateNum ) ,
574- [ ] IsDllimportForeignItem ( DefId ) ,
575- [ ] IsStaticallyIncludedForeignItem ( DefId ) ,
576- [ ] NativeLibraryKind ( DefId ) ,
577- [ eval_always] LinkArgs ,
578-
579- [ ] ResolveLifetimes ( CrateNum ) ,
580- [ ] NamedRegion ( DefIndex ) ,
581- [ ] IsLateBound ( DefIndex ) ,
582- [ ] ObjectLifetimeDefaults ( DefIndex ) ,
583-
584- [ ] Visibility ( DefId ) ,
585- [ eval_always] DepKind ( CrateNum ) ,
586- [ eval_always] CrateName ( CrateNum ) ,
587- [ ] ItemChildren ( DefId ) ,
588- [ ] ExternModStmtCnum ( DefId ) ,
589- [ eval_always] GetLibFeatures ,
590- [ ] DefinedLibFeatures ( CrateNum ) ,
591- [ eval_always] GetLangItems ,
592- [ ] DefinedLangItems ( CrateNum ) ,
593- [ ] MissingLangItems ( CrateNum ) ,
594- [ ] VisibleParentMap ,
595- [ eval_always] MissingExternCrateItem ( CrateNum ) ,
596- [ eval_always] UsedCrateSource ( CrateNum ) ,
597- [ eval_always] PostorderCnums ,
598-
599- [ eval_always] Freevars ( DefId ) ,
600- [ eval_always] MaybeUnusedTraitImport ( DefId ) ,
601- [ eval_always] MaybeUnusedExternCrates ,
602- [ eval_always] NamesImportedByGlobUse ( DefId ) ,
603- [ eval_always] StabilityIndex ,
604- [ eval_always] AllTraits ,
605- [ eval_always] AllCrateNums ,
606- [ ] ExportedSymbols ( CrateNum ) ,
607- [ eval_always] CollectAndPartitionMonoItems ,
608- [ ] IsCodegenedItem ( DefId ) ,
609- [ ] CodegenUnit ( InternedString ) ,
610- [ ] BackendOptimizationLevel ( CrateNum ) ,
611438 [ ] CompileCodegenUnit ( InternedString ) ,
612- [ eval_always] OutputFilenames ,
613- [ ] NormalizeProjectionTy ( CanonicalProjectionGoal <' tcx>) ,
614- [ ] NormalizeTyAfterErasingRegions ( ParamEnvAnd <' tcx, Ty <' tcx>>) ,
615- [ ] ImpliedOutlivesBounds ( CanonicalTyGoal <' tcx>) ,
616- [ ] DropckOutlives ( CanonicalTyGoal <' tcx>) ,
617- [ ] EvaluateObligation ( CanonicalPredicateGoal <' tcx>) ,
618- [ ] EvaluateGoal ( traits:: ChalkCanonicalGoal <' tcx>) ,
619- [ ] TypeOpAscribeUserType ( CanonicalTypeOpAscribeUserTypeGoal <' tcx>) ,
620- [ ] TypeOpEq ( CanonicalTypeOpEqGoal <' tcx>) ,
621- [ ] TypeOpSubtype ( CanonicalTypeOpSubtypeGoal <' tcx>) ,
622- [ ] TypeOpProvePredicate ( CanonicalTypeOpProvePredicateGoal <' tcx>) ,
623- [ ] TypeOpNormalizeTy ( CanonicalTypeOpNormalizeGoal <' tcx, Ty <' tcx>>) ,
624- [ ] TypeOpNormalizePredicate ( CanonicalTypeOpNormalizeGoal <' tcx, Predicate <' tcx>>) ,
625- [ ] TypeOpNormalizePolyFnSig ( CanonicalTypeOpNormalizeGoal <' tcx, PolyFnSig <' tcx>>) ,
626- [ ] TypeOpNormalizeFnSig ( CanonicalTypeOpNormalizeGoal <' tcx, FnSig <' tcx>>) ,
627-
628- [ ] SubstituteNormalizeAndTestPredicates { key: ( DefId , SubstsRef <' tcx>) } ,
629- [ ] MethodAutoderefSteps ( CanonicalTyGoal <' tcx>) ,
630-
631- [ eval_always] TargetFeaturesWhitelist ,
632-
633- [ ] InstanceDefSizeEstimate { instance_def: InstanceDef <' tcx> } ,
634-
635- [ eval_always] Features ,
636-
637- [ ] ForeignModules ( CrateNum ) ,
638-
639- [ ] UpstreamMonomorphizations ( CrateNum ) ,
640- [ ] UpstreamMonomorphizationsFor ( DefId ) ,
439+
440+ [ eval_always] Analysis ( CrateNum ) ,
641441] ) ;
642442
643443pub trait RecoverKey < ' tcx > : Sized {
@@ -656,6 +456,12 @@ impl RecoverKey<'tcx> for DefId {
656456 }
657457}
658458
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+
659465trait DepNodeParams < ' a , ' gcx : ' tcx + ' a , ' tcx : ' a > : fmt:: Debug {
660466 const CAN_RECONSTRUCT_QUERY_KEY : bool ;
661467
0 commit comments