diff --git a/Cargo.lock b/Cargo.lock index c7007017078e6..4b925203862be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,7 +17,7 @@ dependencies = [ name = "alloc" version = "0.0.0" dependencies = [ - "compiler_builtins 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "compiler_builtins 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "core 0.0.0", "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -107,7 +107,7 @@ version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", - "compiler_builtins 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "compiler_builtins 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-std-workspace-core 1.0.0", ] @@ -465,7 +465,7 @@ dependencies = [ [[package]] name = "compiler_builtins" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", @@ -751,7 +751,7 @@ name = "dlmalloc" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "compiler_builtins 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "compiler_builtins 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-std-workspace-core 1.0.0", ] @@ -917,7 +917,7 @@ name = "fortanix-sgx-abi" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "compiler_builtins 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "compiler_builtins 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-std-workspace-core 1.0.0", ] @@ -1769,7 +1769,7 @@ dependencies = [ name = "panic_abort" version = "0.0.0" dependencies = [ - "compiler_builtins 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "compiler_builtins 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "core 0.0.0", "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1779,7 +1779,7 @@ name = "panic_unwind" version = "0.0.0" dependencies = [ "alloc 0.0.0", - "compiler_builtins 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "compiler_builtins 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "core 0.0.0", "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", "unwind 0.0.0", @@ -1964,7 +1964,7 @@ name = "profiler_builtins" version = "0.0.0" dependencies = [ "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", - "compiler_builtins 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "compiler_builtins 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "core 0.0.0", ] @@ -2054,18 +2054,6 @@ dependencies = [ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rand" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rand" version = "0.6.1" @@ -2093,14 +2081,6 @@ dependencies = [ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rand_core" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rand_core" version = "0.3.0" @@ -2499,7 +2479,7 @@ name = "rustc-demangle" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "compiler_builtins 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "compiler_builtins 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-std-workspace-core 1.0.0", ] @@ -2560,7 +2540,7 @@ version = "1.0.0" dependencies = [ "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2599,7 +2579,7 @@ dependencies = [ "alloc 0.0.0", "build_helper 0.1.0", "cmake 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", - "compiler_builtins 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "compiler_builtins 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "core 0.0.0", ] @@ -2826,7 +2806,7 @@ dependencies = [ "alloc 0.0.0", "build_helper 0.1.0", "cmake 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", - "compiler_builtins 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "compiler_builtins 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "core 0.0.0", ] @@ -2888,7 +2868,7 @@ dependencies = [ "alloc 0.0.0", "build_helper 0.1.0", "cmake 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", - "compiler_builtins 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "compiler_builtins 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "core 0.0.0", ] @@ -3009,7 +2989,7 @@ dependencies = [ "alloc 0.0.0", "build_helper 0.1.0", "cmake 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", - "compiler_builtins 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "compiler_builtins 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "core 0.0.0", ] @@ -3276,7 +3256,7 @@ dependencies = [ "alloc 0.0.0", "backtrace-sys 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", - "compiler_builtins 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "compiler_builtins 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "core 0.0.0", "dlmalloc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "fortanix-sgx-abi 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3849,7 +3829,7 @@ dependencies = [ name = "unwind" version = "0.0.0" dependencies = [ - "compiler_builtins 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "compiler_builtins 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "core 0.0.0", "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4045,7 +4025,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum colored 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b0aa3473e85a3161b59845d6096b289bb577874cafeaf75ea1b1beaa6572c7fc" "checksum commoncrypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d056a8586ba25a1e4d61cb090900e495952c7886786fc55f909ab2f819b69007" "checksum commoncrypto-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1fed34f46747aa73dfaa578069fd8279d2818ade2b55f38f22a9401c7f4083e2" -"checksum compiler_builtins 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "a28c3898d0c57b26fa6f92de141ba665fa5ac5179f795db06db408be84302395" +"checksum compiler_builtins 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d7de11892d9f9f1bc76d43011c8233d27d58300d629dc9dfb51b6626ef7f6077" "checksum compiletest_rs 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "56c799b1f7142badf3b047b4c1f2074cc96b6b784fb2432f2ed9c87da0a03749" "checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" "checksum core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4e2640d6d0bf22e82bed1b73c6aef8d5dd31e5abe6666c57e6d45e2649f4f887" @@ -4205,10 +4185,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c" "checksum racer 2.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "37c88638777cc178684cf648ca0e1dad56646ce105b8593dfe665c436300adc3" "checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd" -"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c" "checksum rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae9d223d52ae411a33cf7e54ec6034ec165df296ccd23533d671a28252b6f66a" "checksum rand_chacha 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "771b009e3a508cb67e8823dda454aaa5368c7bc1c16829fb77d3e980440dd34a" -"checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372" "checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db" "checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" "checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" diff --git a/src/doc/man/rustc.1 b/src/doc/man/rustc.1 index 2faf0c2e3e1fa..3788e3c864e82 100644 --- a/src/doc/man/rustc.1 +++ b/src/doc/man/rustc.1 @@ -261,7 +261,7 @@ full debug info with variable and type information. .RE .TP \fBopt\-level\fR=\fIVAL\fR -Optimize with possible levels 0\[en]3 +Optimize with possible levels 0\[en]3, s (optimize for size), or z (for minimal size) .SH ENVIRONMENT diff --git a/src/librustc/dep_graph/dep_node.rs b/src/librustc/dep_graph/dep_node.rs index 03fa5c04ec721..e5bf9a27ab050 100644 --- a/src/librustc/dep_graph/dep_node.rs +++ b/src/librustc/dep_graph/dep_node.rs @@ -65,8 +65,7 @@ use crate::traits::query::{ CanonicalTypeOpEqGoal, CanonicalTypeOpSubtypeGoal, CanonicalPredicateGoal, CanonicalTypeOpProvePredicateGoal, CanonicalTypeOpNormalizeGoal, }; -use crate::ty::{TyCtxt, FnSig, Instance, InstanceDef, - ParamEnv, ParamEnvAnd, Predicate, PolyFnSig, PolyTraitRef, Ty}; +use crate::ty::{self, TyCtxt, ParamEnvAnd, Ty}; use crate::ty::subst::SubstsRef; // 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> // Represents metadata from an extern crate. [eval_always] CrateMetadata(CrateNum), - // Represents different phases in the compiler. - [] RegionScopeTree(DefId), - [eval_always] Coherence, - [eval_always] CoherenceInherentImplOverlapCheck, - [] CoherenceCheckTrait(DefId), - [eval_always] PrivacyAccessLevels(CrateNum), - [eval_always] CheckPrivateInPublic(CrateNum), - [eval_always] Analysis(CrateNum), - - // Represents the MIR for a fn; also used as the task node for - // things read/modify that MIR. - [] MirShim { instance_def: InstanceDef<'tcx> }, - - [] BorrowCheckKrate, - [] BorrowCheck(DefId), - [] MirBorrowCheck(DefId), - [] UnsafetyCheckResult(DefId), - [] UnsafeDeriveOnReprPacked(DefId), - - [] LintMod(DefId), - [] CheckModAttrs(DefId), - [] CheckModLoops(DefId), - [] CheckModUnstableApiUsage(DefId), - [] CheckModItemTypes(DefId), - [] CheckModPrivacy(DefId), - [] CheckModIntrinsics(DefId), - [] CheckModLiveness(DefId), - [] CheckModImplWf(DefId), - [] CollectModItemTypes(DefId), - - [] Reachability, - [] CrateVariances, - - // Nodes representing bits of computed IR in the tcx. Each shared - // table in the tcx (or elsewhere) maps to one of these - // nodes. - [] AssociatedItems(DefId), - [] ExplicitPredicatesOfItem(DefId), - [] PredicatesDefinedOnItem(DefId), - [] InferredOutlivesOf(DefId), - [] InferredOutlivesCrate(CrateNum), - [] SuperPredicatesOfItem(DefId), - [] TraitDefOfItem(DefId), - [] AdtDefOfItem(DefId), - [] ImplTraitRef(DefId), - [] ImplPolarity(DefId), - [] Issue33140SelfTy(DefId), - [] FnSignature(DefId), - [] CoerceUnsizedInfo(DefId), - - [] ItemVarianceConstraints(DefId), - [] ItemVariances(DefId), - [] IsConstFn(DefId), - [] IsPromotableConstFn(DefId), - [] IsForeignItem(DefId), - [] TypeParamPredicates { item_id: DefId, param_id: DefId }, - [] SizedConstraint(DefId), - [] DtorckConstraint(DefId), - [] AdtDestructor(DefId), - [] AssociatedItemDefIds(DefId), - [eval_always] InherentImpls(DefId), - [] TypeckBodiesKrate, - [] TypeckTables(DefId), - [] UsedTraitImports(DefId), - [] HasTypeckTables(DefId), - [] ConstEval { param_env: ParamEnvAnd<'tcx, GlobalId<'tcx>> }, - [] ConstEvalRaw { param_env: ParamEnvAnd<'tcx, GlobalId<'tcx>> }, - [] CheckMatch(DefId), - [] SymbolName { instance: Instance<'tcx> }, - [] SpecializationGraph(DefId), - [] ObjectSafety(DefId), - [] FulfillObligation { param_env: ParamEnv<'tcx>, trait_ref: PolyTraitRef<'tcx> }, - [] VtableMethods { trait_ref: PolyTraitRef<'tcx> }, - - [] IsCopy { param_env: ParamEnvAnd<'tcx, Ty<'tcx>> }, - [] IsSized { param_env: ParamEnvAnd<'tcx, Ty<'tcx>> }, - [] IsFreeze { param_env: ParamEnvAnd<'tcx, Ty<'tcx>> }, - [] NeedsDrop { param_env: ParamEnvAnd<'tcx, Ty<'tcx>> }, - [] Layout { param_env: ParamEnvAnd<'tcx, Ty<'tcx>> }, - - // The set of impls for a given trait. - [] TraitImpls(DefId), - [eval_always] AllLocalTraitImpls, [anon] TraitSelect, - [] ParamEnv(DefId), - [] DescribeDef(DefId), - - // FIXME(mw): DefSpans are not really inputs since they are derived from - // HIR. But at the moment HIR hashing still contains some hacks that allow - // to make type debuginfo to be source location independent. Declaring - // DefSpan an input makes sure that changes to these are always detected - // regardless of HIR hashing. - [eval_always] DefSpan(DefId), - [] LookupStability(DefId), - [] LookupDeprecationEntry(DefId), - [] ConstIsRvaluePromotableToStatic(DefId), - [] RvaluePromotableMap(DefId), - [] ImplParent(DefId), - [] TraitOfItem(DefId), - [] IsReachableNonGeneric(DefId), - [] IsUnreachableLocalDefinition(DefId), - [] IsMirAvailable(DefId), - [] ItemAttrs(DefId), - [] CodegenFnAttrs(DefId), - [] FnArgNames(DefId), - [] RenderedConst(DefId), - [] DylibDepFormats(CrateNum), - [] IsCompilerBuiltins(CrateNum), - [] HasGlobalAllocator(CrateNum), - [] HasPanicHandler(CrateNum), - [eval_always] ExternCrate(DefId), - [] Specializes { impl1: DefId, impl2: DefId }, - [eval_always] InScopeTraits(DefIndex), - [eval_always] ModuleExports(DefId), - [] IsSanitizerRuntime(CrateNum), - [] IsProfilerRuntime(CrateNum), - [] GetPanicStrategy(CrateNum), - [] IsNoBuiltins(CrateNum), - [] ImplDefaultness(DefId), - [] CheckItemWellFormed(DefId), - [] CheckTraitItemWellFormed(DefId), - [] CheckImplItemWellFormed(DefId), - [] ReachableNonGenerics(CrateNum), - [] EntryFn(CrateNum), - [] PluginRegistrarFn(CrateNum), - [] ProcMacroDeclsStatic(CrateNum), - [eval_always] CrateDisambiguator(CrateNum), - [eval_always] CrateHash(CrateNum), - [eval_always] OriginalCrateName(CrateNum), - [eval_always] ExtraFileName(CrateNum), - - [] ImplementationsOfTrait { krate: CrateNum, trait_id: DefId }, - [] AllTraitImplementations(CrateNum), - - [] DllimportForeignItems(CrateNum), - [] IsDllimportForeignItem(DefId), - [] IsStaticallyIncludedForeignItem(DefId), - [] NativeLibraryKind(DefId), - [eval_always] LinkArgs, - - [] ResolveLifetimes(CrateNum), - [] NamedRegion(DefIndex), - [] IsLateBound(DefIndex), - [] ObjectLifetimeDefaults(DefIndex), - - [] Visibility(DefId), - [eval_always] DepKind(CrateNum), - [eval_always] CrateName(CrateNum), - [] ItemChildren(DefId), - [] ExternModStmtCnum(DefId), - [eval_always] GetLibFeatures, - [] DefinedLibFeatures(CrateNum), - [eval_always] GetLangItems, - [] DefinedLangItems(CrateNum), - [] MissingLangItems(CrateNum), - [] VisibleParentMap, - [eval_always] MissingExternCrateItem(CrateNum), - [eval_always] UsedCrateSource(CrateNum), - [eval_always] PostorderCnums, - - [eval_always] Freevars(DefId), - [eval_always] MaybeUnusedTraitImport(DefId), - [eval_always] MaybeUnusedExternCrates, - [eval_always] NamesImportedByGlobUse(DefId), - [eval_always] StabilityIndex, - [eval_always] AllTraits, - [eval_always] AllCrateNums, - [] ExportedSymbols(CrateNum), - [eval_always] CollectAndPartitionMonoItems, - [] IsCodegenedItem(DefId), - [] CodegenUnit(InternedString), - [] BackendOptimizationLevel(CrateNum), [] CompileCodegenUnit(InternedString), - [eval_always] OutputFilenames, - [] NormalizeProjectionTy(CanonicalProjectionGoal<'tcx>), - [] NormalizeTyAfterErasingRegions(ParamEnvAnd<'tcx, Ty<'tcx>>), - [] ImpliedOutlivesBounds(CanonicalTyGoal<'tcx>), - [] DropckOutlives(CanonicalTyGoal<'tcx>), - [] EvaluateObligation(CanonicalPredicateGoal<'tcx>), - [] EvaluateGoal(traits::ChalkCanonicalGoal<'tcx>), - [] TypeOpAscribeUserType(CanonicalTypeOpAscribeUserTypeGoal<'tcx>), - [] TypeOpEq(CanonicalTypeOpEqGoal<'tcx>), - [] TypeOpSubtype(CanonicalTypeOpSubtypeGoal<'tcx>), - [] TypeOpProvePredicate(CanonicalTypeOpProvePredicateGoal<'tcx>), - [] TypeOpNormalizeTy(CanonicalTypeOpNormalizeGoal<'tcx, Ty<'tcx>>), - [] TypeOpNormalizePredicate(CanonicalTypeOpNormalizeGoal<'tcx, Predicate<'tcx>>), - [] TypeOpNormalizePolyFnSig(CanonicalTypeOpNormalizeGoal<'tcx, PolyFnSig<'tcx>>), - [] TypeOpNormalizeFnSig(CanonicalTypeOpNormalizeGoal<'tcx, FnSig<'tcx>>), - - [] SubstituteNormalizeAndTestPredicates { key: (DefId, SubstsRef<'tcx>) }, - [] MethodAutoderefSteps(CanonicalTyGoal<'tcx>), - - [eval_always] TargetFeaturesWhitelist, - - [] InstanceDefSizeEstimate { instance_def: InstanceDef<'tcx> }, - - [eval_always] Features, - - [] ForeignModules(CrateNum), - - [] UpstreamMonomorphizations(CrateNum), - [] UpstreamMonomorphizationsFor(DefId), + + [eval_always] Analysis(CrateNum), ]); pub trait RecoverKey<'tcx>: Sized { @@ -655,6 +456,12 @@ impl RecoverKey<'tcx> for DefId { } } +impl RecoverKey<'tcx> for DefIndex { + fn recover(tcx: TyCtxt<'_, 'tcx, 'tcx>, dep_node: &DepNode) -> Option { + dep_node.extract_def_id(tcx).map(|id| id.index) + } +} + trait DepNodeParams<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> : fmt::Debug { const CAN_RECONSTRUCT_QUERY_KEY: bool; diff --git a/src/librustc/query/mod.rs b/src/librustc/query/mod.rs index 8d64818f49b18..8896f9f972881 100644 --- a/src/librustc/query/mod.rs +++ b/src/librustc/query/mod.rs @@ -1,10 +1,21 @@ use crate::ty::query::QueryDescription; use crate::ty::query::queries; -use crate::ty::{self, Ty, TyCtxt}; -use crate::hir::def_id::{DefId, CrateNum}; +use crate::ty::{self, ParamEnvAnd, Ty, TyCtxt}; +use crate::ty::subst::SubstsRef; use crate::dep_graph::SerializedDepNodeIndex; +use crate::hir::def_id::{CrateNum, DefId, DefIndex}; +use crate::mir::interpret::GlobalId; use crate::traits; +use crate::traits::query::{ + CanonicalPredicateGoal, CanonicalProjectionGoal, + CanonicalTyGoal, CanonicalTypeOpAscribeUserTypeGoal, + CanonicalTypeOpEqGoal, CanonicalTypeOpSubtypeGoal, CanonicalTypeOpProvePredicateGoal, + CanonicalTypeOpNormalizeGoal, +}; + use std::borrow::Cow; +use syntax_pos::symbol::InternedString; + // Each of these queries corresponds to a function pointer field in the // `Providers` struct for requesting a value of that type, and a method @@ -148,4 +159,911 @@ rustc_queries! { desc { "wasm import module map" } } } + + Other { + /// Maps from the `DefId` of an item (trait/struct/enum/fn) to the + /// predicates (where-clauses) directly defined on it. This is + /// equal to the `explicit_predicates_of` predicates plus the + /// `inferred_outlives_of` predicates. + query predicates_defined_on(_: DefId) + -> Lrc> {} + + /// Returns the predicates written explicit by the user. + query explicit_predicates_of(_: DefId) + -> Lrc> {} + + /// Returns the inferred outlives predicates (e.g., for `struct + /// Foo<'a, T> { x: &'a T }`, this would return `T: 'a`). + query inferred_outlives_of(_: DefId) -> Lrc>> {} + + /// Maps from the `DefId` of a trait to the list of + /// super-predicates. This is a subset of the full list of + /// predicates. We store these in a separate map because we must + /// evaluate them even during type conversion, often before the + /// full predicates are available (note that supertraits have + /// additional acyclicity requirements). + query super_predicates_of(key: DefId) -> Lrc> { + desc { |tcx| "computing the supertraits of `{}`", tcx.def_path_str(key) } + } + + /// To avoid cycles within the predicates of a single item we compute + /// per-type-parameter predicates for resolving `T::AssocTy`. + query type_param_predicates(key: (DefId, DefId)) + -> Lrc> { + no_force + desc { |tcx| "computing the bounds for type parameter `{}`", { + let id = tcx.hir().as_local_hir_id(key.1).unwrap(); + tcx.hir().ty_param_name(id) + }} + } + + query trait_def(_: DefId) -> &'tcx ty::TraitDef {} + query adt_def(_: DefId) -> &'tcx ty::AdtDef {} + query adt_destructor(_: DefId) -> Option {} + + // The cycle error here should be reported as an error by `check_representable`. + // We consider the type as Sized in the meanwhile to avoid + // further errors (done in impl Value for AdtSizedConstraint). + // Use `cycle_delay_bug` to delay the cycle error here to be emitted later + // in case we accidentally otherwise don't emit an error. + query adt_sized_constraint( + _: DefId + ) -> AdtSizedConstraint<'tcx> { + cycle_delay_bug + } + + query adt_dtorck_constraint( + _: DefId + ) -> Result, NoSolution> {} + + /// True if this is a const fn, use the `is_const_fn` to know whether your crate actually + /// sees it as const fn (e.g., the const-fn-ness might be unstable and you might not have + /// the feature gate active) + /// + /// **Do not call this function manually.** It is only meant to cache the base data for the + /// `is_const_fn` function. + query is_const_fn_raw(key: DefId) -> bool { + desc { |tcx| "checking if item is const fn: `{}`", tcx.def_path_str(key) } + } + + /// Returns true if calls to the function may be promoted + /// + /// This is either because the function is e.g., a tuple-struct or tuple-variant + /// constructor, or because it has the `#[rustc_promotable]` attribute. The attribute should + /// be removed in the future in favour of some form of check which figures out whether the + /// function does not inspect the bits of any of its arguments (so is essentially just a + /// constructor function). + query is_promotable_const_fn(_: DefId) -> bool {} + + /// True if this is a foreign item (i.e., linked via `extern { ... }`). + query is_foreign_item(_: DefId) -> bool {} + + /// Get a map with the variance of every item; use `item_variance` + /// instead. + query crate_variances(_: CrateNum) -> Lrc { + desc { "computing the variances for items in this crate" } + } + + /// Maps from def-id of a type or region parameter to its + /// (inferred) variance. + query variances_of(_: DefId) -> Lrc> {} + } + + TypeChecking { + /// Maps from def-id of a type to its (inferred) outlives. + query inferred_outlives_crate(_: CrateNum) + -> Lrc> { + desc { "computing the inferred outlives predicates for items in this crate" } + } + } + + Other { + /// Maps from an impl/trait def-id to a list of the def-ids of its items + query associated_item_def_ids(_: DefId) -> Lrc> {} + + /// Maps from a trait item to the trait item "descriptor" + query associated_item(_: DefId) -> ty::AssociatedItem {} + + query impl_trait_ref(_: DefId) -> Option> {} + query impl_polarity(_: DefId) -> hir::ImplPolarity {} + + query issue33140_self_ty(_: DefId) -> Option> {} + } + + TypeChecking { + /// Maps a DefId of a type to a list of its inherent impls. + /// Contains implementations of methods that are inherent to a type. + /// Methods in these implementations don't need to be exported. + query inherent_impls(_: DefId) -> Lrc> { + eval_always + } + } + + TypeChecking { + /// The result of unsafety-checking this `DefId`. + query unsafety_check_result(_: DefId) -> mir::UnsafetyCheckResult {} + + /// HACK: when evaluated, this reports a "unsafe derive on repr(packed)" error + query unsafe_derive_on_repr_packed(_: DefId) -> () {} + + /// The signature of functions and closures. + query fn_sig(_: DefId) -> ty::PolyFnSig<'tcx> {} + } + + Other { + query lint_mod(key: DefId) -> () { + desc { |tcx| "linting {}", key.describe_as_module(tcx) } + } + + /// Checks the attributes in the module + query check_mod_attrs(key: DefId) -> () { + desc { |tcx| "checking attributes in {}", key.describe_as_module(tcx) } + } + + query check_mod_unstable_api_usage(key: DefId) -> () { + desc { |tcx| "checking for unstable API usage in {}", key.describe_as_module(tcx) } + } + + /// Checks the loops in the module + query check_mod_loops(key: DefId) -> () { + desc { |tcx| "checking loops in {}", key.describe_as_module(tcx) } + } + + query check_mod_item_types(key: DefId) -> () { + desc { |tcx| "checking item types in {}", key.describe_as_module(tcx) } + } + + query check_mod_privacy(key: DefId) -> () { + desc { |tcx| "checking privacy in {}", key.describe_as_module(tcx) } + } + + query check_mod_intrinsics(key: DefId) -> () { + desc { |tcx| "checking intrinsics in {}", key.describe_as_module(tcx) } + } + + query check_mod_liveness(key: DefId) -> () { + desc { |tcx| "checking liveness of variables in {}", key.describe_as_module(tcx) } + } + + query check_mod_impl_wf(key: DefId) -> () { + desc { |tcx| "checking that impls are well-formed in {}", key.describe_as_module(tcx) } + } + + query collect_mod_item_types(key: DefId) -> () { + desc { |tcx| "collecting item types in {}", key.describe_as_module(tcx) } + } + + /// Caches CoerceUnsized kinds for impls on custom types. + query coerce_unsized_info(_: DefId) + -> ty::adjustment::CoerceUnsizedInfo {} + } + + TypeChecking { + query typeck_item_bodies(_: CrateNum) -> () { + desc { "type-checking all item bodies" } + } + + query typeck_tables_of(key: DefId) -> &'tcx ty::TypeckTables<'tcx> { + cache { key.is_local() } + load_cached(tcx, id) { + let typeck_tables: Option> = tcx + .queries.on_disk_cache + .try_load_query_result(tcx, id); + + typeck_tables.map(|tables| tcx.alloc_tables(tables)) + } + } + } + + Other { + query used_trait_imports(_: DefId) -> Lrc {} + } + + TypeChecking { + query has_typeck_tables(_: DefId) -> bool {} + + query coherent_trait(def_id: DefId) -> () { + no_force + desc { |tcx| "coherence checking all impls of trait `{}`", tcx.def_path_str(def_id) } + } + } + + BorrowChecking { + query borrowck(_: DefId) -> Lrc {} + + /// Borrow checks the function body. If this is a closure, returns + /// additional requirements that the closure's creator must verify. + query mir_borrowck(_: DefId) -> mir::BorrowCheckResult<'tcx> {} + } + + TypeChecking { + /// Gets a complete map from all types to their inherent impls. + /// Not meant to be used directly outside of coherence. + /// (Defined only for `LOCAL_CRATE`.) + query crate_inherent_impls(k: CrateNum) + -> Lrc { + eval_always + desc { "all inherent impls defined in crate `{:?}`", k } + } + + /// Checks all types in the crate for overlap in their inherent impls. Reports errors. + /// Not meant to be used directly outside of coherence. + /// (Defined only for `LOCAL_CRATE`.) + query crate_inherent_impls_overlap_check(_: CrateNum) + -> () { + eval_always + desc { "check for overlap between inherent impls defined in this crate" } + } + } + + Other { + /// Evaluate a constant without running sanity checks + /// + /// **Do not use this** outside const eval. Const eval uses this to break query cycles + /// during validation. Please add a comment to every use site explaining why using + /// `const_eval` isn't sufficient + query const_eval_raw(key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>) + -> ConstEvalRawResult<'tcx> { + no_force + desc { |tcx| + "const-evaluating `{}`", + tcx.def_path_str(key.value.instance.def.def_id()) + } + cache { true } + load_cached(tcx, id) { + tcx.queries.on_disk_cache.try_load_query_result(tcx, id).map(Ok) + } + } + + /// Results of evaluating const items or constants embedded in + /// other items (such as enum variant explicit discriminants). + query const_eval(key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>) + -> ConstEvalResult<'tcx> { + no_force + desc { |tcx| + "const-evaluating + checking `{}`", + tcx.def_path_str(key.value.instance.def.def_id()) + } + cache { true } + load_cached(tcx, id) { + tcx.queries.on_disk_cache.try_load_query_result(tcx, id).map(Ok) + } + } + } + + TypeChecking { + query check_match(_: DefId) -> () {} + + /// Performs part of the privacy check and computes "access levels". + query privacy_access_levels(_: CrateNum) -> Lrc { + eval_always + desc { "privacy access levels" } + } + query check_private_in_public(_: CrateNum) -> () { + eval_always + desc { "checking for private elements in public interfaces" } + } + } + + Other { + query reachable_set(_: CrateNum) -> ReachableSet { + desc { "reachability" } + } + + /// Per-body `region::ScopeTree`. The `DefId` should be the owner `DefId` for the body; + /// in the case of closures, this will be redirected to the enclosing function. + query region_scope_tree(_: DefId) -> Lrc {} + + query mir_shims(key: ty::InstanceDef<'tcx>) -> &'tcx mir::Mir<'tcx> { + no_force + desc { |tcx| "generating MIR shim for `{}`", tcx.def_path_str(key.def_id()) } + } + + query symbol_name(key: ty::Instance<'tcx>) -> ty::SymbolName { + no_force + desc { "computing the symbol for `{}`", key } + cache { true } + } + + query describe_def(_: DefId) -> Option {} + query def_span(_: DefId) -> Span { + // FIXME(mw): DefSpans are not really inputs since they are derived from + // HIR. But at the moment HIR hashing still contains some hacks that allow + // to make type debuginfo to be source location independent. Declaring + // DefSpan an input makes sure that changes to these are always detected + // regardless of HIR hashing. + eval_always + } + query lookup_stability(_: DefId) -> Option<&'tcx attr::Stability> {} + query lookup_deprecation_entry(_: DefId) -> Option {} + query item_attrs(_: DefId) -> Lrc<[ast::Attribute]> {} + } + + Codegen { + query codegen_fn_attrs(_: DefId) -> CodegenFnAttrs {} + } + + Other { + query fn_arg_names(_: DefId) -> Vec {} + /// Gets the rendered value of the specified constant or associated constant. + /// Used by rustdoc. + query rendered_const(_: DefId) -> String {} + query impl_parent(_: DefId) -> Option {} + } + + TypeChecking { + query trait_of_item(_: DefId) -> Option {} + query const_is_rvalue_promotable_to_static(key: DefId) -> bool { + desc { |tcx| + "const checking if rvalue is promotable to static `{}`", + tcx.def_path_str(key) + } + cache { true } + } + query rvalue_promotable_map(key: DefId) -> Lrc { + desc { |tcx| + "checking which parts of `{}` are promotable to static", + tcx.def_path_str(key) + } + } + } + + Codegen { + query is_mir_available(key: DefId) -> bool { + desc { |tcx| "checking if item has mir available: `{}`", tcx.def_path_str(key) } + } + } + + Other { + query vtable_methods(key: ty::PolyTraitRef<'tcx>) + -> Lrc)>>> { + no_force + desc { |tcx| "finding all methods for trait {}", tcx.def_path_str(key.def_id()) } + } + } + + Codegen { + query codegen_fulfill_obligation( + key: (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>) + ) -> Vtable<'tcx, ()> { + no_force + cache { true } + desc { |tcx| + "checking if `{}` fulfills its obligations", + tcx.def_path_str(key.1.def_id()) + } + } + } + + TypeChecking { + query trait_impls_of(key: DefId) -> Lrc { + desc { |tcx| "trait impls of `{}`", tcx.def_path_str(key) } + } + query specialization_graph_of(_: DefId) + -> Lrc {} + query is_object_safe(key: DefId) -> bool { + desc { |tcx| "determine object safety of trait `{}`", tcx.def_path_str(key) } + } + + /// Gets the ParameterEnvironment for a given item; this environment + /// will be in "user-facing" mode, meaning that it is suitabe for + /// type-checking etc, and it does not normalize specializable + /// associated types. This is almost always what you want, + /// unless you are doing MIR optimizations, in which case you + /// might want to use `reveal_all()` method to change modes. + query param_env(_: DefId) -> ty::ParamEnv<'tcx> {} + + /// Trait selection queries. These are best used by invoking `ty.is_copy_modulo_regions()`, + /// `ty.is_copy()`, etc, since that will prune the environment where possible. + query is_copy_raw(env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool { + no_force + desc { "computing whether `{}` is `Copy`", env.value } + } + query is_sized_raw(env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool { + no_force + desc { "computing whether `{}` is `Sized`", env.value } + } + query is_freeze_raw(env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool { + no_force + desc { "computing whether `{}` is freeze", env.value } + } + + // The cycle error here should be reported as an error by `check_representable`. + // We consider the type as not needing drop in the meanwhile to avoid + // further errors (done in impl Value for NeedsDrop). + // Use `cycle_delay_bug` to delay the cycle error here to be emitted later + // in case we accidentally otherwise don't emit an error. + query needs_drop_raw(env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> NeedsDrop { + cycle_delay_bug + no_force + desc { "computing whether `{}` needs drop", env.value } + } + + query layout_raw( + env: ty::ParamEnvAnd<'tcx, Ty<'tcx>> + ) -> Result<&'tcx ty::layout::LayoutDetails, ty::layout::LayoutError<'tcx>> { + no_force + desc { "computing layout of `{}`", env.value } + } + } + + Other { + query dylib_dependency_formats(_: CrateNum) + -> Lrc> { + desc { "dylib dependency formats of crate" } + } + } + + Codegen { + query is_compiler_builtins(_: CrateNum) -> bool { + fatal_cycle + desc { "checking if the crate is_compiler_builtins" } + } + query has_global_allocator(_: CrateNum) -> bool { + fatal_cycle + desc { "checking if the crate has_global_allocator" } + } + query has_panic_handler(_: CrateNum) -> bool { + fatal_cycle + desc { "checking if the crate has_panic_handler" } + } + query is_sanitizer_runtime(_: CrateNum) -> bool { + fatal_cycle + desc { "query a crate is #![sanitizer_runtime]" } + } + query is_profiler_runtime(_: CrateNum) -> bool { + fatal_cycle + desc { "query a crate is #![profiler_runtime]" } + } + query panic_strategy(_: CrateNum) -> PanicStrategy { + fatal_cycle + desc { "query a crate's configured panic strategy" } + } + query is_no_builtins(_: CrateNum) -> bool { + fatal_cycle + desc { "test whether a crate has #![no_builtins]" } + } + + query extern_crate(_: DefId) -> Lrc> { + eval_always + desc { "getting crate's ExternCrateData" } + } + } + + TypeChecking { + query specializes(_: (DefId, DefId)) -> bool { + no_force + desc { "computing whether impls specialize one another" } + } + query in_scope_traits_map(_: DefIndex) + -> Option>>>> { + eval_always + desc { "traits in scope at a block" } + } + } + + Other { + query module_exports(_: DefId) -> Option>> { + eval_always + } + } + + TypeChecking { + query impl_defaultness(_: DefId) -> hir::Defaultness {} + + query check_item_well_formed(_: DefId) -> () {} + query check_trait_item_well_formed(_: DefId) -> () {} + query check_impl_item_well_formed(_: DefId) -> () {} + } + + Linking { + // The DefIds of all non-generic functions and statics in the given crate + // that can be reached from outside the crate. + // + // We expect this items to be available for being linked to. + // + // This query can also be called for LOCAL_CRATE. In this case it will + // compute which items will be reachable to other crates, taking into account + // the kind of crate that is currently compiled. Crates with only a + // C interface have fewer reachable things. + // + // Does not include external symbols that don't have a corresponding DefId, + // like the compiler-generated `main` function and so on. + query reachable_non_generics(_: CrateNum) + -> Lrc> { + desc { "looking up the exported symbols of a crate" } + } + query is_reachable_non_generic(_: DefId) -> bool {} + query is_unreachable_local_definition(_: DefId) -> bool {} + } + + Codegen { + query upstream_monomorphizations( + k: CrateNum + ) -> Lrc, CrateNum>>>> { + desc { "collecting available upstream monomorphizations `{:?}`", k } + } + query upstream_monomorphizations_for(_: DefId) + -> Option, CrateNum>>> {} + } + + Other { + query foreign_modules(_: CrateNum) -> Lrc> { + desc { "looking up the foreign modules of a linked crate" } + } + + /// Identifies the entry-point (e.g., the `main` function) for a given + /// crate, returning `None` if there is no entry point (such as for library crates). + query entry_fn(_: CrateNum) -> Option<(DefId, EntryFnType)> { + desc { "looking up the entry function of a crate" } + } + query plugin_registrar_fn(_: CrateNum) -> Option { + desc { "looking up the plugin registrar for a crate" } + } + query proc_macro_decls_static(_: CrateNum) -> Option { + desc { "looking up the derive registrar for a crate" } + } + query crate_disambiguator(_: CrateNum) -> CrateDisambiguator { + eval_always + desc { "looking up the disambiguator a crate" } + } + query crate_hash(_: CrateNum) -> Svh { + eval_always + desc { "looking up the hash a crate" } + } + query original_crate_name(_: CrateNum) -> Symbol { + eval_always + desc { "looking up the original name a crate" } + } + query extra_filename(_: CrateNum) -> String { + eval_always + desc { "looking up the extra filename for a crate" } + } + } + + TypeChecking { + query implementations_of_trait(_: (CrateNum, DefId)) + -> Lrc> { + no_force + desc { "looking up implementations of a trait in a crate" } + } + query all_trait_implementations(_: CrateNum) + -> Lrc> { + desc { "looking up all (?) trait implementations" } + } + } + + Other { + query dllimport_foreign_items(_: CrateNum) + -> Lrc> { + desc { "dllimport_foreign_items" } + } + query is_dllimport_foreign_item(_: DefId) -> bool {} + query is_statically_included_foreign_item(_: DefId) -> bool {} + query native_library_kind(_: DefId) + -> Option {} + } + + Linking { + query link_args(_: CrateNum) -> Lrc> { + eval_always + desc { "looking up link arguments for a crate" } + } + } + + BorrowChecking { + // Lifetime resolution. See `middle::resolve_lifetimes`. + query resolve_lifetimes(_: CrateNum) -> Lrc { + desc { "resolving lifetimes" } + } + query named_region_map(_: DefIndex) -> + Option>> { + desc { "looking up a named region" } + } + query is_late_bound_map(_: DefIndex) -> + Option>> { + desc { "testing if a region is late bound" } + } + query object_lifetime_defaults_map(_: DefIndex) + -> Option>>>> { + desc { "looking up lifetime defaults for a region" } + } + } + + TypeChecking { + query visibility(_: DefId) -> ty::Visibility {} + } + + Other { + query dep_kind(_: CrateNum) -> DepKind { + eval_always + desc { "fetching what a dependency looks like" } + } + query crate_name(_: CrateNum) -> Symbol { + eval_always + desc { "fetching what a crate is named" } + } + query item_children(_: DefId) -> Lrc> {} + query extern_mod_stmt_cnum(_: DefId) -> Option {} + + query get_lib_features(_: CrateNum) -> Lrc { + eval_always + desc { "calculating the lib features map" } + } + query defined_lib_features(_: CrateNum) + -> Lrc)>> { + desc { "calculating the lib features defined in a crate" } + } + query get_lang_items(_: CrateNum) -> Lrc { + eval_always + desc { "calculating the lang items map" } + } + query defined_lang_items(_: CrateNum) -> Lrc> { + desc { "calculating the lang items defined in a crate" } + } + query missing_lang_items(_: CrateNum) -> Lrc> { + desc { "calculating the missing lang items in a crate" } + } + query visible_parent_map(_: CrateNum) + -> Lrc> { + desc { "calculating the visible parent map" } + } + query missing_extern_crate_item(_: CrateNum) -> bool { + eval_always + desc { "seeing if we're missing an `extern crate` item for this crate" } + } + query used_crate_source(_: CrateNum) -> Lrc { + eval_always + desc { "looking at the source for a crate" } + } + query postorder_cnums(_: CrateNum) -> Lrc> { + eval_always + desc { "generating a postorder list of CrateNums" } + } + + query freevars(_: DefId) -> Option>> { + eval_always + } + query maybe_unused_trait_import(_: DefId) -> bool { + eval_always + } + query maybe_unused_extern_crates(_: CrateNum) + -> Lrc> { + eval_always + desc { "looking up all possibly unused extern crates" } + } + query names_imported_by_glob_use(_: DefId) + -> Lrc> { + eval_always + } + + query stability_index(_: CrateNum) -> Lrc> { + eval_always + desc { "calculating the stability index for the local crate" } + } + query all_crate_nums(_: CrateNum) -> Lrc> { + eval_always + desc { "fetching all foreign CrateNum instances" } + } + + /// A vector of every trait accessible in the whole crate + /// (i.e., including those from subcrates). This is used only for + /// error reporting. + query all_traits(_: CrateNum) -> Lrc> { + desc { "fetching all foreign and local traits" } + } + } + + Linking { + query exported_symbols(_: CrateNum) + -> Arc, SymbolExportLevel)>> { + desc { "exported_symbols" } + } + } + + Codegen { + query collect_and_partition_mono_items(_: CrateNum) + -> (Arc, Arc>>>) { + eval_always + desc { "collect_and_partition_mono_items" } + } + query is_codegened_item(_: DefId) -> bool {} + query codegen_unit(_: InternedString) -> Arc> { + no_force + desc { "codegen_unit" } + } + query backend_optimization_level(_: CrateNum) -> OptLevel { + desc { "optimization level used by backend" } + } + } + + Other { + query output_filenames(_: CrateNum) -> Arc { + eval_always + desc { "output_filenames" } + } + } + + TypeChecking { + /// Do not call this query directly: invoke `normalize` instead. + query normalize_projection_ty( + goal: CanonicalProjectionGoal<'tcx> + ) -> Result< + Lrc>>>, + NoSolution, + > { + no_force + desc { "normalizing `{:?}`", goal } + } + + /// Do not call this query directly: invoke `normalize_erasing_regions` instead. + query normalize_ty_after_erasing_regions( + goal: ParamEnvAnd<'tcx, Ty<'tcx>> + ) -> Ty<'tcx> { + no_force + desc { "normalizing `{:?}`", goal } + } + + query implied_outlives_bounds( + goal: CanonicalTyGoal<'tcx> + ) -> Result< + Lrc>>>>, + NoSolution, + > { + no_force + desc { "computing implied outlives bounds for `{:?}`", goal } + } + + /// Do not call this query directly: invoke `infcx.at().dropck_outlives()` instead. + query dropck_outlives( + goal: CanonicalTyGoal<'tcx> + ) -> Result< + Lrc>>>, + NoSolution, + > { + no_force + desc { "computing dropck types for `{:?}`", goal } + } + + /// Do not call this query directly: invoke `infcx.predicate_may_hold()` or + /// `infcx.predicate_must_hold()` instead. + query evaluate_obligation( + goal: CanonicalPredicateGoal<'tcx> + ) -> Result { + no_force + desc { "evaluating trait selection obligation `{}`", goal.value.value } + } + + query evaluate_goal( + goal: traits::ChalkCanonicalGoal<'tcx> + ) -> Result< + Lrc>>, + NoSolution + > { + no_force + desc { "evaluating trait selection obligation `{}`", goal.value.goal } + } + + /// Do not call this query directly: part of the `Eq` type-op + query type_op_ascribe_user_type( + goal: CanonicalTypeOpAscribeUserTypeGoal<'tcx> + ) -> Result< + Lrc>>, + NoSolution, + > { + no_force + desc { "evaluating `type_op_ascribe_user_type` `{:?}`", goal } + } + + /// Do not call this query directly: part of the `Eq` type-op + query type_op_eq( + goal: CanonicalTypeOpEqGoal<'tcx> + ) -> Result< + Lrc>>, + NoSolution, + > { + no_force + desc { "evaluating `type_op_eq` `{:?}`", goal } + } + + /// Do not call this query directly: part of the `Subtype` type-op + query type_op_subtype( + goal: CanonicalTypeOpSubtypeGoal<'tcx> + ) -> Result< + Lrc>>, + NoSolution, + > { + no_force + desc { "evaluating `type_op_subtype` `{:?}`", goal } + } + + /// Do not call this query directly: part of the `ProvePredicate` type-op + query type_op_prove_predicate( + goal: CanonicalTypeOpProvePredicateGoal<'tcx> + ) -> Result< + Lrc>>, + NoSolution, + > { + no_force + desc { "evaluating `type_op_prove_predicate` `{:?}`", goal } + } + + /// Do not call this query directly: part of the `Normalize` type-op + query type_op_normalize_ty( + goal: CanonicalTypeOpNormalizeGoal<'tcx, Ty<'tcx>> + ) -> Result< + Lrc>>>, + NoSolution, + > { + no_force + desc { "normalizing `{:?}`", goal } + } + + /// Do not call this query directly: part of the `Normalize` type-op + query type_op_normalize_predicate( + goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::Predicate<'tcx>> + ) -> Result< + Lrc>>>, + NoSolution, + > { + no_force + desc { "normalizing `{:?}`", goal } + } + + /// Do not call this query directly: part of the `Normalize` type-op + query type_op_normalize_poly_fn_sig( + goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::PolyFnSig<'tcx>> + ) -> Result< + Lrc>>>, + NoSolution, + > { + no_force + desc { "normalizing `{:?}`", goal } + } + + /// Do not call this query directly: part of the `Normalize` type-op + query type_op_normalize_fn_sig( + goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::FnSig<'tcx>> + ) -> Result< + Lrc>>>, + NoSolution, + > { + no_force + desc { "normalizing `{:?}`", goal } + } + + query substitute_normalize_and_test_predicates(key: (DefId, SubstsRef<'tcx>)) -> bool { + no_force + desc { |tcx| + "testing substituted normalized predicates:`{}`", + tcx.def_path_str(key.0) + } + } + + query method_autoderef_steps( + goal: CanonicalTyGoal<'tcx> + ) -> MethodAutoderefStepsResult<'tcx> { + no_force + desc { "computing autoderef types for `{:?}`", goal } + } + } + + Other { + query target_features_whitelist(_: CrateNum) -> Lrc>> { + eval_always + desc { "looking up the whitelist of target features" } + } + + // Get an estimate of the size of an InstanceDef based on its MIR for CGU partitioning. + query instance_def_size_estimate(def: ty::InstanceDef<'tcx>) + -> usize { + no_force + desc { |tcx| "estimating size for `{}`", tcx.def_path_str(def.def_id()) } + } + + query features_query(_: CrateNum) -> Lrc { + eval_always + desc { "looking up enabled feature gates" } + } + } } diff --git a/src/librustc/ty/query/config.rs b/src/librustc/ty/query/config.rs index bc5caffb93464..73b7902797242 100644 --- a/src/librustc/ty/query/config.rs +++ b/src/librustc/ty/query/config.rs @@ -1,15 +1,7 @@ use crate::dep_graph::SerializedDepNodeIndex; use crate::dep_graph::DepNode; -use crate::hir::def_id::{CrateNum, DefId, DefIndex}; -use crate::mir::interpret::GlobalId; -use crate::traits; -use crate::traits::query::{ - CanonicalPredicateGoal, CanonicalProjectionGoal, CanonicalTyGoal, - CanonicalTypeOpAscribeUserTypeGoal, CanonicalTypeOpEqGoal, CanonicalTypeOpNormalizeGoal, - CanonicalTypeOpProvePredicateGoal, CanonicalTypeOpSubtypeGoal, -}; -use crate::ty::{self, ParamEnvAnd, Ty, TyCtxt}; -use crate::ty::subst::SubstsRef; +use crate::hir::def_id::{CrateNum, DefId}; +use crate::ty::TyCtxt; use crate::ty::query::queries; use crate::ty::query::Query; use crate::ty::query::QueryCache; @@ -19,7 +11,6 @@ use crate::util::profiling::ProfileCategory; use std::borrow::Cow; use std::hash::Hash; use std::fmt::Debug; -use syntax_pos::symbol::InternedString; use rustc_data_structures::sync::Lock; use rustc_data_structures::fingerprint::Fingerprint; use crate::ich::StableHashingContext; @@ -79,843 +70,12 @@ impl<'tcx, M: QueryAccessors<'tcx, Key=DefId>> QueryDescription<'tcx> for M { } } -impl<'tcx> QueryDescription<'tcx> for queries::check_mod_attrs<'tcx> { - fn describe( - tcx: TyCtxt<'_, '_, '_>, - key: DefId, - ) -> Cow<'static, str> { - format!("checking attributes in {}", key.describe_as_module(tcx)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::check_mod_unstable_api_usage<'tcx> { - fn describe( - tcx: TyCtxt<'_, '_, '_>, - key: DefId, - ) -> Cow<'static, str> { - format!("checking for unstable API usage in {}", key.describe_as_module(tcx)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::check_mod_loops<'tcx> { - fn describe( - tcx: TyCtxt<'_, '_, '_>, - key: DefId, - ) -> Cow<'static, str> { - format!("checking loops in {}", key.describe_as_module(tcx)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::check_mod_item_types<'tcx> { - fn describe( - tcx: TyCtxt<'_, '_, '_>, - key: DefId, - ) -> Cow<'static, str> { - format!("checking item types in {}", key.describe_as_module(tcx)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::check_mod_privacy<'tcx> { - fn describe( - tcx: TyCtxt<'_, '_, '_>, - key: DefId, - ) -> Cow<'static, str> { - format!("checking privacy in {}", key.describe_as_module(tcx)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::check_mod_intrinsics<'tcx> { - fn describe( - tcx: TyCtxt<'_, '_, '_>, - key: DefId, - ) -> Cow<'static, str> { - format!("checking intrinsics in {}", key.describe_as_module(tcx)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::check_mod_liveness<'tcx> { - fn describe( - tcx: TyCtxt<'_, '_, '_>, - key: DefId, - ) -> Cow<'static, str> { - format!("checking liveness of variables in {}", key.describe_as_module(tcx)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::check_mod_impl_wf<'tcx> { - fn describe( - tcx: TyCtxt<'_, '_, '_>, - key: DefId, - ) -> Cow<'static, str> { - format!("checking that impls are well-formed in {}", key.describe_as_module(tcx)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::collect_mod_item_types<'tcx> { - fn describe( - tcx: TyCtxt<'_, '_, '_>, - key: DefId, - ) -> Cow<'static, str> { - format!("collecting item types in {}", key.describe_as_module(tcx)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::normalize_projection_ty<'tcx> { - fn describe( - _tcx: TyCtxt<'_, '_, '_>, - goal: CanonicalProjectionGoal<'tcx>, - ) -> Cow<'static, str> { - format!("normalizing `{:?}`", goal).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::implied_outlives_bounds<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalTyGoal<'tcx>) -> Cow<'static, str> { - format!("computing implied outlives bounds for `{:?}`", goal).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::dropck_outlives<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalTyGoal<'tcx>) -> Cow<'static, str> { - format!("computing dropck types for `{:?}`", goal).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::normalize_ty_after_erasing_regions<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: ParamEnvAnd<'tcx, Ty<'tcx>>) -> Cow<'static, str> { - format!("normalizing `{:?}`", goal).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::evaluate_obligation<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalPredicateGoal<'tcx>) -> Cow<'static, str> { - format!("evaluating trait selection obligation `{}`", goal.value.value).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::evaluate_goal<'tcx> { - fn describe( - _tcx: TyCtxt<'_, '_, '_>, - goal: traits::ChalkCanonicalGoal<'tcx> - ) -> Cow<'static, str> { - format!("evaluating trait selection obligation `{}`", goal.value.goal).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::type_op_ascribe_user_type<'tcx> { - fn describe( - _tcx: TyCtxt<'_, '_, '_>, - goal: CanonicalTypeOpAscribeUserTypeGoal<'tcx>, - ) -> Cow<'static, str> { - format!("evaluating `type_op_ascribe_user_type` `{:?}`", goal).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::type_op_eq<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalTypeOpEqGoal<'tcx>) -> Cow<'static, str> { - format!("evaluating `type_op_eq` `{:?}`", goal).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::type_op_subtype<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalTypeOpSubtypeGoal<'tcx>) - -> Cow<'static, str> { - format!("evaluating `type_op_subtype` `{:?}`", goal).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::type_op_prove_predicate<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalTypeOpProvePredicateGoal<'tcx>) - -> Cow<'static, str> { - format!("evaluating `type_op_prove_predicate` `{:?}`", goal).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::type_op_normalize_ty<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, - goal: CanonicalTypeOpNormalizeGoal<'tcx, Ty<'tcx>>) -> Cow<'static, str> { - format!("normalizing `{:?}`", goal).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::type_op_normalize_predicate<'tcx> { - fn describe( - _tcx: TyCtxt<'_, '_, '_>, - goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::Predicate<'tcx>>, - ) -> Cow<'static, str> { - format!("normalizing `{:?}`", goal).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::type_op_normalize_poly_fn_sig<'tcx> { - fn describe( - _tcx: TyCtxt<'_, '_, '_>, - goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::PolyFnSig<'tcx>>, - ) -> Cow<'static, str> { - format!("normalizing `{:?}`", goal).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::type_op_normalize_fn_sig<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, - goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::FnSig<'tcx>>) -> Cow<'static, str> { - format!("normalizing `{:?}`", goal).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::is_copy_raw<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) - -> Cow<'static, str> { - format!("computing whether `{}` is `Copy`", env.value).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::is_sized_raw<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) - -> Cow<'static, str> { - format!("computing whether `{}` is `Sized`", env.value).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::is_freeze_raw<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) - -> Cow<'static, str> { - format!("computing whether `{}` is freeze", env.value).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::needs_drop_raw<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) - -> Cow<'static, str> { - format!("computing whether `{}` needs drop", env.value).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::layout_raw<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) - -> Cow<'static, str> { - format!("computing layout of `{}`", env.value).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::super_predicates_of<'tcx> { - fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> { - format!("computing the supertraits of `{}`", - tcx.def_path_str(def_id)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::type_param_predicates<'tcx> { - fn describe(tcx: TyCtxt<'_, '_, '_>, (_, def_id): (DefId, DefId)) -> Cow<'static, str> { - let id = tcx.hir().as_local_hir_id(def_id).unwrap(); - format!("computing the bounds for type parameter `{}`", - tcx.hir().ty_param_name(id)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::coherent_trait<'tcx> { - fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> { - format!("coherence checking all impls of trait `{}`", - tcx.def_path_str(def_id)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::upstream_monomorphizations<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, k: CrateNum) -> Cow<'static, str> { - format!("collecting available upstream monomorphizations `{:?}`", k).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::crate_inherent_impls<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, k: CrateNum) -> Cow<'static, str> { - format!("all inherent impls defined in crate `{:?}`", k).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::crate_inherent_impls_overlap_check<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "check for overlap between inherent impls defined in this crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::crate_variances<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "computing the variances for items in this crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::inferred_outlives_crate<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "computing the inferred outlives predicates for items in this crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::mir_shims<'tcx> { - fn describe(tcx: TyCtxt<'_, '_, '_>, def: ty::InstanceDef<'tcx>) -> Cow<'static, str> { - format!("generating MIR shim for `{}`", - tcx.def_path_str(def.def_id())).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::privacy_access_levels<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "privacy access levels".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::check_private_in_public<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "checking for private elements in public interfaces".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::typeck_item_bodies<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "type-checking all item bodies".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::reachable_set<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "reachability".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::const_eval<'tcx> { - fn describe( - tcx: TyCtxt<'_, '_, '_>, - key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>, - ) -> Cow<'static, str> { - format!( - "const-evaluating + checking `{}`", - tcx.def_path_str(key.value.instance.def.def_id()), - ).into() - } - - #[inline] - fn cache_on_disk(_: TyCtxt<'_, 'tcx, 'tcx>, _key: Self::Key) -> bool { - true - } - - #[inline] - fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, - id: SerializedDepNodeIndex) - -> Option { - tcx.queries.on_disk_cache.try_load_query_result(tcx, id).map(Ok) - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::const_eval_raw<'tcx> { - fn describe(tcx: TyCtxt<'_, '_, '_>, key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>) - -> Cow<'static, str> - { - format!("const-evaluating `{}`", tcx.def_path_str(key.value.instance.def.def_id())).into() - } - - #[inline] - fn cache_on_disk(_: TyCtxt<'_, 'tcx, 'tcx>, _key: Self::Key) -> bool { - true - } - - #[inline] - fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, - id: SerializedDepNodeIndex) - -> Option { - tcx.queries.on_disk_cache.try_load_query_result(tcx, id).map(Ok) - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::symbol_name<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, instance: ty::Instance<'tcx>) -> Cow<'static, str> { - format!("computing the symbol for `{}`", instance).into() - } - - #[inline] - fn cache_on_disk(_: TyCtxt<'_, 'tcx, 'tcx>, _: Self::Key) -> bool { - true - } - - #[inline] - fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, - id: SerializedDepNodeIndex) - -> Option { - tcx.queries.on_disk_cache.try_load_query_result(tcx, id) - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::describe_def<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> Cow<'static, str> { - bug!("describe_def") - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::def_span<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> Cow<'static, str> { - bug!("def_span") - } -} - - -impl<'tcx> QueryDescription<'tcx> for queries::lookup_stability<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> Cow<'static, str> { - bug!("stability") - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::lookup_deprecation_entry<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> Cow<'static, str> { - bug!("deprecation") - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::item_attrs<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> Cow<'static, str> { - bug!("item_attrs") - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::is_reachable_non_generic<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> Cow<'static, str> { - bug!("is_reachable_non_generic") - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::fn_arg_names<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> Cow<'static, str> { - bug!("fn_arg_names") - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::impl_parent<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> Cow<'static, str> { - bug!("impl_parent") - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::trait_of_item<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> Cow<'static, str> { - bug!("trait_of_item") - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::const_is_rvalue_promotable_to_static<'tcx> { - fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> { - format!("const checking if rvalue is promotable to static `{}`", - tcx.def_path_str(def_id)).into() - } - - #[inline] - fn cache_on_disk(_: TyCtxt<'_, 'tcx, 'tcx>, _: Self::Key) -> bool { - true - } - - #[inline] - fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, - id: SerializedDepNodeIndex) - -> Option { - tcx.queries.on_disk_cache.try_load_query_result(tcx, id) - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::rvalue_promotable_map<'tcx> { - fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> { - format!("checking which parts of `{}` are promotable to static", - tcx.def_path_str(def_id)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::is_mir_available<'tcx> { - fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> { - format!("checking if item is mir available: `{}`", - tcx.def_path_str(def_id)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::codegen_fulfill_obligation<'tcx> { - fn describe(tcx: TyCtxt<'_, '_, '_>, - key: (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>)) -> Cow<'static, str> { - format!("checking if `{}` fulfills its obligations", tcx.def_path_str(key.1.def_id())) - .into() - } - - #[inline] - fn cache_on_disk(_: TyCtxt<'_, 'tcx, 'tcx>, _: Self::Key) -> bool { - true - } - - #[inline] - fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, - id: SerializedDepNodeIndex) - -> Option { - tcx.queries.on_disk_cache.try_load_query_result(tcx, id) - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::trait_impls_of<'tcx> { - fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> { - format!("trait impls of `{}`", tcx.def_path_str(def_id)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::is_object_safe<'tcx> { - fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> { - format!("determine object safety of trait `{}`", tcx.def_path_str(def_id)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::is_const_fn_raw<'tcx> { - fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Cow<'static, str> { - format!("checking if item is const fn: `{}`", tcx.def_path_str(def_id)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::dylib_dependency_formats<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "dylib dependency formats of crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::is_compiler_builtins<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "checking if the crate is_compiler_builtins".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::has_global_allocator<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "checking if the crate has_global_allocator".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::has_panic_handler<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "checking if the crate has_panic_handler".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::extern_crate<'tcx> { - fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> Cow<'static, str> { - "getting crate's ExternCrateData".into() - } -} - impl<'tcx> QueryDescription<'tcx> for queries::analysis<'tcx> { fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { "running analysis passes on this crate".into() } } -impl<'tcx> QueryDescription<'tcx> for queries::specializes<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: (DefId, DefId)) -> Cow<'static, str> { - "computing whether impls specialize one another".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::in_scope_traits_map<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: DefIndex) -> Cow<'static, str> { - "traits in scope at a block".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::is_no_builtins<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "test whether a crate has #![no_builtins]".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::panic_strategy<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "query a crate's configured panic strategy".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::is_profiler_runtime<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "query a crate is #![profiler_runtime]".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::is_sanitizer_runtime<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "query a crate is #![sanitizer_runtime]".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::reachable_non_generics<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "looking up the exported symbols of a crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::foreign_modules<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "looking up the foreign modules of a linked crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::entry_fn<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "looking up the entry function of a crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::plugin_registrar_fn<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "looking up the plugin registrar for a crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::proc_macro_decls_static<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "looking up the derive registrar for a crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::crate_disambiguator<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "looking up the disambiguator a crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::crate_hash<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "looking up the hash a crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::original_crate_name<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "looking up the original name a crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::extra_filename<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "looking up the extra filename for a crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::implementations_of_trait<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: (CrateNum, DefId)) -> Cow<'static, str> { - "looking up implementations of a trait in a crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::all_trait_implementations<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "looking up all (?) trait implementations".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::link_args<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "looking up link arguments for a crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::resolve_lifetimes<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "resolving lifetimes".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::named_region_map<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: DefIndex) -> Cow<'static, str> { - "looking up a named region".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::is_late_bound_map<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: DefIndex) -> Cow<'static, str> { - "testing if a region is late bound".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::object_lifetime_defaults_map<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: DefIndex) -> Cow<'static, str> { - "looking up lifetime defaults for a region".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::dep_kind<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "fetching what a dependency looks like".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::crate_name<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "fetching what a crate is named".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::get_lib_features<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "calculating the lib features map".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::defined_lib_features<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "calculating the lib features defined in a crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::get_lang_items<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "calculating the lang items map".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::defined_lang_items<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "calculating the lang items defined in a crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::missing_lang_items<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "calculating the missing lang items in a crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::visible_parent_map<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "calculating the visible parent map".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::missing_extern_crate_item<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "seeing if we're missing an `extern crate` item for this crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::used_crate_source<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "looking at the source for a crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::postorder_cnums<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "generating a postorder list of CrateNums".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::maybe_unused_extern_crates<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "looking up all possibly unused extern crates".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::stability_index<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "calculating the stability index for the local crate".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::all_traits<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "fetching all foreign and local traits".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::all_crate_nums<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "fetching all foreign CrateNum instances".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::exported_symbols<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "exported_symbols".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::collect_and_partition_mono_items<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "collect_and_partition_mono_items".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::codegen_unit<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: InternedString) -> Cow<'static, str> { - "codegen_unit".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::output_filenames<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "output_filenames".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::vtable_methods<'tcx> { - fn describe(tcx: TyCtxt<'_, '_, '_>, key: ty::PolyTraitRef<'tcx> ) -> Cow<'static, str> { - format!("finding all methods for trait {}", tcx.def_path_str(key.def_id())).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::features_query<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "looking up enabled feature gates".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::typeck_tables_of<'tcx> { - #[inline] - fn cache_on_disk(_: TyCtxt<'_, 'tcx, 'tcx>, def_id: Self::Key) -> bool { - def_id.is_local() - } - - fn try_load_from_disk(tcx: TyCtxt<'_, 'tcx, 'tcx>, - id: SerializedDepNodeIndex) - -> Option { - let typeck_tables: Option> = tcx - .queries.on_disk_cache - .try_load_query_result(tcx, id); - - typeck_tables.map(|tables| tcx.alloc_tables(tables)) - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::substitute_normalize_and_test_predicates<'tcx> { - fn describe(tcx: TyCtxt<'_, '_, '_>, key: (DefId, SubstsRef<'tcx>)) -> Cow<'static, str> { - format!("testing substituted normalized predicates:`{}`", tcx.def_path_str(key.0)).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::method_autoderef_steps<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalTyGoal<'tcx>) -> Cow<'static, str> { - format!("computing autoderef types for `{:?}`", goal).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::target_features_whitelist<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "looking up the whitelist of target features".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::instance_def_size_estimate<'tcx> { - fn describe(tcx: TyCtxt<'_, '_, '_>, def: ty::InstanceDef<'tcx>) -> Cow<'static, str> { - format!("estimating size for `{}`", tcx.def_path_str(def.def_id())).into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::dllimport_foreign_items<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "dllimport_foreign_items".into() - } -} - -impl<'tcx> QueryDescription<'tcx> for queries::backend_optimization_level<'tcx> { - fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> Cow<'static, str> { - "optimization level used by backend".into() - } -} - macro_rules! impl_disk_cacheable_query( ($query_name:ident, |$tcx:tt, $key:tt| $cond:expr) => { impl<'tcx> QueryDescription<'tcx> for queries::$query_name<'tcx> { diff --git a/src/librustc/ty/query/mod.rs b/src/librustc/ty/query/mod.rs index f64156beeaa2d..c4bc35fff66b8 100644 --- a/src/librustc/ty/query/mod.rs +++ b/src/librustc/ty/query/mod.rs @@ -1,4 +1,4 @@ -use crate::dep_graph::{self, DepConstructor, DepNode}; +use crate::dep_graph::{self, DepNode}; use crate::hir::def_id::{CrateNum, DefId, DefIndex}; use crate::hir::def::{Def, Export}; use crate::hir::{self, TraitCandidate, ItemLocalId, CodegenFnAttrs}; @@ -104,738 +104,5 @@ rustc_query_append! { [define_queries!][ <'tcx> /// Run analysis passes on the crate [] fn analysis: Analysis(CrateNum) -> Result<(), ErrorReported>, - /// Maps from the `DefId` of an item (trait/struct/enum/fn) to the - /// predicates (where-clauses) directly defined on it. This is - /// equal to the `explicit_predicates_of` predicates plus the - /// `inferred_outlives_of` predicates. - [] fn predicates_defined_on: PredicatesDefinedOnItem(DefId) - -> Lrc>, - - /// Returns the predicates written explicit by the user. - [] fn explicit_predicates_of: ExplicitPredicatesOfItem(DefId) - -> Lrc>, - - /// Returns the inferred outlives predicates (e.g., for `struct - /// Foo<'a, T> { x: &'a T }`, this would return `T: 'a`). - [] fn inferred_outlives_of: InferredOutlivesOf(DefId) -> Lrc>>, - - /// Maps from the `DefId` of a trait to the list of - /// super-predicates. This is a subset of the full list of - /// predicates. We store these in a separate map because we must - /// evaluate them even during type conversion, often before the - /// full predicates are available (note that supertraits have - /// additional acyclicity requirements). - [] fn super_predicates_of: SuperPredicatesOfItem(DefId) -> Lrc>, - - /// To avoid cycles within the predicates of a single item we compute - /// per-type-parameter predicates for resolving `T::AssocTy`. - [] fn type_param_predicates: type_param_predicates((DefId, DefId)) - -> Lrc>, - - [] fn trait_def: TraitDefOfItem(DefId) -> &'tcx ty::TraitDef, - [] fn adt_def: AdtDefOfItem(DefId) -> &'tcx ty::AdtDef, - [] fn adt_destructor: AdtDestructor(DefId) -> Option, - - // The cycle error here should be reported as an error by `check_representable`. - // We consider the type as Sized in the meanwhile to avoid - // further errors (done in impl Value for AdtSizedConstraint). - // Use `cycle_delay_bug` to delay the cycle error here to be emitted later - // in case we accidentally otherwise don't emit an error. - [cycle_delay_bug] fn adt_sized_constraint: SizedConstraint( - DefId - ) -> AdtSizedConstraint<'tcx>, - - [] fn adt_dtorck_constraint: DtorckConstraint( - DefId - ) -> Result, NoSolution>, - - /// True if this is a const fn, use the `is_const_fn` to know whether your crate actually - /// sees it as const fn (e.g., the const-fn-ness might be unstable and you might not have - /// the feature gate active) - /// - /// **Do not call this function manually.** It is only meant to cache the base data for the - /// `is_const_fn` function. - [] fn is_const_fn_raw: IsConstFn(DefId) -> bool, - - - /// Returns true if calls to the function may be promoted - /// - /// This is either because the function is e.g., a tuple-struct or tuple-variant - /// constructor, or because it has the `#[rustc_promotable]` attribute. The attribute should - /// be removed in the future in favour of some form of check which figures out whether the - /// function does not inspect the bits of any of its arguments (so is essentially just a - /// constructor function). - [] fn is_promotable_const_fn: IsPromotableConstFn(DefId) -> bool, - - /// True if this is a foreign item (i.e., linked via `extern { ... }`). - [] fn is_foreign_item: IsForeignItem(DefId) -> bool, - - /// Get a map with the variance of every item; use `item_variance` - /// instead. - [] fn crate_variances: crate_variances(CrateNum) -> Lrc, - - /// Maps from def-id of a type or region parameter to its - /// (inferred) variance. - [] fn variances_of: ItemVariances(DefId) -> Lrc>, - }, - - TypeChecking { - /// Maps from def-id of a type to its (inferred) outlives. - [] fn inferred_outlives_crate: InferredOutlivesCrate(CrateNum) - -> Lrc>, - }, - - Other { - /// Maps from an impl/trait def-id to a list of the def-ids of its items - [] fn associated_item_def_ids: AssociatedItemDefIds(DefId) -> Lrc>, - - /// Maps from a trait item to the trait item "descriptor" - [] fn associated_item: AssociatedItems(DefId) -> ty::AssociatedItem, - - [] fn impl_trait_ref: ImplTraitRef(DefId) -> Option>, - [] fn impl_polarity: ImplPolarity(DefId) -> hir::ImplPolarity, - - [] fn issue33140_self_ty: Issue33140SelfTy(DefId) -> Option>, - }, - - TypeChecking { - /// Maps a DefId of a type to a list of its inherent impls. - /// Contains implementations of methods that are inherent to a type. - /// Methods in these implementations don't need to be exported. - [] fn inherent_impls: InherentImpls(DefId) -> Lrc>, - }, - - TypeChecking { - /// The result of unsafety-checking this `DefId`. - [] fn unsafety_check_result: UnsafetyCheckResult(DefId) -> mir::UnsafetyCheckResult, - - /// HACK: when evaluated, this reports a "unsafe derive on repr(packed)" error - [] fn unsafe_derive_on_repr_packed: UnsafeDeriveOnReprPacked(DefId) -> (), - - /// The signature of functions and closures. - [] fn fn_sig: FnSignature(DefId) -> ty::PolyFnSig<'tcx>, - }, - - Other { - [] fn lint_mod: LintMod(DefId) -> (), - - /// Checks the attributes in the module - [] fn check_mod_attrs: CheckModAttrs(DefId) -> (), - - [] fn check_mod_unstable_api_usage: CheckModUnstableApiUsage(DefId) -> (), - - /// Checks the loops in the module - [] fn check_mod_loops: CheckModLoops(DefId) -> (), - - [] fn check_mod_item_types: CheckModItemTypes(DefId) -> (), - - [] fn check_mod_privacy: CheckModPrivacy(DefId) -> (), - - [] fn check_mod_intrinsics: CheckModIntrinsics(DefId) -> (), - - [] fn check_mod_liveness: CheckModLiveness(DefId) -> (), - - [] fn check_mod_impl_wf: CheckModImplWf(DefId) -> (), - - [] fn collect_mod_item_types: CollectModItemTypes(DefId) -> (), - - /// Caches CoerceUnsized kinds for impls on custom types. - [] fn coerce_unsized_info: CoerceUnsizedInfo(DefId) - -> ty::adjustment::CoerceUnsizedInfo, - }, - - TypeChecking { - [] fn typeck_item_bodies: - typeck_item_bodies_dep_node(CrateNum) -> (), - - [] fn typeck_tables_of: TypeckTables(DefId) -> &'tcx ty::TypeckTables<'tcx>, - }, - - Other { - [] fn used_trait_imports: UsedTraitImports(DefId) -> Lrc, - }, - - TypeChecking { - [] fn has_typeck_tables: HasTypeckTables(DefId) -> bool, - - [] fn coherent_trait: CoherenceCheckTrait(DefId) -> (), - }, - - BorrowChecking { - [] fn borrowck: BorrowCheck(DefId) -> Lrc, - - /// Borrow checks the function body. If this is a closure, returns - /// additional requirements that the closure's creator must verify. - [] fn mir_borrowck: MirBorrowCheck(DefId) -> mir::BorrowCheckResult<'tcx>, - }, - - TypeChecking { - /// Gets a complete map from all types to their inherent impls. - /// Not meant to be used directly outside of coherence. - /// (Defined only for `LOCAL_CRATE`.) - [] fn crate_inherent_impls: crate_inherent_impls_dep_node(CrateNum) - -> Lrc, - - /// Checks all types in the crate for overlap in their inherent impls. Reports errors. - /// Not meant to be used directly outside of coherence. - /// (Defined only for `LOCAL_CRATE`.) - [] fn crate_inherent_impls_overlap_check: inherent_impls_overlap_check_dep_node(CrateNum) - -> (), - }, - - Other { - /// Evaluate a constant without running sanity checks - /// - /// **Do not use this** outside const eval. Const eval uses this to break query cycles - /// during validation. Please add a comment to every use site explaining why using - /// `const_eval` isn't sufficient - [] fn const_eval_raw: const_eval_raw_dep_node(ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>) - -> ConstEvalRawResult<'tcx>, - - /// Results of evaluating const items or constants embedded in - /// other items (such as enum variant explicit discriminants). - [] fn const_eval: const_eval_dep_node(ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>) - -> ConstEvalResult<'tcx>, - }, - - TypeChecking { - [] fn check_match: CheckMatch(DefId) -> (), - - /// Performs part of the privacy check and computes "access levels". - [] fn privacy_access_levels: PrivacyAccessLevels(CrateNum) -> Lrc, - [] fn check_private_in_public: CheckPrivateInPublic(CrateNum) -> (), - }, - - Other { - [] fn reachable_set: reachability_dep_node(CrateNum) -> ReachableSet, - - /// Per-body `region::ScopeTree`. The `DefId` should be the owner `DefId` for the body; - /// in the case of closures, this will be redirected to the enclosing function. - [] fn region_scope_tree: RegionScopeTree(DefId) -> Lrc, - - [] fn mir_shims: mir_shim_dep_node(ty::InstanceDef<'tcx>) -> &'tcx mir::Mir<'tcx>, - - [] fn symbol_name: symbol_name_dep_node(ty::Instance<'tcx>) -> ty::SymbolName, - - [] fn describe_def: DescribeDef(DefId) -> Option, - [] fn def_span: DefSpan(DefId) -> Span, - [] fn lookup_stability: LookupStability(DefId) -> Option<&'tcx attr::Stability>, - [] fn lookup_deprecation_entry: LookupDeprecationEntry(DefId) -> Option, - [] fn item_attrs: ItemAttrs(DefId) -> Lrc<[ast::Attribute]>, - }, - - Codegen { - [] fn codegen_fn_attrs: codegen_fn_attrs(DefId) -> CodegenFnAttrs, - }, - - Other { - [] fn fn_arg_names: FnArgNames(DefId) -> Vec, - /// Gets the rendered value of the specified constant or associated constant. - /// Used by rustdoc. - [] fn rendered_const: RenderedConst(DefId) -> String, - [] fn impl_parent: ImplParent(DefId) -> Option, - }, - - TypeChecking { - [] fn trait_of_item: TraitOfItem(DefId) -> Option, - [] fn const_is_rvalue_promotable_to_static: ConstIsRvaluePromotableToStatic(DefId) -> bool, - [] fn rvalue_promotable_map: RvaluePromotableMap(DefId) -> Lrc, - }, - - Codegen { - [] fn is_mir_available: IsMirAvailable(DefId) -> bool, - }, - - Other { - [] fn vtable_methods: vtable_methods_node(ty::PolyTraitRef<'tcx>) - -> Lrc)>>>, - }, - - Codegen { - [] fn codegen_fulfill_obligation: fulfill_obligation_dep_node( - (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>)) -> Vtable<'tcx, ()>, - }, - - TypeChecking { - [] fn trait_impls_of: TraitImpls(DefId) -> Lrc, - [] fn specialization_graph_of: SpecializationGraph(DefId) - -> Lrc, - [] fn is_object_safe: ObjectSafety(DefId) -> bool, - - /// Gets the ParameterEnvironment for a given item; this environment - /// will be in "user-facing" mode, meaning that it is suitabe for - /// type-checking etc, and it does not normalize specializable - /// associated types. This is almost always what you want, - /// unless you are doing MIR optimizations, in which case you - /// might want to use `reveal_all()` method to change modes. - [] fn param_env: ParamEnv(DefId) -> ty::ParamEnv<'tcx>, - - /// Trait selection queries. These are best used by invoking `ty.is_copy_modulo_regions()`, - /// `ty.is_copy()`, etc, since that will prune the environment where possible. - [] fn is_copy_raw: is_copy_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool, - [] fn is_sized_raw: is_sized_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool, - [] fn is_freeze_raw: is_freeze_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool, - - // The cycle error here should be reported as an error by `check_representable`. - // We consider the type as not needing drop in the meanwhile to avoid - // further errors (done in impl Value for NeedsDrop). - // Use `cycle_delay_bug` to delay the cycle error here to be emitted later - // in case we accidentally otherwise don't emit an error. - [cycle_delay_bug] fn needs_drop_raw: needs_drop_dep_node( - ty::ParamEnvAnd<'tcx, Ty<'tcx>> - ) -> NeedsDrop, - - [] fn layout_raw: layout_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) - -> Result<&'tcx ty::layout::LayoutDetails, - ty::layout::LayoutError<'tcx>>, - }, - - Other { - [] fn dylib_dependency_formats: DylibDepFormats(CrateNum) - -> Lrc>, - }, - - Codegen { - [fatal_cycle] fn is_compiler_builtins: IsCompilerBuiltins(CrateNum) -> bool, - [fatal_cycle] fn has_global_allocator: HasGlobalAllocator(CrateNum) -> bool, - [fatal_cycle] fn has_panic_handler: HasPanicHandler(CrateNum) -> bool, - [fatal_cycle] fn is_sanitizer_runtime: IsSanitizerRuntime(CrateNum) -> bool, - [fatal_cycle] fn is_profiler_runtime: IsProfilerRuntime(CrateNum) -> bool, - [fatal_cycle] fn panic_strategy: GetPanicStrategy(CrateNum) -> PanicStrategy, - [fatal_cycle] fn is_no_builtins: IsNoBuiltins(CrateNum) -> bool, - - [] fn extern_crate: ExternCrate(DefId) -> Lrc>, - }, - - TypeChecking { - [] fn specializes: specializes_node((DefId, DefId)) -> bool, - [] fn in_scope_traits_map: InScopeTraits(DefIndex) - -> Option>>>>, - }, - - Other { - [] fn module_exports: ModuleExports(DefId) -> Option>>, - }, - - TypeChecking { - [] fn impl_defaultness: ImplDefaultness(DefId) -> hir::Defaultness, - - [] fn check_item_well_formed: CheckItemWellFormed(DefId) -> (), - [] fn check_trait_item_well_formed: CheckTraitItemWellFormed(DefId) -> (), - [] fn check_impl_item_well_formed: CheckImplItemWellFormed(DefId) -> (), - }, - - Linking { - // The DefIds of all non-generic functions and statics in the given crate - // that can be reached from outside the crate. - // - // We expect this items to be available for being linked to. - // - // This query can also be called for LOCAL_CRATE. In this case it will - // compute which items will be reachable to other crates, taking into account - // the kind of crate that is currently compiled. Crates with only a - // C interface have fewer reachable things. - // - // Does not include external symbols that don't have a corresponding DefId, - // like the compiler-generated `main` function and so on. - [] fn reachable_non_generics: ReachableNonGenerics(CrateNum) - -> Lrc>, - [] fn is_reachable_non_generic: IsReachableNonGeneric(DefId) -> bool, - [] fn is_unreachable_local_definition: IsUnreachableLocalDefinition(DefId) -> bool, - }, - - Codegen { - [] fn upstream_monomorphizations: UpstreamMonomorphizations(CrateNum) - -> Lrc, CrateNum>>>>, - [] fn upstream_monomorphizations_for: UpstreamMonomorphizationsFor(DefId) - -> Option, CrateNum>>>, - }, - - Other { - [] fn foreign_modules: ForeignModules(CrateNum) -> Lrc>, - - /// Identifies the entry-point (e.g., the `main` function) for a given - /// crate, returning `None` if there is no entry point (such as for library crates). - [] fn entry_fn: EntryFn(CrateNum) -> Option<(DefId, EntryFnType)>, - [] fn plugin_registrar_fn: PluginRegistrarFn(CrateNum) -> Option, - [] fn proc_macro_decls_static: ProcMacroDeclsStatic(CrateNum) -> Option, - [] fn crate_disambiguator: CrateDisambiguator(CrateNum) -> CrateDisambiguator, - [] fn crate_hash: CrateHash(CrateNum) -> Svh, - [] fn original_crate_name: OriginalCrateName(CrateNum) -> Symbol, - [] fn extra_filename: ExtraFileName(CrateNum) -> String, - }, - - TypeChecking { - [] fn implementations_of_trait: implementations_of_trait_node((CrateNum, DefId)) - -> Lrc>, - [] fn all_trait_implementations: AllTraitImplementations(CrateNum) - -> Lrc>, - }, - - Other { - [] fn dllimport_foreign_items: DllimportForeignItems(CrateNum) - -> Lrc>, - [] fn is_dllimport_foreign_item: IsDllimportForeignItem(DefId) -> bool, - [] fn is_statically_included_foreign_item: IsStaticallyIncludedForeignItem(DefId) -> bool, - [] fn native_library_kind: NativeLibraryKind(DefId) - -> Option, - }, - - Linking { - [] fn link_args: link_args_node(CrateNum) -> Lrc>, - }, - - BorrowChecking { - // Lifetime resolution. See `middle::resolve_lifetimes`. - [] fn resolve_lifetimes: ResolveLifetimes(CrateNum) -> Lrc, - [] fn named_region_map: NamedRegion(DefIndex) -> - Option>>, - [] fn is_late_bound_map: IsLateBound(DefIndex) -> - Option>>, - [] fn object_lifetime_defaults_map: ObjectLifetimeDefaults(DefIndex) - -> Option>>>>, - }, - - TypeChecking { - [] fn visibility: Visibility(DefId) -> ty::Visibility, - }, - - Other { - [] fn dep_kind: DepKind(CrateNum) -> DepKind, - [] fn crate_name: CrateName(CrateNum) -> Symbol, - [] fn item_children: ItemChildren(DefId) -> Lrc>, - [] fn extern_mod_stmt_cnum: ExternModStmtCnum(DefId) -> Option, - - [] fn get_lib_features: get_lib_features_node(CrateNum) -> Lrc, - [] fn defined_lib_features: DefinedLibFeatures(CrateNum) - -> Lrc)>>, - [] fn get_lang_items: get_lang_items_node(CrateNum) -> Lrc, - [] fn defined_lang_items: DefinedLangItems(CrateNum) -> Lrc>, - [] fn missing_lang_items: MissingLangItems(CrateNum) -> Lrc>, - [] fn visible_parent_map: visible_parent_map_node(CrateNum) - -> Lrc>, - [] fn missing_extern_crate_item: MissingExternCrateItem(CrateNum) -> bool, - [] fn used_crate_source: UsedCrateSource(CrateNum) -> Lrc, - [] fn postorder_cnums: postorder_cnums_node(CrateNum) -> Lrc>, - - [] fn freevars: Freevars(DefId) -> Option>>, - [] fn maybe_unused_trait_import: MaybeUnusedTraitImport(DefId) -> bool, - [] fn maybe_unused_extern_crates: maybe_unused_extern_crates_node(CrateNum) - -> Lrc>, - [] fn names_imported_by_glob_use: NamesImportedByGlobUse(DefId) - -> Lrc>, - - [] fn stability_index: stability_index_node(CrateNum) -> Lrc>, - [] fn all_crate_nums: all_crate_nums_node(CrateNum) -> Lrc>, - - /// A vector of every trait accessible in the whole crate - /// (i.e., including those from subcrates). This is used only for - /// error reporting. - [] fn all_traits: all_traits_node(CrateNum) -> Lrc>, - }, - - Linking { - [] fn exported_symbols: ExportedSymbols(CrateNum) - -> Arc, SymbolExportLevel)>>, - }, - - Codegen { - [] fn collect_and_partition_mono_items: - collect_and_partition_mono_items_node(CrateNum) - -> (Arc, Arc>>>), - [] fn is_codegened_item: IsCodegenedItem(DefId) -> bool, - [] fn codegen_unit: CodegenUnit(InternedString) -> Arc>, - [] fn backend_optimization_level: BackendOptimizationLevel(CrateNum) -> OptLevel, - }, - - Other { - [] fn output_filenames: output_filenames_node(CrateNum) - -> Arc, - }, - - TypeChecking { - /// Do not call this query directly: invoke `normalize` instead. - [] fn normalize_projection_ty: NormalizeProjectionTy( - CanonicalProjectionGoal<'tcx> - ) -> Result< - Lrc>>>, - NoSolution, - >, - - /// Do not call this query directly: invoke `normalize_erasing_regions` instead. - [] fn normalize_ty_after_erasing_regions: NormalizeTyAfterErasingRegions( - ParamEnvAnd<'tcx, Ty<'tcx>> - ) -> Ty<'tcx>, - - [] fn implied_outlives_bounds: ImpliedOutlivesBounds( - CanonicalTyGoal<'tcx> - ) -> Result< - Lrc>>>>, - NoSolution, - >, - - /// Do not call this query directly: invoke `infcx.at().dropck_outlives()` instead. - [] fn dropck_outlives: DropckOutlives( - CanonicalTyGoal<'tcx> - ) -> Result< - Lrc>>>, - NoSolution, - >, - - /// Do not call this query directly: invoke `infcx.predicate_may_hold()` or - /// `infcx.predicate_must_hold()` instead. - [] fn evaluate_obligation: EvaluateObligation( - CanonicalPredicateGoal<'tcx> - ) -> Result, - - [] fn evaluate_goal: EvaluateGoal( - traits::ChalkCanonicalGoal<'tcx> - ) -> Result< - Lrc>>, - NoSolution - >, - - /// Do not call this query directly: part of the `Eq` type-op - [] fn type_op_ascribe_user_type: TypeOpAscribeUserType( - CanonicalTypeOpAscribeUserTypeGoal<'tcx> - ) -> Result< - Lrc>>, - NoSolution, - >, - - /// Do not call this query directly: part of the `Eq` type-op - [] fn type_op_eq: TypeOpEq( - CanonicalTypeOpEqGoal<'tcx> - ) -> Result< - Lrc>>, - NoSolution, - >, - - /// Do not call this query directly: part of the `Subtype` type-op - [] fn type_op_subtype: TypeOpSubtype( - CanonicalTypeOpSubtypeGoal<'tcx> - ) -> Result< - Lrc>>, - NoSolution, - >, - - /// Do not call this query directly: part of the `ProvePredicate` type-op - [] fn type_op_prove_predicate: TypeOpProvePredicate( - CanonicalTypeOpProvePredicateGoal<'tcx> - ) -> Result< - Lrc>>, - NoSolution, - >, - - /// Do not call this query directly: part of the `Normalize` type-op - [] fn type_op_normalize_ty: TypeOpNormalizeTy( - CanonicalTypeOpNormalizeGoal<'tcx, Ty<'tcx>> - ) -> Result< - Lrc>>>, - NoSolution, - >, - - /// Do not call this query directly: part of the `Normalize` type-op - [] fn type_op_normalize_predicate: TypeOpNormalizePredicate( - CanonicalTypeOpNormalizeGoal<'tcx, ty::Predicate<'tcx>> - ) -> Result< - Lrc>>>, - NoSolution, - >, - - /// Do not call this query directly: part of the `Normalize` type-op - [] fn type_op_normalize_poly_fn_sig: TypeOpNormalizePolyFnSig( - CanonicalTypeOpNormalizeGoal<'tcx, ty::PolyFnSig<'tcx>> - ) -> Result< - Lrc>>>, - NoSolution, - >, - - /// Do not call this query directly: part of the `Normalize` type-op - [] fn type_op_normalize_fn_sig: TypeOpNormalizeFnSig( - CanonicalTypeOpNormalizeGoal<'tcx, ty::FnSig<'tcx>> - ) -> Result< - Lrc>>>, - NoSolution, - >, - - [] fn substitute_normalize_and_test_predicates: - substitute_normalize_and_test_predicates_node((DefId, SubstsRef<'tcx>)) -> bool, - - [] fn method_autoderef_steps: MethodAutoderefSteps( - CanonicalTyGoal<'tcx> - ) -> MethodAutoderefStepsResult<'tcx>, - }, - - Other { - [] fn target_features_whitelist: - target_features_whitelist_node(CrateNum) -> Lrc>>, - - // Get an estimate of the size of an InstanceDef based on its MIR for CGU partitioning. - [] fn instance_def_size_estimate: instance_def_size_estimate_dep_node(ty::InstanceDef<'tcx>) - -> usize, - - [] fn features_query: features_node(CrateNum) -> Lrc, }, ]} - -////////////////////////////////////////////////////////////////////// -// These functions are little shims used to find the dep-node for a -// given query when there is not a *direct* mapping: - - -fn features_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::Features -} - -fn codegen_fn_attrs<'tcx>(id: DefId) -> DepConstructor<'tcx> { - DepConstructor::CodegenFnAttrs { 0: id } -} - -fn type_param_predicates<'tcx>((item_id, param_id): (DefId, DefId)) -> DepConstructor<'tcx> { - DepConstructor::TypeParamPredicates { - item_id, - param_id - } -} - -fn fulfill_obligation_dep_node<'tcx>((param_env, trait_ref): - (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>)) -> DepConstructor<'tcx> { - DepConstructor::FulfillObligation { - param_env, - trait_ref - } -} - -fn crate_inherent_impls_dep_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::Coherence -} - -fn inherent_impls_overlap_check_dep_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::CoherenceInherentImplOverlapCheck -} - -fn reachability_dep_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::Reachability -} - -fn mir_shim_dep_node<'tcx>(instance_def: ty::InstanceDef<'tcx>) -> DepConstructor<'tcx> { - DepConstructor::MirShim { - instance_def - } -} - -fn symbol_name_dep_node<'tcx>(instance: ty::Instance<'tcx>) -> DepConstructor<'tcx> { - DepConstructor::SymbolName { instance } -} - -fn typeck_item_bodies_dep_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::TypeckBodiesKrate -} - -fn const_eval_dep_node<'tcx>(param_env: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>) - -> DepConstructor<'tcx> { - DepConstructor::ConstEval { param_env } -} -fn const_eval_raw_dep_node<'tcx>(param_env: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>) - -> DepConstructor<'tcx> { - DepConstructor::ConstEvalRaw { param_env } -} - -fn crate_variances<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::CrateVariances -} - -fn is_copy_dep_node<'tcx>(param_env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> DepConstructor<'tcx> { - DepConstructor::IsCopy { param_env } -} - -fn is_sized_dep_node<'tcx>(param_env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> DepConstructor<'tcx> { - DepConstructor::IsSized { param_env } -} - -fn is_freeze_dep_node<'tcx>(param_env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> DepConstructor<'tcx> { - DepConstructor::IsFreeze { param_env } -} - -fn needs_drop_dep_node<'tcx>(param_env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> DepConstructor<'tcx> { - DepConstructor::NeedsDrop { param_env } -} - -fn layout_dep_node<'tcx>(param_env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> DepConstructor<'tcx> { - DepConstructor::Layout { param_env } -} - -fn specializes_node<'tcx>((a, b): (DefId, DefId)) -> DepConstructor<'tcx> { - DepConstructor::Specializes { impl1: a, impl2: b } -} - -fn implementations_of_trait_node<'tcx>((krate, trait_id): (CrateNum, DefId)) - -> DepConstructor<'tcx> -{ - DepConstructor::ImplementationsOfTrait { krate, trait_id } -} - -fn link_args_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::LinkArgs -} - -fn get_lib_features_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::GetLibFeatures -} - -fn get_lang_items_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::GetLangItems -} - -fn visible_parent_map_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::VisibleParentMap -} - -fn postorder_cnums_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::PostorderCnums -} - -fn maybe_unused_extern_crates_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::MaybeUnusedExternCrates -} - -fn stability_index_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::StabilityIndex -} - -fn all_crate_nums_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::AllCrateNums -} - -fn all_traits_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::AllTraits -} - -fn collect_and_partition_mono_items_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::CollectAndPartitionMonoItems -} - -fn output_filenames_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::OutputFilenames -} - -fn vtable_methods_node<'tcx>(trait_ref: ty::PolyTraitRef<'tcx>) -> DepConstructor<'tcx> { - DepConstructor::VtableMethods{ trait_ref } -} - -fn substitute_normalize_and_test_predicates_node<'tcx>(key: (DefId, SubstsRef<'tcx>)) - -> DepConstructor<'tcx> { - DepConstructor::SubstituteNormalizeAndTestPredicates { key } -} - -fn target_features_whitelist_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> { - DepConstructor::TargetFeaturesWhitelist -} - -fn instance_def_size_estimate_dep_node<'tcx>(instance_def: ty::InstanceDef<'tcx>) - -> DepConstructor<'tcx> { - DepConstructor::InstanceDefSizeEstimate { - instance_def - } -} diff --git a/src/librustc/ty/query/plumbing.rs b/src/librustc/ty/query/plumbing.rs index 973291d94acdd..a03cfd19b9165 100644 --- a/src/librustc/ty/query/plumbing.rs +++ b/src/librustc/ty/query/plumbing.rs @@ -1139,12 +1139,11 @@ pub fn force_from_dep_node<'tcx>( tcx: TyCtxt<'_, 'tcx, 'tcx>, dep_node: &DepNode ) -> bool { - use crate::hir::def_id::LOCAL_CRATE; use crate::dep_graph::RecoverKey; // We must avoid ever having to call force_from_dep_node() for a - // DepNode::CodegenUnit: - // Since we cannot reconstruct the query key of a DepNode::CodegenUnit, we + // DepNode::codegen_unit: + // Since we cannot reconstruct the query key of a DepNode::codegen_unit, we // would always end up having to evaluate the first caller of the // `codegen_unit` query that *is* reconstructible. This might very well be // the `compile_codegen_unit` query, thus re-codegenning the whole CGU just @@ -1155,8 +1154,8 @@ pub fn force_from_dep_node<'tcx>( // each CGU, right after partitioning. This way `try_mark_green` will always // hit the cache instead of having to go through `force_from_dep_node`. // This assertion makes sure, we actually keep applying the solution above. - debug_assert!(dep_node.kind != DepKind::CodegenUnit, - "calling force_from_dep_node() on DepKind::CodegenUnit"); + debug_assert!(dep_node.kind != DepKind::codegen_unit, + "calling force_from_dep_node() on DepKind::codegen_unit"); if !dep_node.kind.can_reconstruct_query_key() { return false @@ -1193,9 +1192,6 @@ pub fn force_from_dep_node<'tcx>( ($query:ident, $key:expr) => { force_ex!(tcx, $query, $key) } }; - // FIXME(#45015): We should try move this boilerplate code into a macro - // somehow. - rustc_dep_node_force!([dep_node, tcx] // These are inputs that are expected to be pre-allocated and that // should therefore always be red or green already @@ -1210,223 +1206,11 @@ pub fn force_from_dep_node<'tcx>( // We don't have enough information to reconstruct the query key of // these - DepKind::IsCopy | - DepKind::IsSized | - DepKind::IsFreeze | - DepKind::NeedsDrop | - DepKind::Layout | - DepKind::ConstEval | - DepKind::ConstEvalRaw | - DepKind::SymbolName | - DepKind::MirShim | - DepKind::BorrowCheckKrate | - DepKind::Specializes | - DepKind::ImplementationsOfTrait | - DepKind::TypeParamPredicates | - DepKind::CodegenUnit | - DepKind::CompileCodegenUnit | - DepKind::FulfillObligation | - DepKind::VtableMethods | - DepKind::NormalizeProjectionTy | - DepKind::NormalizeTyAfterErasingRegions | - DepKind::ImpliedOutlivesBounds | - DepKind::DropckOutlives | - DepKind::EvaluateObligation | - DepKind::EvaluateGoal | - DepKind::TypeOpAscribeUserType | - DepKind::TypeOpEq | - DepKind::TypeOpSubtype | - DepKind::TypeOpProvePredicate | - DepKind::TypeOpNormalizeTy | - DepKind::TypeOpNormalizePredicate | - DepKind::TypeOpNormalizePolyFnSig | - DepKind::TypeOpNormalizeFnSig | - DepKind::SubstituteNormalizeAndTestPredicates | - DepKind::MethodAutoderefSteps | - DepKind::InstanceDefSizeEstimate => { + DepKind::CompileCodegenUnit => { bug!("force_from_dep_node() - Encountered {:?}", dep_node) } - // These are not queries - DepKind::CoherenceCheckTrait | - DepKind::ItemVarianceConstraints => { - return false - } - - DepKind::RegionScopeTree => { force!(region_scope_tree, def_id!()); } - - DepKind::Coherence => { force!(crate_inherent_impls, LOCAL_CRATE); } - DepKind::CoherenceInherentImplOverlapCheck => { - force!(crate_inherent_impls_overlap_check, LOCAL_CRATE) - }, - DepKind::PrivacyAccessLevels => { force!(privacy_access_levels, LOCAL_CRATE); } - DepKind::CheckPrivateInPublic => { force!(check_private_in_public, LOCAL_CRATE); } - - DepKind::BorrowCheck => { force!(borrowck, def_id!()); } - DepKind::MirBorrowCheck => { force!(mir_borrowck, def_id!()); } - DepKind::UnsafetyCheckResult => { force!(unsafety_check_result, def_id!()); } - DepKind::UnsafeDeriveOnReprPacked => { force!(unsafe_derive_on_repr_packed, def_id!()); } - DepKind::LintMod => { force!(lint_mod, def_id!()); } - DepKind::CheckModAttrs => { force!(check_mod_attrs, def_id!()); } - DepKind::CheckModLoops => { force!(check_mod_loops, def_id!()); } - DepKind::CheckModUnstableApiUsage => { force!(check_mod_unstable_api_usage, def_id!()); } - DepKind::CheckModItemTypes => { force!(check_mod_item_types, def_id!()); } - DepKind::CheckModPrivacy => { force!(check_mod_privacy, def_id!()); } - DepKind::CheckModIntrinsics => { force!(check_mod_intrinsics, def_id!()); } - DepKind::CheckModLiveness => { force!(check_mod_liveness, def_id!()); } - DepKind::CheckModImplWf => { force!(check_mod_impl_wf, def_id!()); } - DepKind::CollectModItemTypes => { force!(collect_mod_item_types, def_id!()); } - DepKind::Reachability => { force!(reachable_set, LOCAL_CRATE); } - DepKind::CrateVariances => { force!(crate_variances, LOCAL_CRATE); } - DepKind::AssociatedItems => { force!(associated_item, def_id!()); } - DepKind::PredicatesDefinedOnItem => { force!(predicates_defined_on, def_id!()); } - DepKind::ExplicitPredicatesOfItem => { force!(explicit_predicates_of, def_id!()); } - DepKind::InferredOutlivesOf => { force!(inferred_outlives_of, def_id!()); } - DepKind::InferredOutlivesCrate => { force!(inferred_outlives_crate, LOCAL_CRATE); } - DepKind::SuperPredicatesOfItem => { force!(super_predicates_of, def_id!()); } - DepKind::TraitDefOfItem => { force!(trait_def, def_id!()); } - DepKind::AdtDefOfItem => { force!(adt_def, def_id!()); } - DepKind::ImplTraitRef => { force!(impl_trait_ref, def_id!()); } - DepKind::ImplPolarity => { force!(impl_polarity, def_id!()); } - DepKind::Issue33140SelfTy => { force!(issue33140_self_ty, def_id!()); } - DepKind::FnSignature => { force!(fn_sig, def_id!()); } - DepKind::CoerceUnsizedInfo => { force!(coerce_unsized_info, def_id!()); } - DepKind::ItemVariances => { force!(variances_of, def_id!()); } - DepKind::IsConstFn => { force!(is_const_fn_raw, def_id!()); } - DepKind::IsPromotableConstFn => { force!(is_promotable_const_fn, def_id!()); } - DepKind::IsForeignItem => { force!(is_foreign_item, def_id!()); } - DepKind::SizedConstraint => { force!(adt_sized_constraint, def_id!()); } - DepKind::DtorckConstraint => { force!(adt_dtorck_constraint, def_id!()); } - DepKind::AdtDestructor => { force!(adt_destructor, def_id!()); } - DepKind::AssociatedItemDefIds => { force!(associated_item_def_ids, def_id!()); } - DepKind::InherentImpls => { force!(inherent_impls, def_id!()); } - DepKind::TypeckBodiesKrate => { force!(typeck_item_bodies, LOCAL_CRATE); } - DepKind::TypeckTables => { force!(typeck_tables_of, def_id!()); } - DepKind::UsedTraitImports => { force!(used_trait_imports, def_id!()); } - DepKind::HasTypeckTables => { force!(has_typeck_tables, def_id!()); } - DepKind::SpecializationGraph => { force!(specialization_graph_of, def_id!()); } - DepKind::ObjectSafety => { force!(is_object_safe, def_id!()); } - DepKind::TraitImpls => { force!(trait_impls_of, def_id!()); } - DepKind::CheckMatch => { force!(check_match, def_id!()); } - - DepKind::ParamEnv => { force!(param_env, def_id!()); } - DepKind::DescribeDef => { force!(describe_def, def_id!()); } - DepKind::DefSpan => { force!(def_span, def_id!()); } - DepKind::LookupStability => { force!(lookup_stability, def_id!()); } - DepKind::LookupDeprecationEntry => { - force!(lookup_deprecation_entry, def_id!()); - } - DepKind::ConstIsRvaluePromotableToStatic => { - force!(const_is_rvalue_promotable_to_static, def_id!()); - } - DepKind::RvaluePromotableMap => { force!(rvalue_promotable_map, def_id!()); } - DepKind::ImplParent => { force!(impl_parent, def_id!()); } - DepKind::TraitOfItem => { force!(trait_of_item, def_id!()); } - DepKind::IsReachableNonGeneric => { force!(is_reachable_non_generic, def_id!()); } - DepKind::IsUnreachableLocalDefinition => { - force!(is_unreachable_local_definition, def_id!()); - } - DepKind::IsMirAvailable => { force!(is_mir_available, def_id!()); } - DepKind::ItemAttrs => { force!(item_attrs, def_id!()); } - DepKind::CodegenFnAttrs => { force!(codegen_fn_attrs, def_id!()); } - DepKind::FnArgNames => { force!(fn_arg_names, def_id!()); } - DepKind::RenderedConst => { force!(rendered_const, def_id!()); } - DepKind::DylibDepFormats => { force!(dylib_dependency_formats, krate!()); } - DepKind::IsCompilerBuiltins => { force!(is_compiler_builtins, krate!()); } - DepKind::HasGlobalAllocator => { force!(has_global_allocator, krate!()); } - DepKind::HasPanicHandler => { force!(has_panic_handler, krate!()); } - DepKind::ExternCrate => { force!(extern_crate, def_id!()); } - DepKind::InScopeTraits => { force!(in_scope_traits_map, def_id!().index); } - DepKind::ModuleExports => { force!(module_exports, def_id!()); } - DepKind::IsSanitizerRuntime => { force!(is_sanitizer_runtime, krate!()); } - DepKind::IsProfilerRuntime => { force!(is_profiler_runtime, krate!()); } - DepKind::GetPanicStrategy => { force!(panic_strategy, krate!()); } - DepKind::IsNoBuiltins => { force!(is_no_builtins, krate!()); } - DepKind::ImplDefaultness => { force!(impl_defaultness, def_id!()); } - DepKind::CheckItemWellFormed => { force!(check_item_well_formed, def_id!()); } - DepKind::CheckTraitItemWellFormed => { force!(check_trait_item_well_formed, def_id!()); } - DepKind::CheckImplItemWellFormed => { force!(check_impl_item_well_formed, def_id!()); } - DepKind::ReachableNonGenerics => { force!(reachable_non_generics, krate!()); } - DepKind::EntryFn => { force!(entry_fn, krate!()); } - DepKind::PluginRegistrarFn => { force!(plugin_registrar_fn, krate!()); } - DepKind::ProcMacroDeclsStatic => { force!(proc_macro_decls_static, krate!()); } - DepKind::CrateDisambiguator => { force!(crate_disambiguator, krate!()); } - DepKind::CrateHash => { force!(crate_hash, krate!()); } - DepKind::OriginalCrateName => { force!(original_crate_name, krate!()); } - DepKind::ExtraFileName => { force!(extra_filename, krate!()); } DepKind::Analysis => { force!(analysis, krate!()); } - - DepKind::AllTraitImplementations => { - force!(all_trait_implementations, krate!()); - } - - DepKind::DllimportForeignItems => { - force!(dllimport_foreign_items, krate!()); - } - DepKind::IsDllimportForeignItem => { - force!(is_dllimport_foreign_item, def_id!()); - } - DepKind::IsStaticallyIncludedForeignItem => { - force!(is_statically_included_foreign_item, def_id!()); - } - DepKind::NativeLibraryKind => { force!(native_library_kind, def_id!()); } - DepKind::LinkArgs => { force!(link_args, LOCAL_CRATE); } - - DepKind::ResolveLifetimes => { force!(resolve_lifetimes, krate!()); } - DepKind::NamedRegion => { force!(named_region_map, def_id!().index); } - DepKind::IsLateBound => { force!(is_late_bound_map, def_id!().index); } - DepKind::ObjectLifetimeDefaults => { - force!(object_lifetime_defaults_map, def_id!().index); - } - - DepKind::Visibility => { force!(visibility, def_id!()); } - DepKind::DepKind => { force!(dep_kind, krate!()); } - DepKind::CrateName => { force!(crate_name, krate!()); } - DepKind::ItemChildren => { force!(item_children, def_id!()); } - DepKind::ExternModStmtCnum => { force!(extern_mod_stmt_cnum, def_id!()); } - DepKind::GetLibFeatures => { force!(get_lib_features, LOCAL_CRATE); } - DepKind::DefinedLibFeatures => { force!(defined_lib_features, krate!()); } - DepKind::GetLangItems => { force!(get_lang_items, LOCAL_CRATE); } - DepKind::DefinedLangItems => { force!(defined_lang_items, krate!()); } - DepKind::MissingLangItems => { force!(missing_lang_items, krate!()); } - DepKind::VisibleParentMap => { force!(visible_parent_map, LOCAL_CRATE); } - DepKind::MissingExternCrateItem => { - force!(missing_extern_crate_item, krate!()); - } - DepKind::UsedCrateSource => { force!(used_crate_source, krate!()); } - DepKind::PostorderCnums => { force!(postorder_cnums, LOCAL_CRATE); } - - DepKind::Freevars => { force!(freevars, def_id!()); } - DepKind::MaybeUnusedTraitImport => { - force!(maybe_unused_trait_import, def_id!()); - } - DepKind::NamesImportedByGlobUse => { force!(names_imported_by_glob_use, def_id!()); } - DepKind::MaybeUnusedExternCrates => { force!(maybe_unused_extern_crates, LOCAL_CRATE); } - DepKind::StabilityIndex => { force!(stability_index, LOCAL_CRATE); } - DepKind::AllTraits => { force!(all_traits, LOCAL_CRATE); } - DepKind::AllCrateNums => { force!(all_crate_nums, LOCAL_CRATE); } - DepKind::ExportedSymbols => { force!(exported_symbols, krate!()); } - DepKind::CollectAndPartitionMonoItems => { - force!(collect_and_partition_mono_items, LOCAL_CRATE); - } - DepKind::IsCodegenedItem => { force!(is_codegened_item, def_id!()); } - DepKind::OutputFilenames => { force!(output_filenames, LOCAL_CRATE); } - - DepKind::TargetFeaturesWhitelist => { force!(target_features_whitelist, LOCAL_CRATE); } - - DepKind::Features => { force!(features_query, LOCAL_CRATE); } - - DepKind::ForeignModules => { force!(foreign_modules, krate!()); } - - DepKind::UpstreamMonomorphizations => { - force!(upstream_monomorphizations, krate!()); - } - DepKind::UpstreamMonomorphizationsFor => { - force!(upstream_monomorphizations_for, def_id!()); - } - DepKind::BackendOptimizationLevel => { - force!(backend_optimization_level, krate!()); - } ); true @@ -1479,18 +1263,18 @@ macro_rules! impl_load_from_cache { } impl_load_from_cache!( - TypeckTables => typeck_tables_of, + typeck_tables_of => typeck_tables_of, optimized_mir => optimized_mir, - UnsafetyCheckResult => unsafety_check_result, - BorrowCheck => borrowck, - MirBorrowCheck => mir_borrowck, + unsafety_check_result => unsafety_check_result, + borrowck => borrowck, + mir_borrowck => mir_borrowck, mir_const_qualif => mir_const_qualif, - ConstIsRvaluePromotableToStatic => const_is_rvalue_promotable_to_static, - CheckMatch => check_match, + const_is_rvalue_promotable_to_static => const_is_rvalue_promotable_to_static, + check_match => check_match, type_of => type_of, generics_of => generics_of, predicates_of => predicates_of, - UsedTraitImports => used_trait_imports, - CodegenFnAttrs => codegen_fn_attrs, - SpecializationGraph => specialization_graph_of, + used_trait_imports => used_trait_imports, + codegen_fn_attrs => codegen_fn_attrs, + specialization_graph_of => specialization_graph_of, ); diff --git a/src/librustc_codegen_ssa/mir/block.rs b/src/librustc_codegen_ssa/mir/block.rs index 65f7e023fa226..e64c847db651b 100644 --- a/src/librustc_codegen_ssa/mir/block.rs +++ b/src/librustc_codegen_ssa/mir/block.rs @@ -238,6 +238,13 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { } } } + if self.fn_ty.ret.layout.abi.is_uninhabited() { + // Functions with uninhabited return values are marked `noreturn`, + // so we should make sure that we never actually do. + bx.abort(); + bx.unreachable(); + return; + } let llval = match self.fn_ty.ret.mode { PassMode::Ignore(IgnoreMode::Zst) | PassMode::Indirect(..) => { bx.ret_void(); diff --git a/src/librustc_incremental/persist/dirty_clean.rs b/src/librustc_incremental/persist/dirty_clean.rs index 46e2582ac3ba0..5c4fd9dba7af4 100644 --- a/src/librustc_incremental/persist/dirty_clean.rs +++ b/src/librustc_incremental/persist/dirty_clean.rs @@ -3,9 +3,9 @@ //! we will compare the fingerprint from the current and from the previous //! compilation session as appropriate: //! -//! - `#[rustc_clean(cfg="rev2", except="TypeckTables")]` if we are +//! - `#[rustc_clean(cfg="rev2", except="typeck_tables_of")]` if we are //! in `#[cfg(rev2)]`, then the fingerprints associated with -//! `DepNode::TypeckTables(X)` must be DIFFERENT (`X` is the `DefId` of the +//! `DepNode::typeck_tables_of(X)` must be DIFFERENT (`X` is the `DefId` of the //! current node). //! - `#[rustc_clean(cfg="rev2")]` same as above, except that the //! fingerprints must be the SAME (along with all other fingerprints). @@ -42,14 +42,14 @@ const BASE_CONST: &[&str] = &[ /// DepNodes for functions + methods const BASE_FN: &[&str] = &[ // Callers will depend on the signature of these items, so we better test - label_strs::FnSignature, + label_strs::fn_sig, label_strs::generics_of, label_strs::predicates_of, label_strs::type_of, // And a big part of compilation (that we eventually want to cache) is type inference // information: - label_strs::TypeckTables, + label_strs::typeck_tables_of, ]; /// DepNodes for Hir, which is pretty much everything @@ -61,9 +61,9 @@ const BASE_HIR: &[&str] = &[ /// `impl` implementation of struct/trait const BASE_IMPL: &[&str] = &[ - label_strs::AssociatedItemDefIds, + label_strs::associated_item_def_ids, label_strs::generics_of, - label_strs::ImplTraitRef, + label_strs::impl_trait_ref, ]; /// DepNodes for mir_built/Optimized, which is relevant in "executable" @@ -85,22 +85,22 @@ const BASE_STRUCT: &[&str] = &[ /// Trait definition `DepNode`s. const BASE_TRAIT_DEF: &[&str] = &[ - label_strs::AssociatedItemDefIds, + label_strs::associated_item_def_ids, label_strs::generics_of, - label_strs::ObjectSafety, + label_strs::is_object_safe, label_strs::predicates_of, - label_strs::SpecializationGraph, - label_strs::TraitDefOfItem, - label_strs::TraitImpls, + label_strs::specialization_graph_of, + label_strs::trait_def, + label_strs::trait_impls_of, ]; /// Extra `DepNode`s for functions and methods. const EXTRA_ASSOCIATED: &[&str] = &[ - label_strs::AssociatedItems, + label_strs::associated_item, ]; const EXTRA_TRAIT: &[&str] = &[ - label_strs::TraitOfItem, + label_strs::trait_of_item, ]; // Fully Built Labels diff --git a/src/librustc_macros/src/query.rs b/src/librustc_macros/src/query.rs index bd5be831ff68d..e4a6dfcd4e85e 100644 --- a/src/librustc_macros/src/query.rs +++ b/src/librustc_macros/src/query.rs @@ -43,6 +43,9 @@ enum QueryModifier { /// A cycle error for this query aborting the compilation with a fatal error. FatalCycle, + /// A cycle error results in a delay_bug call + CycleDelayBug, + /// Don't hash the result, instead just mark a query red if it runs NoHash, @@ -101,6 +104,8 @@ impl Parse for QueryModifier { Ok(QueryModifier::LoadCached(tcx, id, block)) } else if modifier == "fatal_cycle" { Ok(QueryModifier::FatalCycle) + } else if modifier == "cycle_delay_bug" { + Ok(QueryModifier::CycleDelayBug) } else if modifier == "no_hash" { Ok(QueryModifier::NoHash) } else if modifier == "no_force" { @@ -207,6 +212,9 @@ struct QueryModifiers { /// A cycle error for this query aborting the compilation with a fatal error. fatal_cycle: bool, + /// A cycle error results in a delay_bug call + cycle_delay_bug: bool, + /// Don't hash the result, instead just mark a query red if it runs no_hash: bool, @@ -226,6 +234,7 @@ fn process_modifiers(query: &mut Query) -> QueryModifiers { let mut cache = None; let mut desc = None; let mut fatal_cycle = false; + let mut cycle_delay_bug = false; let mut no_hash = false; let mut no_force = false; let mut anon = false; @@ -256,6 +265,12 @@ fn process_modifiers(query: &mut Query) -> QueryModifiers { } fatal_cycle = true; } + QueryModifier::CycleDelayBug => { + if cycle_delay_bug { + panic!("duplicate modifier `cycle_delay_bug` for query `{}`", query.name); + } + cycle_delay_bug = true; + } QueryModifier::NoHash => { if no_hash { panic!("duplicate modifier `no_hash` for query `{}`", query.name); @@ -287,6 +302,7 @@ fn process_modifiers(query: &mut Query) -> QueryModifiers { cache, desc, fatal_cycle, + cycle_delay_bug, no_hash, no_force, anon, @@ -333,6 +349,7 @@ fn add_query_description_impl( let tcx = tcx.as_ref().map(|t| quote! { #t }).unwrap_or(quote! { _ }); quote! { #[inline] + #[allow(unused_variables)] fn cache_on_disk(#tcx: TyCtxt<'_, 'tcx, 'tcx>, #key: Self::Key) -> bool { #expr } @@ -348,6 +365,7 @@ fn add_query_description_impl( let desc = modifiers.desc.as_ref().map(|(tcx, desc)| { let tcx = tcx.as_ref().map(|t| quote! { #t }).unwrap_or(quote! { _ }); quote! { + #[allow(unused_variables)] fn describe( #tcx: TyCtxt<'_, '_, '_>, #key: #arg, @@ -397,6 +415,10 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream { if modifiers.fatal_cycle { attributes.push(quote! { fatal_cycle }); }; + // Pass on the cycle_delay_bug modifier + if modifiers.cycle_delay_bug { + attributes.push(quote! { cycle_delay_bug }); + }; // Pass on the no_hash modifier if modifiers.no_hash { attributes.push(quote! { no_hash }); diff --git a/src/librustc_target/spec/x86_64_unknown_linux_gnux32.rs b/src/librustc_target/spec/x86_64_unknown_linux_gnux32.rs index 0b2d7aacc4ddf..73151b194de42 100644 --- a/src/librustc_target/spec/x86_64_unknown_linux_gnux32.rs +++ b/src/librustc_target/spec/x86_64_unknown_linux_gnux32.rs @@ -5,7 +5,8 @@ pub fn target() -> TargetResult { base.cpu = "x86-64".to_string(); base.max_atomic_width = Some(64); base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mx32".to_string()); - base.stack_probes = true; + // BUG: temporarily workaround #59674 + base.stack_probes = false; base.has_elf_tls = false; // BUG(GabrielMajeri): disabling the PLT on x86_64 Linux with x32 ABI // breaks code gen. See LLVM bug 36743 diff --git a/src/libstd/Cargo.toml b/src/libstd/Cargo.toml index 9ac03adfc2778..b2b9c94ea4fe4 100644 --- a/src/libstd/Cargo.toml +++ b/src/libstd/Cargo.toml @@ -19,7 +19,7 @@ panic_unwind = { path = "../libpanic_unwind", optional = true } panic_abort = { path = "../libpanic_abort" } core = { path = "../libcore" } libc = { version = "0.2.51", default-features = false, features = ['rustc-dep-of-std'] } -compiler_builtins = { version = "0.1.8" } +compiler_builtins = { version = "0.1.9" } profiler_builtins = { path = "../libprofiler_builtins", optional = true } unwind = { path = "../libunwind" } rustc-demangle = { version = "0.1.10", features = ['rustc-dep-of-std'] } diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index 705dc8f40b5a0..90369f9771fea 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -21,7 +21,9 @@ use crate::time::SystemTime; /// it was opened with. Files also implement [`Seek`] to alter the logical cursor /// that the file contains internally. /// -/// Files are automatically closed when they go out of scope. +/// Files are automatically closed when they go out of scope. Errors detected +/// on closing are ignored by the implementation of `Drop`. Use the method +/// [`sync_all`] if these errors must be manually handled. /// /// # Examples /// @@ -84,6 +86,7 @@ use crate::time::SystemTime; /// [`Read`]: ../io/trait.Read.html /// [`Write`]: ../io/trait.Write.html /// [`BufReader`]: ../io/struct.BufReader.html +/// [`sync_all`]: struct.File.html#method.sync_all #[stable(feature = "rust1", since = "1.0.0")] pub struct File { inner: fs_imp::File, @@ -391,9 +394,13 @@ impl File { /// Attempts to sync all OS-internal metadata to disk. /// - /// This function will attempt to ensure that all in-core data reaches the + /// This function will attempt to ensure that all in-memory data reaches the /// filesystem before returning. /// + /// This can be used to handle errors that would otherwise only be caught + /// when the `File` is closed. Dropping a file will ignore errors in + /// synchronizing this in-memory data. + /// /// # Examples /// /// ```no_run diff --git a/src/test/codegen/noreturn-uninhabited.rs b/src/test/codegen/noreturn-uninhabited.rs new file mode 100644 index 0000000000000..1b65da9f2877a --- /dev/null +++ b/src/test/codegen/noreturn-uninhabited.rs @@ -0,0 +1,32 @@ +// compile-flags: -g -C no-prepopulate-passes +// ignore-tidy-linelength + +#![crate_type = "lib"] + +#[derive(Clone, Copy)] +pub enum EmptyEnum {} + +#[no_mangle] +pub fn empty(x: &EmptyEnum) -> EmptyEnum { + // CHECK: @empty({{.*}}) unnamed_addr #0 + // CHECK-NOT: ret void + // CHECK: call void @llvm.trap() + // CHECK: unreachable + *x +} + +pub struct Foo(String, EmptyEnum); + +#[no_mangle] +pub fn foo(x: String, y: &EmptyEnum) -> Foo { + // CHECK: @foo({{.*}}) unnamed_addr #0 + // CHECK-NOT: ret %Foo + // CHECK: call void @llvm.trap() + // CHECK: unreachable + Foo(x, *y) +} + +// CHECK: attributes #0 = {{{.*}} noreturn {{.*}}} + +// CHECK: DISubprogram(name: "empty", {{.*}} DIFlagNoReturn +// CHECK: DISubprogram(name: "foo", {{.*}} DIFlagNoReturn diff --git a/src/test/incremental/add_private_fn_at_krate_root_cc/struct_point.rs b/src/test/incremental/add_private_fn_at_krate_root_cc/struct_point.rs index 0e17a29dea03e..13daa72a4d1f4 100644 --- a/src/test/incremental/add_private_fn_at_krate_root_cc/struct_point.rs +++ b/src/test/incremental/add_private_fn_at_krate_root_cc/struct_point.rs @@ -24,7 +24,7 @@ extern crate point; pub mod fn_calls_methods_in_same_impl { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn check() { let x = Point { x: 2.0, y: 2.0 }; x.distance_from_origin(); @@ -35,7 +35,7 @@ pub mod fn_calls_methods_in_same_impl { pub mod fn_calls_free_fn { use point::{self, Point}; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn check() { let x = Point { x: 2.0, y: 2.0 }; point::distance_squared(&x); @@ -46,7 +46,7 @@ pub mod fn_calls_free_fn { pub mod fn_make_struct { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn make_origin() -> Point { Point { x: 2.0, y: 2.0 } } @@ -56,7 +56,7 @@ pub mod fn_make_struct { pub mod fn_read_field { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -66,7 +66,7 @@ pub mod fn_read_field { pub mod fn_write_field { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/src/test/incremental/callee_caller_cross_crate/b.rs b/src/test/incremental/callee_caller_cross_crate/b.rs index 95285b7a03c50..b49731b26e78f 100644 --- a/src/test/incremental/callee_caller_cross_crate/b.rs +++ b/src/test/incremental/callee_caller_cross_crate/b.rs @@ -6,12 +6,12 @@ extern crate a; -#[rustc_dirty(label="TypeckTables", cfg="rpass2")] +#[rustc_dirty(label="typeck_tables_of", cfg="rpass2")] pub fn call_function0() { a::function0(77); } -#[rustc_clean(label="TypeckTables", cfg="rpass2")] +#[rustc_clean(label="typeck_tables_of", cfg="rpass2")] pub fn call_function1() { a::function1(77); } diff --git a/src/test/incremental/change_add_field/struct_point.rs b/src/test/incremental/change_add_field/struct_point.rs index 182e6cb45be64..9e34aedbed307 100644 --- a/src/test/incremental/change_add_field/struct_point.rs +++ b/src/test/incremental/change_add_field/struct_point.rs @@ -70,7 +70,7 @@ pub mod point { pub mod fn_with_type_in_sig { use point::Point; - #[rustc_dirty(label="TypeckTables", cfg="cfail2")] + #[rustc_dirty(label="typeck_tables_of", cfg="cfail2")] pub fn boop(p: Option<&Point>) -> f32 { p.map(|p| p.total()).unwrap_or(0.0) } @@ -86,7 +86,7 @@ pub mod fn_with_type_in_sig { pub mod call_fn_with_type_in_sig { use fn_with_type_in_sig; - #[rustc_dirty(label="TypeckTables", cfg="cfail2")] + #[rustc_dirty(label="typeck_tables_of", cfg="cfail2")] pub fn bip() -> f32 { fn_with_type_in_sig::boop(None) } @@ -102,7 +102,7 @@ pub mod call_fn_with_type_in_sig { pub mod fn_with_type_in_body { use point::Point; - #[rustc_dirty(label="TypeckTables", cfg="cfail2")] + #[rustc_dirty(label="typeck_tables_of", cfg="cfail2")] pub fn boop() -> f32 { Point::origin().total() } @@ -115,7 +115,7 @@ pub mod fn_with_type_in_body { pub mod call_fn_with_type_in_body { use fn_with_type_in_body; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn bip() -> f32 { fn_with_type_in_body::boop() } @@ -125,7 +125,7 @@ pub mod call_fn_with_type_in_body { pub mod fn_make_struct { use point::Point; - #[rustc_dirty(label="TypeckTables", cfg="cfail2")] + #[rustc_dirty(label="typeck_tables_of", cfg="cfail2")] pub fn make_origin(p: Point) -> Point { Point { ..p } } @@ -135,7 +135,7 @@ pub mod fn_make_struct { pub mod fn_read_field { use point::Point; - #[rustc_dirty(label="TypeckTables", cfg="cfail2")] + #[rustc_dirty(label="typeck_tables_of", cfg="cfail2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -145,7 +145,7 @@ pub mod fn_read_field { pub mod fn_write_field { use point::Point; - #[rustc_dirty(label="TypeckTables", cfg="cfail2")] + #[rustc_dirty(label="typeck_tables_of", cfg="cfail2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/src/test/incremental/change_crate_order/main.rs b/src/test/incremental/change_crate_order/main.rs index e514c8519f89f..c167cf6e035d6 100644 --- a/src/test/incremental/change_crate_order/main.rs +++ b/src/test/incremental/change_crate_order/main.rs @@ -18,7 +18,7 @@ extern crate a; use a::A; use b::B; -//? #[rustc_clean(label="TypeckTables", cfg="rpass2")] +//? #[rustc_clean(label="typeck_tables_of", cfg="rpass2")] pub fn main() { A + B; } diff --git a/src/test/incremental/change_private_fn/struct_point.rs b/src/test/incremental/change_private_fn/struct_point.rs index f9f83169ef4af..be287b86bbcba 100644 --- a/src/test/incremental/change_private_fn/struct_point.rs +++ b/src/test/incremental/change_private_fn/struct_point.rs @@ -51,7 +51,7 @@ pub mod point { pub mod fn_calls_methods_in_same_impl { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn check() { let x = Point { x: 2.0, y: 2.0 }; x.distance_from_origin(); @@ -62,7 +62,7 @@ pub mod fn_calls_methods_in_same_impl { pub mod fn_calls_methods_in_another_impl { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn check() { let mut x = Point { x: 2.0, y: 2.0 }; x.translate(3.0, 3.0); @@ -73,7 +73,7 @@ pub mod fn_calls_methods_in_another_impl { pub mod fn_make_struct { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn make_origin() -> Point { Point { x: 2.0, y: 2.0 } } @@ -83,7 +83,7 @@ pub mod fn_make_struct { pub mod fn_read_field { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -93,7 +93,7 @@ pub mod fn_read_field { pub mod fn_write_field { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/src/test/incremental/change_private_fn_cc/struct_point.rs b/src/test/incremental/change_private_fn_cc/struct_point.rs index 827eb8105b274..521fe99ebc2eb 100644 --- a/src/test/incremental/change_private_fn_cc/struct_point.rs +++ b/src/test/incremental/change_private_fn_cc/struct_point.rs @@ -23,7 +23,7 @@ extern crate point; pub mod fn_calls_methods_in_same_impl { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn check() { let x = Point { x: 2.0, y: 2.0 }; x.distance_from_origin(); @@ -34,7 +34,7 @@ pub mod fn_calls_methods_in_same_impl { pub mod fn_calls_methods_in_another_impl { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn check() { let mut x = Point { x: 2.0, y: 2.0 }; x.translate(3.0, 3.0); @@ -45,7 +45,7 @@ pub mod fn_calls_methods_in_another_impl { pub mod fn_make_struct { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn make_origin() -> Point { Point { x: 2.0, y: 2.0 } } @@ -55,7 +55,7 @@ pub mod fn_make_struct { pub mod fn_read_field { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -65,7 +65,7 @@ pub mod fn_read_field { pub mod fn_write_field { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/src/test/incremental/change_private_impl_method/struct_point.rs b/src/test/incremental/change_private_impl_method/struct_point.rs index e3073b170df49..c2796b5e3c90a 100644 --- a/src/test/incremental/change_private_impl_method/struct_point.rs +++ b/src/test/incremental/change_private_impl_method/struct_point.rs @@ -51,7 +51,7 @@ pub mod point { pub mod fn_calls_methods_in_same_impl { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn check() { let x = Point { x: 2.0, y: 2.0 }; x.distance_from_origin(); @@ -62,7 +62,7 @@ pub mod fn_calls_methods_in_same_impl { pub mod fn_calls_methods_in_another_impl { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn check() { let mut x = Point { x: 2.0, y: 2.0 }; x.translate(3.0, 3.0); @@ -73,7 +73,7 @@ pub mod fn_calls_methods_in_another_impl { pub mod fn_make_struct { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn make_origin() -> Point { Point { x: 2.0, y: 2.0 } } @@ -83,7 +83,7 @@ pub mod fn_make_struct { pub mod fn_read_field { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -93,7 +93,7 @@ pub mod fn_read_field { pub mod fn_write_field { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/src/test/incremental/change_private_impl_method_cc/struct_point.rs b/src/test/incremental/change_private_impl_method_cc/struct_point.rs index bd5e9636d48ba..731dcdf78c933 100644 --- a/src/test/incremental/change_private_impl_method_cc/struct_point.rs +++ b/src/test/incremental/change_private_impl_method_cc/struct_point.rs @@ -24,7 +24,7 @@ extern crate point; pub mod fn_calls_methods_in_same_impl { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn check() { let x = Point { x: 2.0, y: 2.0 }; x.distance_from_origin(); @@ -35,7 +35,7 @@ pub mod fn_calls_methods_in_same_impl { pub mod fn_calls_methods_in_another_impl { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn dirty() { let mut x = Point { x: 2.0, y: 2.0 }; x.translate(3.0, 3.0); @@ -46,7 +46,7 @@ pub mod fn_calls_methods_in_another_impl { pub mod fn_make_struct { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn make_origin() -> Point { Point { x: 2.0, y: 2.0 } } @@ -56,7 +56,7 @@ pub mod fn_make_struct { pub mod fn_read_field { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -66,7 +66,7 @@ pub mod fn_read_field { pub mod fn_write_field { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/src/test/incremental/change_pub_inherent_method_body/struct_point.rs b/src/test/incremental/change_pub_inherent_method_body/struct_point.rs index 8e87fde54efb5..76dcff848caf7 100644 --- a/src/test/incremental/change_pub_inherent_method_body/struct_point.rs +++ b/src/test/incremental/change_pub_inherent_method_body/struct_point.rs @@ -42,7 +42,7 @@ pub mod point { pub mod fn_calls_changed_method { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn check() { let p = Point { x: 2.0, y: 2.0 }; p.distance_from_origin(); @@ -53,7 +53,7 @@ pub mod fn_calls_changed_method { pub mod fn_calls_another_method { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn check() { let p = Point { x: 2.0, y: 2.0 }; p.x(); @@ -64,7 +64,7 @@ pub mod fn_calls_another_method { pub mod fn_make_struct { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn make_origin() -> Point { Point { x: 2.0, y: 2.0 } } @@ -74,7 +74,7 @@ pub mod fn_make_struct { pub mod fn_read_field { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -84,7 +84,7 @@ pub mod fn_read_field { pub mod fn_write_field { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/src/test/incremental/change_pub_inherent_method_sig/struct_point.rs b/src/test/incremental/change_pub_inherent_method_sig/struct_point.rs index 7ea64a08472c1..9c95d4cc2a9a5 100644 --- a/src/test/incremental/change_pub_inherent_method_sig/struct_point.rs +++ b/src/test/incremental/change_pub_inherent_method_sig/struct_point.rs @@ -52,7 +52,7 @@ pub mod point { pub mod fn_calls_changed_method { use point::Point; - #[rustc_dirty(label="TypeckTables", cfg="cfail2")] + #[rustc_dirty(label="typeck_tables_of", cfg="cfail2")] pub fn check() { let p = Point { x: 2.0, y: 2.0 }; p.distance_from_point(None); @@ -63,7 +63,7 @@ pub mod fn_calls_changed_method { pub mod fn_calls_another_method { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn check() { let p = Point { x: 2.0, y: 2.0 }; p.x(); @@ -74,7 +74,7 @@ pub mod fn_calls_another_method { pub mod fn_make_struct { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn make_origin() -> Point { Point { x: 2.0, y: 2.0 } } @@ -84,7 +84,7 @@ pub mod fn_make_struct { pub mod fn_read_field { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -94,7 +94,7 @@ pub mod fn_read_field { pub mod fn_write_field { use point::Point; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/src/test/incremental/dirty_clean.rs b/src/test/incremental/dirty_clean.rs index f4248dbdd6d23..b9a1846b37d44 100644 --- a/src/test/incremental/dirty_clean.rs +++ b/src/test/incremental/dirty_clean.rs @@ -25,16 +25,16 @@ mod x { mod y { use x; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn y() { - //[cfail2]~^ ERROR `TypeckTables(y::y)` should be clean but is not + //[cfail2]~^ ERROR `typeck_tables_of(y::y)` should be clean but is not x::x(); } } mod z { - #[rustc_dirty(label="TypeckTables", cfg="cfail2")] + #[rustc_dirty(label="typeck_tables_of", cfg="cfail2")] pub fn z() { - //[cfail2]~^ ERROR `TypeckTables(z::z)` should be dirty but is not + //[cfail2]~^ ERROR `typeck_tables_of(z::z)` should be dirty but is not } } diff --git a/src/test/incremental/hashes/call_expressions.rs b/src/test/incremental/hashes/call_expressions.rs index 05cc945bbaf00..55dd37451235a 100644 --- a/src/test/incremental/hashes/call_expressions.rs +++ b/src/test/incremental/hashes/call_expressions.rs @@ -25,7 +25,7 @@ pub fn change_callee_function() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_callee_function() { callee2(1, 2) @@ -81,7 +81,7 @@ pub fn change_callee_method() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_callee_method() { let s = Struct; @@ -115,7 +115,7 @@ pub fn change_ufcs_callee_method() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_ufcs_callee_method() { let s = Struct; @@ -149,7 +149,7 @@ pub fn change_to_ufcs() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] // One might think this would be expanded in the HirBody/Mir, but it actually // results in slightly different Hir/Mir. @@ -171,7 +171,7 @@ pub mod change_ufcs_callee_indirectly { #[cfg(not(cfail1))] use super::Struct2 as Struct; - #[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,TypeckTables")] + #[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] diff --git a/src/test/incremental/hashes/closure_expressions.rs b/src/test/incremental/hashes/closure_expressions.rs index b8e84173ec06c..5bfd540eca63e 100644 --- a/src/test/incremental/hashes/closure_expressions.rs +++ b/src/test/incremental/hashes/closure_expressions.rs @@ -37,7 +37,7 @@ pub fn add_parameter() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn add_parameter() { let x = 0u32; @@ -53,7 +53,7 @@ pub fn change_parameter_pattern() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_parameter_pattern() { let _ = |&x: &u32| x; @@ -84,7 +84,7 @@ pub fn add_type_ascription_to_parameter() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn add_type_ascription_to_parameter() { let closure = |x: u32| x + 1u32; @@ -101,7 +101,7 @@ pub fn change_parameter_type() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_parameter_type() { let closure = |x: u16| (x as u64) + 1; diff --git a/src/test/incremental/hashes/enum_constructors.rs b/src/test/incremental/hashes/enum_constructors.rs index d3f96c9947b89..f553b2d1b5123 100644 --- a/src/test/incremental/hashes/enum_constructors.rs +++ b/src/test/incremental/hashes/enum_constructors.rs @@ -57,7 +57,7 @@ pub fn change_field_order_struct_like() -> Enum { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] // FIXME(michaelwoerister):Interesting. I would have thought that that changes the MIR. And it // would if it were not all constants @@ -96,7 +96,7 @@ pub fn change_constructor_path_struct_like() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_constructor_path_struct_like() { let _ = Enum2::Struct { @@ -139,8 +139,8 @@ pub mod change_constructor_path_indirectly_struct_like { #[rustc_clean( cfg="cfail2", - except="FnSignature,Hir,HirBody,optimized_mir,mir_built,\ - TypeckTables" + except="fn_sig,Hir,HirBody,optimized_mir,mir_built,\ + typeck_tables_of" )] #[rustc_clean(cfg="cfail3")] pub fn function() -> TheEnum { @@ -197,7 +197,7 @@ pub fn change_constructor_path_tuple_like() { #[cfg(not(cfail1))] #[rustc_clean( cfg="cfail2", - except="HirBody,optimized_mir,mir_built,TypeckTables" + except="HirBody,optimized_mir,mir_built,typeck_tables_of" )] #[rustc_clean(cfg="cfail3")] pub fn change_constructor_path_tuple_like() { @@ -215,7 +215,7 @@ pub fn change_constructor_variant_tuple_like() { #[cfg(not(cfail1))] #[rustc_clean( cfg="cfail2", - except="HirBody,optimized_mir,mir_built,TypeckTables" + except="HirBody,optimized_mir,mir_built,typeck_tables_of" )] #[rustc_clean(cfg="cfail3")] pub fn change_constructor_variant_tuple_like() { @@ -232,8 +232,8 @@ pub mod change_constructor_path_indirectly_tuple_like { #[rustc_clean( cfg="cfail2", - except="FnSignature,Hir,HirBody,optimized_mir,mir_built,\ - TypeckTables" + except="fn_sig,Hir,HirBody,optimized_mir,mir_built,\ + typeck_tables_of" )] #[rustc_clean(cfg="cfail3")] pub fn function() -> TheEnum { @@ -251,7 +251,7 @@ pub mod change_constructor_variant_indirectly_tuple_like { #[cfg(not(cfail1))] use super::Enum2::Tuple2 as Variant; - #[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,TypeckTables")] + #[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn function() -> Enum2 { Variant(0, 1, 2) @@ -278,7 +278,7 @@ pub fn change_constructor_path_c_like() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_constructor_path_c_like() { let _ = Clike2::B; @@ -309,8 +309,8 @@ pub mod change_constructor_path_indirectly_c_like { #[rustc_clean( cfg="cfail2", - except="FnSignature,Hir,HirBody,optimized_mir,mir_built,\ - TypeckTables" + except="fn_sig,Hir,HirBody,optimized_mir,mir_built,\ + typeck_tables_of" )] #[rustc_clean(cfg="cfail3")] pub fn function() -> TheEnum { diff --git a/src/test/incremental/hashes/for_loops.rs b/src/test/incremental/hashes/for_loops.rs index 91abca3312bc2..503cb8732ef70 100644 --- a/src/test/incremental/hashes/for_loops.rs +++ b/src/test/incremental/hashes/for_loops.rs @@ -71,7 +71,7 @@ pub fn change_iteration_variable_pattern() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_iteration_variable_pattern() { let mut _x = 0; @@ -116,7 +116,7 @@ pub fn add_break() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn add_break() { let mut _x = 0; diff --git a/src/test/incremental/hashes/function_interfaces.rs b/src/test/incremental/hashes/function_interfaces.rs index db8fa9ced113c..7850291fc565a 100644 --- a/src/test/incremental/hashes/function_interfaces.rs +++ b/src/test/incremental/hashes/function_interfaces.rs @@ -24,7 +24,7 @@ pub fn add_parameter() {} #[cfg(not(cfail1))] #[rustc_clean(cfg = "cfail2", - except = "Hir, HirBody, mir_built, optimized_mir, TypeckTables, FnSignature")] + except = "Hir, HirBody, mir_built, optimized_mir, typeck_tables_of, fn_sig")] #[rustc_clean(cfg = "cfail3")] pub fn add_parameter(p: i32) {} @@ -47,7 +47,7 @@ pub fn type_of_parameter(p: i32) {} #[cfg(not(cfail1))] #[rustc_clean(cfg = "cfail2", - except = "Hir, HirBody, mir_built, optimized_mir, TypeckTables, FnSignature")] + except = "Hir, HirBody, mir_built, optimized_mir, typeck_tables_of, fn_sig")] #[rustc_clean(cfg = "cfail3")] pub fn type_of_parameter(p: i64) {} @@ -59,7 +59,7 @@ pub fn type_of_parameter_ref(p: &i32) {} #[cfg(not(cfail1))] #[rustc_clean(cfg = "cfail2", - except = "Hir, HirBody, mir_built, optimized_mir, TypeckTables, FnSignature")] + except = "Hir, HirBody, mir_built, optimized_mir, typeck_tables_of, fn_sig")] #[rustc_clean(cfg = "cfail3")] pub fn type_of_parameter_ref(p: &mut i32) {} @@ -71,7 +71,7 @@ pub fn order_of_parameters(p1: i32, p2: i64) {} #[cfg(not(cfail1))] #[rustc_clean(cfg = "cfail2", - except = "Hir, HirBody, mir_built, optimized_mir, TypeckTables, FnSignature")] + except = "Hir, HirBody, mir_built, optimized_mir, typeck_tables_of, fn_sig")] #[rustc_clean(cfg = "cfail3")] pub fn order_of_parameters(p2: i64, p1: i32) {} @@ -83,7 +83,7 @@ pub fn make_unsafe() {} #[cfg(not(cfail1))] #[rustc_clean(cfg = "cfail2", - except = "Hir, HirBody, mir_built, optimized_mir, TypeckTables, FnSignature")] + except = "Hir, HirBody, mir_built, optimized_mir, typeck_tables_of, fn_sig")] #[rustc_clean(cfg = "cfail3")] pub unsafe fn make_unsafe() {} @@ -94,7 +94,7 @@ pub unsafe fn make_unsafe() {} pub fn make_extern() {} #[cfg(not(cfail1))] -#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, mir_built, TypeckTables, FnSignature")] +#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, mir_built, typeck_tables_of, fn_sig")] #[rustc_clean(cfg = "cfail3")] pub extern "C" fn make_extern() {} @@ -105,7 +105,7 @@ pub extern "C" fn make_extern() {} pub extern "C" fn make_intrinsic() {} #[cfg(not(cfail1))] -#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, TypeckTables, FnSignature")] +#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, typeck_tables_of, fn_sig")] #[rustc_clean(cfg = "cfail3")] pub extern "rust-intrinsic" fn make_intrinsic() {} @@ -258,7 +258,7 @@ pub fn return_impl_trait() -> i32 { } #[cfg(not(cfail1))] -#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, TypeckTables, FnSignature")] +#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody, typeck_tables_of, fn_sig")] #[rustc_clean(cfg = "cfail3")] pub fn return_impl_trait() -> impl Clone { 0 @@ -292,7 +292,7 @@ pub mod change_return_type_indirectly { use super::ReferencedType2 as ReturnType; #[rustc_clean(cfg = "cfail2", - except = "Hir, HirBody, mir_built, optimized_mir, TypeckTables, FnSignature")] + except = "Hir, HirBody, mir_built, optimized_mir, typeck_tables_of, fn_sig")] #[rustc_clean(cfg = "cfail3")] pub fn indirect_return_type() -> ReturnType { ReturnType {} @@ -309,7 +309,7 @@ pub mod change_parameter_type_indirectly { use super::ReferencedType2 as ParameterType; #[rustc_clean(cfg = "cfail2", - except = "Hir, HirBody, mir_built, optimized_mir, TypeckTables, FnSignature")] + except = "Hir, HirBody, mir_built, optimized_mir, typeck_tables_of, fn_sig")] #[rustc_clean(cfg = "cfail3")] pub fn indirect_parameter_type(p: ParameterType) {} } diff --git a/src/test/incremental/hashes/if_expressions.rs b/src/test/incremental/hashes/if_expressions.rs index 32a0c8b6b7e79..fba7869af42f2 100644 --- a/src/test/incremental/hashes/if_expressions.rs +++ b/src/test/incremental/hashes/if_expressions.rs @@ -25,7 +25,7 @@ pub fn change_condition(x: bool) -> u32 { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_condition(x: bool) -> u32 { if !x { @@ -94,7 +94,7 @@ pub fn add_else_branch(x: bool) -> u32 { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn add_else_branch(x: bool) -> u32 { let mut ret = 1; @@ -120,7 +120,7 @@ pub fn change_condition_if_let(x: Option) -> u32 { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_condition_if_let(x: Option) -> u32 { if let Some(_) = x { @@ -143,7 +143,7 @@ pub fn change_then_branch_if_let(x: Option) -> u32 { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_then_branch_if_let(x: Option) -> u32 { if let Some(x) = x { @@ -191,7 +191,7 @@ pub fn add_else_branch_if_let(x: Option) -> u32 { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn add_else_branch_if_let(x: Option) -> u32 { let mut ret = 1; diff --git a/src/test/incremental/hashes/inherent_impls.rs b/src/test/incremental/hashes/inherent_impls.rs index 1b6b41ce05b78..268c37508a73c 100644 --- a/src/test/incremental/hashes/inherent_impls.rs +++ b/src/test/incremental/hashes/inherent_impls.rs @@ -23,7 +23,7 @@ impl Foo { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="Hir,HirBody,AssociatedItemDefIds")] +#[rustc_clean(cfg="cfail2", except="Hir,HirBody,associated_item_def_ids")] #[rustc_clean(cfg="cfail3")] impl Foo { #[rustc_clean(cfg="cfail3")] @@ -42,7 +42,7 @@ impl Foo { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl Foo { - #[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,TypeckTables")] + #[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn method_body() { println!("Hello, world!"); @@ -63,7 +63,7 @@ impl Foo { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl Foo { - #[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,TypeckTables")] + #[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] #[inline] pub fn method_body_inlined() { @@ -82,7 +82,7 @@ impl Foo { #[rustc_clean(cfg="cfail2", except="Hir,HirBody")] #[rustc_clean(cfg="cfail3")] impl Foo { - #[rustc_clean(cfg="cfail2", except="AssociatedItems,Hir,HirBody")] + #[rustc_clean(cfg="cfail2", except="associated_item,Hir,HirBody")] #[rustc_clean(cfg="cfail3")] fn method_privacy() { } } @@ -114,7 +114,7 @@ impl Foo { impl Foo { #[rustc_clean( cfg="cfail2", - except="Hir,HirBody,FnSignature,TypeckTables,optimized_mir,mir_built" + except="Hir,HirBody,fn_sig,typeck_tables_of,optimized_mir,mir_built" )] #[rustc_clean(cfg="cfail3")] pub fn method_selfmutness(&mut self) { } @@ -129,7 +129,7 @@ impl Foo { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="Hir,HirBody,AssociatedItemDefIds")] +#[rustc_clean(cfg="cfail2", except="Hir,HirBody,associated_item_def_ids")] #[rustc_clean(cfg="cfail3")] impl Foo { #[rustc_clean(cfg="cfail2")] @@ -154,7 +154,7 @@ impl Foo { impl Foo { #[rustc_clean( cfg="cfail2", - except="Hir,HirBody,FnSignature,TypeckTables,optimized_mir,mir_built" + except="Hir,HirBody,fn_sig,typeck_tables_of,optimized_mir,mir_built" )] #[rustc_clean(cfg="cfail3")] pub fn add_method_parameter(&self, _: i32) { } @@ -191,7 +191,7 @@ impl Foo { impl Foo { #[rustc_clean( cfg="cfail2", - except="Hir,HirBody,FnSignature,optimized_mir,mir_built,TypeckTables")] + except="Hir,HirBody,fn_sig,optimized_mir,mir_built,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_method_return_type(&self) -> u8 { 0 } } @@ -245,7 +245,7 @@ impl Foo { impl Foo { #[rustc_clean( cfg="cfail2", - except="Hir,HirBody,FnSignature,TypeckTables,optimized_mir,mir_built" + except="Hir,HirBody,fn_sig,typeck_tables_of,optimized_mir,mir_built" )] #[rustc_clean(cfg="cfail3")] pub unsafe fn make_method_unsafe(&self) { } @@ -263,7 +263,7 @@ impl Foo { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl Foo { - #[rustc_clean(cfg="cfail2", except="Hir,HirBody,mir_built,FnSignature,TypeckTables")] + #[rustc_clean(cfg="cfail2", except="Hir,HirBody,mir_built,fn_sig,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub extern fn make_method_extern(&self) { } } @@ -280,7 +280,7 @@ impl Foo { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl Foo { - #[rustc_clean(cfg="cfail2", except="Hir,HirBody,FnSignature,TypeckTables")] + #[rustc_clean(cfg="cfail2", except="Hir,HirBody,fn_sig,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub extern "system" fn change_method_calling_convention(&self) { } } @@ -297,15 +297,15 @@ impl Foo { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl Foo { - // Warning: Note that `TypeckTables` are coming up clean here. + // Warning: Note that `typeck_tables_of` are coming up clean here. // The addition or removal of lifetime parameters that don't // appear in the arguments or fn body in any way does not, in - // fact, affect the `TypeckTables` in any semantic way (at least + // fact, affect the `typeck_tables_of` in any semantic way (at least // as of this writing). **However,** altering the order of - // lowering **can** cause it appear to affect the `TypeckTables`: + // lowering **can** cause it appear to affect the `typeck_tables_of`: // if we lower generics before the body, then the `HirId` for // things in the body will be affected. So if you start to see - // `TypeckTables` appear dirty, that might be the cause. -nmatsakis + // `typeck_tables_of` appear dirty, that might be the cause. -nmatsakis #[rustc_clean(cfg="cfail2", except="Hir,HirBody")] #[rustc_clean(cfg="cfail3")] pub fn add_lifetime_parameter_to_method<'a>(&self) { } @@ -323,14 +323,14 @@ impl Foo { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl Foo { - // Warning: Note that `TypeckTables` are coming up clean here. + // Warning: Note that `typeck_tables_of` are coming up clean here. // The addition or removal of type parameters that don't appear in // the arguments or fn body in any way does not, in fact, affect - // the `TypeckTables` in any semantic way (at least as of this + // the `typeck_tables_of` in any semantic way (at least as of this // writing). **However,** altering the order of lowering **can** - // cause it appear to affect the `TypeckTables`: if we lower + // cause it appear to affect the `typeck_tables_of`: if we lower // generics before the body, then the `HirId` for things in the - // body will be affected. So if you start to see `TypeckTables` + // body will be affected. So if you start to see `typeck_tables_of` // appear dirty, that might be the cause. -nmatsakis #[rustc_clean( cfg="cfail2", @@ -354,7 +354,7 @@ impl Foo { impl Foo { #[rustc_clean( cfg="cfail2", - except="Hir,HirBody,generics_of,predicates_of,type_of,TypeckTables" + except="Hir,HirBody,generics_of,predicates_of,type_of,typeck_tables_of" )] #[rustc_clean(cfg="cfail3")] pub fn add_lifetime_bound_to_lifetime_param_of_method<'a, 'b: 'a>(&self) { } @@ -372,14 +372,14 @@ impl Foo { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl Foo { - // Warning: Note that `TypeckTables` are coming up clean here. + // Warning: Note that `typeck_tables_of` are coming up clean here. // The addition or removal of bounds that don't appear in the // arguments or fn body in any way does not, in fact, affect the - // `TypeckTables` in any semantic way (at least as of this + // `typeck_tables_of` in any semantic way (at least as of this // writing). **However,** altering the order of lowering **can** - // cause it appear to affect the `TypeckTables`: if we lower + // cause it appear to affect the `typeck_tables_of`: if we lower // generics before the body, then the `HirId` for things in the - // body will be affected. So if you start to see `TypeckTables` + // body will be affected. So if you start to see `typeck_tables_of` // appear dirty, that might be the cause. -nmatsakis #[rustc_clean(cfg="cfail2", except="Hir,HirBody,generics_of,predicates_of,\ type_of")] @@ -399,14 +399,14 @@ impl Foo { #[rustc_clean(cfg="cfail2")] #[rustc_clean(cfg="cfail3")] impl Foo { - // Warning: Note that `TypeckTables` are coming up clean here. + // Warning: Note that `typeck_tables_of` are coming up clean here. // The addition or removal of bounds that don't appear in the // arguments or fn body in any way does not, in fact, affect the - // `TypeckTables` in any semantic way (at least as of this + // `typeck_tables_of` in any semantic way (at least as of this // writing). **However,** altering the order of lowering **can** - // cause it appear to affect the `TypeckTables`: if we lower + // cause it appear to affect the `typeck_tables_of`: if we lower // generics before the body, then the `HirId` for things in the - // body will be affected. So if you start to see `TypeckTables` + // body will be affected. So if you start to see `typeck_tables_of` // appear dirty, that might be the cause. -nmatsakis #[rustc_clean(cfg="cfail2", except="Hir,HirBody,predicates_of")] #[rustc_clean(cfg="cfail3")] @@ -447,7 +447,7 @@ impl Bar { impl Bar { #[rustc_clean( cfg="cfail2", - except="generics_of,FnSignature,TypeckTables,type_of,optimized_mir,mir_built" + except="generics_of,fn_sig,typeck_tables_of,type_of,optimized_mir,mir_built" )] #[rustc_clean(cfg="cfail3")] pub fn add_type_parameter_to_impl(&self) { } @@ -465,7 +465,7 @@ impl Bar { #[rustc_clean(cfg="cfail2", except="Hir,HirBody")] #[rustc_clean(cfg="cfail3")] impl Bar { - #[rustc_clean(cfg="cfail2", except="FnSignature,optimized_mir,mir_built,TypeckTables")] + #[rustc_clean(cfg="cfail2", except="fn_sig,optimized_mir,mir_built,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_impl_self_type(&self) { } } diff --git a/src/test/incremental/hashes/let_expressions.rs b/src/test/incremental/hashes/let_expressions.rs index 76be2ccbf608c..e016b92a9ebdf 100644 --- a/src/test/incremental/hashes/let_expressions.rs +++ b/src/test/incremental/hashes/let_expressions.rs @@ -38,7 +38,7 @@ pub fn add_type() { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,TypeckTables,mir_built,optimized_mir")] + except="HirBody,typeck_tables_of,mir_built,optimized_mir")] #[rustc_clean(cfg="cfail3")] pub fn add_type() { let _x: u32 = 2u32; @@ -54,7 +54,7 @@ pub fn change_type() { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,TypeckTables,mir_built,optimized_mir")] + except="HirBody,typeck_tables_of,mir_built,optimized_mir")] #[rustc_clean(cfg="cfail3")] pub fn change_type() { let _x: u8 = 2; @@ -70,7 +70,7 @@ pub fn change_mutability_of_reference_type() { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,TypeckTables,mir_built,optimized_mir")] + except="HirBody,typeck_tables_of,mir_built,optimized_mir")] #[rustc_clean(cfg="cfail3")] pub fn change_mutability_of_reference_type() { let _x: &mut u64; @@ -86,7 +86,7 @@ pub fn change_mutability_of_slot() { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,TypeckTables,mir_built,optimized_mir")] + except="HirBody,typeck_tables_of,mir_built,optimized_mir")] #[rustc_clean(cfg="cfail3")] pub fn change_mutability_of_slot() { let _x: u64 = 0; @@ -102,7 +102,7 @@ pub fn change_simple_binding_to_pattern() { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,TypeckTables,mir_built,optimized_mir")] + except="HirBody,typeck_tables_of,mir_built,optimized_mir")] #[rustc_clean(cfg="cfail3")] pub fn change_simple_binding_to_pattern() { let (_a, _b) = (0u8, 'x'); @@ -134,7 +134,7 @@ pub fn add_ref_in_pattern() { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,TypeckTables,mir_built,optimized_mir")] + except="HirBody,typeck_tables_of,mir_built,optimized_mir")] #[rustc_clean(cfg="cfail3")] pub fn add_ref_in_pattern() { let (ref _a, _b) = (1u8, 'y'); @@ -150,7 +150,7 @@ pub fn add_amp_in_pattern() { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,TypeckTables,mir_built,optimized_mir")] + except="HirBody,typeck_tables_of,mir_built,optimized_mir")] #[rustc_clean(cfg="cfail3")] pub fn add_amp_in_pattern() { let (&_a, _b) = (&1u8, 'y'); @@ -166,7 +166,7 @@ pub fn change_mutability_of_binding_in_pattern() { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,TypeckTables,mir_built,optimized_mir")] + except="HirBody,typeck_tables_of,mir_built,optimized_mir")] #[rustc_clean(cfg="cfail3")] pub fn change_mutability_of_binding_in_pattern() { let (mut _a, _b) = (99u8, 'q'); @@ -182,7 +182,7 @@ pub fn add_initializer() { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,TypeckTables,mir_built,optimized_mir")] + except="HirBody,typeck_tables_of,mir_built,optimized_mir")] #[rustc_clean(cfg="cfail3")] pub fn add_initializer() { let _x: i16 = 3i16; diff --git a/src/test/incremental/hashes/loop_expressions.rs b/src/test/incremental/hashes/loop_expressions.rs index 63cf1e9d5e826..c04bdd43a9528 100644 --- a/src/test/incremental/hashes/loop_expressions.rs +++ b/src/test/incremental/hashes/loop_expressions.rs @@ -47,7 +47,7 @@ pub fn add_break() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn add_break() { let mut _x = 0; @@ -118,7 +118,7 @@ pub fn change_break_label() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_break_label() { let mut _x = 0; @@ -168,7 +168,7 @@ pub fn change_continue_label() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_continue_label() { let mut _x = 0; @@ -193,7 +193,7 @@ pub fn change_continue_to_break() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_continue_to_break() { let mut _x = 0; diff --git a/src/test/incremental/hashes/match_expressions.rs b/src/test/incremental/hashes/match_expressions.rs index 37f6aa9ee9bdc..02f2cd6634daf 100644 --- a/src/test/incremental/hashes/match_expressions.rs +++ b/src/test/incremental/hashes/match_expressions.rs @@ -26,7 +26,7 @@ pub fn add_arm(x: u32) -> u32 { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,mir_built,optimized_mir,TypeckTables")] + except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn add_arm(x: u32) -> u32 { match x { @@ -75,7 +75,7 @@ pub fn add_guard_clause(x: u32, y: bool) -> u32 { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,mir_built,optimized_mir,TypeckTables")] + except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn add_guard_clause(x: u32, y: bool) -> u32 { match x { @@ -99,7 +99,7 @@ pub fn change_guard_clause(x: u32, y: bool) -> u32 { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,mir_built,optimized_mir,TypeckTables")] + except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_guard_clause(x: u32, y: bool) -> u32 { match x { @@ -123,7 +123,7 @@ pub fn add_at_binding(x: u32) -> u32 { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,mir_built,optimized_mir,TypeckTables")] + except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn add_at_binding(x: u32) -> u32 { match x { @@ -170,7 +170,7 @@ pub fn change_simple_name_to_pattern(x: u32) -> u32 { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,mir_built,optimized_mir,TypeckTables")] + except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_simple_name_to_pattern(x: u32) -> u32 { match (x, x & 1) { @@ -216,7 +216,7 @@ pub fn change_mutability_of_binding_in_pattern(x: u32) -> u32 { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,mir_built,optimized_mir,TypeckTables")] + except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_mutability_of_binding_in_pattern(x: u32) -> u32 { match (x, x & 1) { @@ -238,7 +238,7 @@ pub fn add_ref_to_binding_in_pattern(x: u32) -> u32 { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,mir_built,optimized_mir,TypeckTables")] + except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn add_ref_to_binding_in_pattern(x: u32) -> u32 { match (x, x & 1) { @@ -260,7 +260,7 @@ pub fn add_amp_to_binding_in_pattern(x: u32) -> u32 { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", -except="HirBody,mir_built,optimized_mir,TypeckTables")] +except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn add_amp_to_binding_in_pattern(x: u32) -> u32 { match (&x, x & 1) { @@ -307,7 +307,7 @@ pub fn add_alternative_to_arm(x: u32) -> u32 { #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", - except="HirBody,mir_built,optimized_mir,TypeckTables")] + except="HirBody,mir_built,optimized_mir,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn add_alternative_to_arm(x: u32) -> u32 { match x { diff --git a/src/test/incremental/hashes/struct_constructors.rs b/src/test/incremental/hashes/struct_constructors.rs index 3190f65a81731..e478ff96c3276 100644 --- a/src/test/incremental/hashes/struct_constructors.rs +++ b/src/test/incremental/hashes/struct_constructors.rs @@ -54,7 +54,7 @@ pub fn change_field_order_regular_struct() -> RegularStruct { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_field_order_regular_struct() -> RegularStruct { RegularStruct { @@ -82,7 +82,7 @@ pub fn add_field_regular_struct() -> RegularStruct { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn add_field_regular_struct() -> RegularStruct { let struct1 = RegularStruct { @@ -117,7 +117,7 @@ pub fn change_field_label_regular_struct() -> RegularStruct { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_field_label_regular_struct() -> RegularStruct { let struct1 = RegularStruct { @@ -152,7 +152,7 @@ pub fn change_constructor_path_regular_struct() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_constructor_path_regular_struct() { let _ = RegularStruct2 { @@ -173,7 +173,7 @@ pub mod change_constructor_path_indirectly_regular_struct { #[rustc_clean( cfg="cfail2", - except="FnSignature,Hir,HirBody,optimized_mir,mir_built,TypeckTables" + except="fn_sig,Hir,HirBody,optimized_mir,mir_built,typeck_tables_of" )] #[rustc_clean(cfg="cfail3")] pub fn function() -> Struct { @@ -213,7 +213,7 @@ pub fn change_constructor_path_tuple_struct() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody,optimized_mir,mir_built,typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_constructor_path_tuple_struct() { let _ = TupleStruct2(0, 1, 2); @@ -230,7 +230,7 @@ pub mod change_constructor_path_indirectly_tuple_struct { #[rustc_clean( cfg="cfail2", - except="FnSignature,Hir,HirBody,optimized_mir,mir_built,TypeckTables" + except="fn_sig,Hir,HirBody,optimized_mir,mir_built,typeck_tables_of" )] #[rustc_clean(cfg="cfail3")] pub fn function() -> Struct { diff --git a/src/test/incremental/hashes/unary_and_binary_exprs.rs b/src/test/incremental/hashes/unary_and_binary_exprs.rs index f3331ec61cb6a..8c53ae6a03854 100644 --- a/src/test/incremental/hashes/unary_and_binary_exprs.rs +++ b/src/test/incremental/hashes/unary_and_binary_exprs.rs @@ -81,7 +81,7 @@ pub fn var_deref(x: &i32, y: &i32) -> i32 { } #[cfg(not(cfail1))] -#[rustc_clean(except="HirBody,optimized_mir,mir_built,TypeckTables", cfg="cfail2")] +#[rustc_clean(except="HirBody,optimized_mir,mir_built,typeck_tables_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] pub fn var_deref(x: &i32, y: &i32) -> i32 { *y @@ -368,7 +368,7 @@ pub fn type_cast(a: u8) -> u64 { } #[cfg(not(cfail1))] -#[rustc_clean(except="HirBody,optimized_mir,mir_built,TypeckTables", cfg="cfail2")] +#[rustc_clean(except="HirBody,optimized_mir,mir_built,typeck_tables_of", cfg="cfail2")] #[rustc_clean(cfg="cfail3")] pub fn type_cast(a: u8) -> u64 { let b = a as u32; diff --git a/src/test/incremental/hashes/while_let_loops.rs b/src/test/incremental/hashes/while_let_loops.rs index 7e866ae925ed9..2d48707561c29 100644 --- a/src/test/incremental/hashes/while_let_loops.rs +++ b/src/test/incremental/hashes/while_let_loops.rs @@ -70,7 +70,7 @@ pub fn add_break() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn add_break() { let mut _x = 0; @@ -141,7 +141,7 @@ pub fn change_break_label() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_break_label() { let mut _x = 0; @@ -191,7 +191,7 @@ pub fn change_continue_label() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn change_continue_label() { let mut _x = 0; diff --git a/src/test/incremental/hashes/while_loops.rs b/src/test/incremental/hashes/while_loops.rs index cbd1341fdd4fb..79a3bc9b20504 100644 --- a/src/test/incremental/hashes/while_loops.rs +++ b/src/test/incremental/hashes/while_loops.rs @@ -70,7 +70,7 @@ pub fn add_break() { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, TypeckTables")] +#[rustc_clean(cfg="cfail2", except="HirBody, mir_built, optimized_mir, typeck_tables_of")] #[rustc_clean(cfg="cfail3")] pub fn add_break() { let mut _x = 0; diff --git a/src/test/incremental/hello_world.rs b/src/test/incremental/hello_world.rs index e2e15eb958f98..e4d8c56752c78 100644 --- a/src/test/incremental/hello_world.rs +++ b/src/test/incremental/hello_world.rs @@ -21,7 +21,7 @@ mod x { mod y { use x; - #[rustc_clean(label="TypeckTables", cfg="rpass2")] + #[rustc_clean(label="typeck_tables_of", cfg="rpass2")] pub fn yyyy() { x::xxxx(); } @@ -30,7 +30,7 @@ mod y { mod z { use y; - #[rustc_clean(label="TypeckTables", cfg="rpass2")] + #[rustc_clean(label="typeck_tables_of", cfg="rpass2")] pub fn z() { y::yyyy(); } diff --git a/src/test/incremental/ich_method_call_trait_scope.rs b/src/test/incremental/ich_method_call_trait_scope.rs index d4b170bd277c1..9dfd2ae2511b1 100644 --- a/src/test/incremental/ich_method_call_trait_scope.rs +++ b/src/test/incremental/ich_method_call_trait_scope.rs @@ -28,14 +28,14 @@ mod mod3 { #[rustc_clean(label="Hir", cfg="rpass2")] #[rustc_clean(label="HirBody", cfg="rpass2")] - #[rustc_dirty(label="TypeckTables", cfg="rpass2")] + #[rustc_dirty(label="typeck_tables_of", cfg="rpass2")] fn bar() { ().method(); } #[rustc_clean(label="Hir", cfg="rpass2")] #[rustc_clean(label="HirBody", cfg="rpass2")] - #[rustc_clean(label="TypeckTables", cfg="rpass2")] + #[rustc_clean(label="typeck_tables_of", cfg="rpass2")] fn baz() { 22; // no method call, traits in scope don't matter } diff --git a/src/test/incremental/rlib_cross_crate/b.rs b/src/test/incremental/rlib_cross_crate/b.rs index 7c3dcf3a8157b..81b84ba741dc8 100644 --- a/src/test/incremental/rlib_cross_crate/b.rs +++ b/src/test/incremental/rlib_cross_crate/b.rs @@ -12,15 +12,15 @@ extern crate a; -#[rustc_dirty(label="TypeckTables", cfg="rpass2")] -#[rustc_clean(label="TypeckTables", cfg="rpass3")] +#[rustc_dirty(label="typeck_tables_of", cfg="rpass2")] +#[rustc_clean(label="typeck_tables_of", cfg="rpass3")] pub fn use_X() -> u32 { let x: a::X = 22; x as u32 } -#[rustc_clean(label="TypeckTables", cfg="rpass2")] -#[rustc_clean(label="TypeckTables", cfg="rpass3")] +#[rustc_clean(label="typeck_tables_of", cfg="rpass2")] +#[rustc_clean(label="typeck_tables_of", cfg="rpass3")] pub fn use_Y() { let x: a::Y = 'c'; } diff --git a/src/test/incremental/string_constant.rs b/src/test/incremental/string_constant.rs index db2660bb66129..c39d4145b586f 100644 --- a/src/test/incremental/string_constant.rs +++ b/src/test/incremental/string_constant.rs @@ -28,7 +28,7 @@ pub mod x { pub mod y { use x; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] #[rustc_clean(label="optimized_mir", cfg="cfail2")] pub fn y() { x::x(); @@ -38,7 +38,7 @@ pub mod y { pub mod z { use y; - #[rustc_clean(label="TypeckTables", cfg="cfail2")] + #[rustc_clean(label="typeck_tables_of", cfg="cfail2")] #[rustc_clean(label="optimized_mir", cfg="cfail2")] pub fn z() { y::y(); diff --git a/src/test/incremental/struct_add_field.rs b/src/test/incremental/struct_add_field.rs index d019a3d2ab887..d2e1e7decf54e 100644 --- a/src/test/incremental/struct_add_field.rs +++ b/src/test/incremental/struct_add_field.rs @@ -21,17 +21,17 @@ pub struct Y { pub y: char } -#[rustc_dirty(label="TypeckTables", cfg="rpass2")] +#[rustc_dirty(label="typeck_tables_of", cfg="rpass2")] pub fn use_X(x: X) -> u32 { x.x as u32 } -#[rustc_dirty(label="TypeckTables", cfg="rpass2")] +#[rustc_dirty(label="typeck_tables_of", cfg="rpass2")] pub fn use_EmbedX(embed: EmbedX) -> u32 { embed.x.x as u32 } -#[rustc_clean(label="TypeckTables", cfg="rpass2")] +#[rustc_clean(label="typeck_tables_of", cfg="rpass2")] pub fn use_Y() { let x: Y = Y { y: 'c' }; } diff --git a/src/test/incremental/struct_change_field_name.rs b/src/test/incremental/struct_change_field_name.rs index 28011efed9cee..68356f703bcf8 100644 --- a/src/test/incremental/struct_change_field_name.rs +++ b/src/test/incremental/struct_change_field_name.rs @@ -24,7 +24,7 @@ pub struct Y { pub y: char } -#[rustc_dirty(label="TypeckTables", cfg="cfail2")] +#[rustc_dirty(label="typeck_tables_of", cfg="cfail2")] pub fn use_X() -> u32 { let x: X = X { x: 22 }; //[cfail2]~^ ERROR struct `X` has no field named `x` @@ -32,13 +32,13 @@ pub fn use_X() -> u32 { //[cfail2]~^ ERROR no field `x` on type `X` } -#[rustc_dirty(label="TypeckTables", cfg="cfail2")] +#[rustc_dirty(label="typeck_tables_of", cfg="cfail2")] pub fn use_EmbedX(embed: EmbedX) -> u32 { embed.x.x as u32 //[cfail2]~^ ERROR no field `x` on type `X` } -#[rustc_clean(label="TypeckTables", cfg="cfail2")] +#[rustc_clean(label="typeck_tables_of", cfg="cfail2")] pub fn use_Y() { let x: Y = Y { y: 'c' }; } diff --git a/src/test/incremental/struct_change_field_type.rs b/src/test/incremental/struct_change_field_type.rs index cb4a83c2f9a40..308ec84fa72ef 100644 --- a/src/test/incremental/struct_change_field_type.rs +++ b/src/test/incremental/struct_change_field_type.rs @@ -24,19 +24,19 @@ pub struct Y { pub y: char } -#[rustc_dirty(label="TypeckTables", cfg="rpass2")] +#[rustc_dirty(label="typeck_tables_of", cfg="rpass2")] pub fn use_X() -> u32 { let x: X = X { x: 22 }; x.x as u32 } -#[rustc_dirty(label="TypeckTables", cfg="rpass2")] +#[rustc_dirty(label="typeck_tables_of", cfg="rpass2")] pub fn use_EmbedX(x: EmbedX) -> u32 { let x: X = X { x: 22 }; x.x as u32 } -#[rustc_clean(label="TypeckTables", cfg="rpass2")] +#[rustc_clean(label="typeck_tables_of", cfg="rpass2")] pub fn use_Y() { let x: Y = Y { y: 'c' }; } diff --git a/src/test/incremental/struct_change_field_type_cross_crate/b.rs b/src/test/incremental/struct_change_field_type_cross_crate/b.rs index ecfd24cbaf418..9d84c2cf773b8 100644 --- a/src/test/incremental/struct_change_field_type_cross_crate/b.rs +++ b/src/test/incremental/struct_change_field_type_cross_crate/b.rs @@ -8,18 +8,18 @@ extern crate a; use a::*; -#[rustc_dirty(label="TypeckTables", cfg="rpass2")] +#[rustc_dirty(label="typeck_tables_of", cfg="rpass2")] pub fn use_X() -> u32 { let x: X = X { x: 22 }; x.x as u32 } -#[rustc_dirty(label="TypeckTables", cfg="rpass2")] +#[rustc_dirty(label="typeck_tables_of", cfg="rpass2")] pub fn use_EmbedX(embed: EmbedX) -> u32 { embed.x.x as u32 } -#[rustc_clean(label="TypeckTables", cfg="rpass2")] +#[rustc_clean(label="typeck_tables_of", cfg="rpass2")] pub fn use_Y() { let x: Y = Y { y: 'c' }; } diff --git a/src/test/incremental/struct_change_nothing.rs b/src/test/incremental/struct_change_nothing.rs index e62c004a83da0..bbded1da21619 100644 --- a/src/test/incremental/struct_change_nothing.rs +++ b/src/test/incremental/struct_change_nothing.rs @@ -24,19 +24,19 @@ pub struct Y { pub y: char } -#[rustc_clean(label="TypeckTables", cfg="rpass2")] +#[rustc_clean(label="typeck_tables_of", cfg="rpass2")] pub fn use_X() -> u32 { let x: X = X { x: 22 }; x.x as u32 } -#[rustc_clean(label="TypeckTables", cfg="rpass2")] +#[rustc_clean(label="typeck_tables_of", cfg="rpass2")] pub fn use_EmbedX(x: EmbedX) -> u32 { let x: X = X { x: 22 }; x.x as u32 } -#[rustc_clean(label="TypeckTables", cfg="rpass2")] +#[rustc_clean(label="typeck_tables_of", cfg="rpass2")] pub fn use_Y() { let x: Y = Y { y: 'c' }; } diff --git a/src/test/incremental/struct_remove_field.rs b/src/test/incremental/struct_remove_field.rs index 572a2c640e6d2..4c4028bbe5bdd 100644 --- a/src/test/incremental/struct_remove_field.rs +++ b/src/test/incremental/struct_remove_field.rs @@ -25,17 +25,17 @@ pub struct Y { pub y: char } -#[rustc_dirty(label="TypeckTables", cfg="rpass2")] +#[rustc_dirty(label="typeck_tables_of", cfg="rpass2")] pub fn use_X(x: X) -> u32 { x.x as u32 } -#[rustc_dirty(label="TypeckTables", cfg="rpass2")] +#[rustc_dirty(label="typeck_tables_of", cfg="rpass2")] pub fn use_EmbedX(embed: EmbedX) -> u32 { embed.x.x as u32 } -#[rustc_clean(label="TypeckTables", cfg="rpass2")] +#[rustc_clean(label="typeck_tables_of", cfg="rpass2")] pub fn use_Y() { let x: Y = Y { y: 'c' }; } diff --git a/src/test/incremental/type_alias_cross_crate/b.rs b/src/test/incremental/type_alias_cross_crate/b.rs index 9261a0fb290ea..cef2e4bab12d7 100644 --- a/src/test/incremental/type_alias_cross_crate/b.rs +++ b/src/test/incremental/type_alias_cross_crate/b.rs @@ -6,15 +6,15 @@ extern crate a; -#[rustc_dirty(label="TypeckTables", cfg="rpass2")] -#[rustc_clean(label="TypeckTables", cfg="rpass3")] +#[rustc_dirty(label="typeck_tables_of", cfg="rpass2")] +#[rustc_clean(label="typeck_tables_of", cfg="rpass3")] pub fn use_X() -> u32 { let x: a::X = 22; x as u32 } -#[rustc_clean(label="TypeckTables", cfg="rpass2")] -#[rustc_clean(label="TypeckTables", cfg="rpass3")] +#[rustc_clean(label="typeck_tables_of", cfg="rpass2")] +#[rustc_clean(label="typeck_tables_of", cfg="rpass3")] pub fn use_Y() { let x: a::Y = 'c'; } diff --git a/src/test/ui/dep-graph/dep-graph-assoc-type-codegen.rs b/src/test/ui/dep-graph/dep-graph-assoc-type-codegen.rs index f3df57e6ff911..bcf7e3e6608ea 100644 --- a/src/test/ui/dep-graph/dep-graph-assoc-type-codegen.rs +++ b/src/test/ui/dep-graph/dep-graph-assoc-type-codegen.rs @@ -25,7 +25,7 @@ mod x { mod y { use Foo; - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR OK pub fn use_char_assoc() { // Careful here: in the representation, ::T gets // normalized away, so at a certain point we had no edge to diff --git a/src/test/ui/dep-graph/dep-graph-assoc-type-codegen.stderr b/src/test/ui/dep-graph/dep-graph-assoc-type-codegen.stderr index db6ee98bb7b12..a603d71596ba6 100644 --- a/src/test/ui/dep-graph/dep-graph-assoc-type-codegen.stderr +++ b/src/test/ui/dep-graph/dep-graph-assoc-type-codegen.stderr @@ -1,8 +1,8 @@ error: OK --> $DIR/dep-graph-assoc-type-codegen.rs:28:5 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/dep-graph/dep-graph-caller-callee.rs b/src/test/ui/dep-graph/dep-graph-caller-callee.rs index f8276ea3ad638..18b4252a06b84 100644 --- a/src/test/ui/dep-graph/dep-graph-caller-callee.rs +++ b/src/test/ui/dep-graph/dep-graph-caller-callee.rs @@ -17,7 +17,7 @@ mod y { use x; // These dependencies SHOULD exist: - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR OK pub fn y() { x::x(); } @@ -28,7 +28,7 @@ mod z { // These are expected to yield errors, because changes to `x` // affect the BODY of `y`, but not its signature. - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR no path pub fn z() { y::y(); } diff --git a/src/test/ui/dep-graph/dep-graph-caller-callee.stderr b/src/test/ui/dep-graph/dep-graph-caller-callee.stderr index 2b1b7fe9a565c..de041e600672d 100644 --- a/src/test/ui/dep-graph/dep-graph-caller-callee.stderr +++ b/src/test/ui/dep-graph/dep-graph-caller-callee.stderr @@ -1,14 +1,14 @@ error: OK --> $DIR/dep-graph-caller-callee.rs:20:5 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: no path from `x::x` to `TypeckTables` +error: no path from `x::x` to `typeck_tables_of` --> $DIR/dep-graph-caller-callee.rs:31:5 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/dep-graph/dep-graph-struct-signature.rs b/src/test/ui/dep-graph/dep-graph-struct-signature.rs index bd6d3a7e56fc3..8b78d39ecae33 100644 --- a/src/test/ui/dep-graph/dep-graph-struct-signature.rs +++ b/src/test/ui/dep-graph/dep-graph-struct-signature.rs @@ -25,34 +25,34 @@ mod signatures { use WillChange; #[rustc_then_this_would_need(type_of)] //~ ERROR no path - #[rustc_then_this_would_need(AssociatedItems)] //~ ERROR no path - #[rustc_then_this_would_need(TraitDefOfItem)] //~ ERROR no path + #[rustc_then_this_would_need(associated_item)] //~ ERROR no path + #[rustc_then_this_would_need(trait_def)] //~ ERROR no path trait Bar { - #[rustc_then_this_would_need(FnSignature)] //~ ERROR OK + #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK fn do_something(x: WillChange); } - #[rustc_then_this_would_need(FnSignature)] //~ ERROR OK - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR OK fn some_fn(x: WillChange) { } - #[rustc_then_this_would_need(FnSignature)] //~ ERROR OK - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR OK fn new_foo(x: u32, y: u32) -> WillChange { WillChange { x: x, y: y } } #[rustc_then_this_would_need(type_of)] //~ ERROR OK impl WillChange { - #[rustc_then_this_would_need(FnSignature)] //~ ERROR OK - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR OK fn new(x: u32, y: u32) -> WillChange { loop { } } } #[rustc_then_this_would_need(type_of)] //~ ERROR OK impl WillChange { - #[rustc_then_this_would_need(FnSignature)] //~ ERROR OK - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR OK fn method(&self, x: u32) { } } @@ -73,14 +73,14 @@ mod invalid_signatures { #[rustc_then_this_would_need(type_of)] //~ ERROR no path trait A { - #[rustc_then_this_would_need(FnSignature)] //~ ERROR no path + #[rustc_then_this_would_need(fn_sig)] //~ ERROR no path fn do_something_else_twice(x: WontChange); } - #[rustc_then_this_would_need(FnSignature)] //~ ERROR no path + #[rustc_then_this_would_need(fn_sig)] //~ ERROR no path fn b(x: WontChange) { } - #[rustc_then_this_would_need(FnSignature)] //~ ERROR no path from `WillChange` - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path from `WillChange` + #[rustc_then_this_would_need(fn_sig)] //~ ERROR no path from `WillChange` + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR no path from `WillChange` fn c(x: u32) { } } diff --git a/src/test/ui/dep-graph/dep-graph-struct-signature.stderr b/src/test/ui/dep-graph/dep-graph-struct-signature.stderr index 7aa4251752e5c..2e00e5a2cbd2f 100644 --- a/src/test/ui/dep-graph/dep-graph-struct-signature.stderr +++ b/src/test/ui/dep-graph/dep-graph-struct-signature.stderr @@ -4,41 +4,41 @@ error: no path from `WillChange` to `type_of` LL | #[rustc_then_this_would_need(type_of)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: no path from `WillChange` to `AssociatedItems` +error: no path from `WillChange` to `associated_item` --> $DIR/dep-graph-struct-signature.rs:28:5 | -LL | #[rustc_then_this_would_need(AssociatedItems)] +LL | #[rustc_then_this_would_need(associated_item)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: no path from `WillChange` to `TraitDefOfItem` +error: no path from `WillChange` to `trait_def` --> $DIR/dep-graph-struct-signature.rs:29:5 | -LL | #[rustc_then_this_would_need(TraitDefOfItem)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(trait_def)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-struct-signature.rs:35:5 | -LL | #[rustc_then_this_would_need(FnSignature)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(fn_sig)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-struct-signature.rs:36:5 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-struct-signature.rs:39:5 | -LL | #[rustc_then_this_would_need(FnSignature)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(fn_sig)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-struct-signature.rs:40:5 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-struct-signature.rs:45:5 @@ -76,59 +76,59 @@ error: no path from `WillChange` to `type_of` LL | #[rustc_then_this_would_need(type_of)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: no path from `WillChange` to `FnSignature` +error: no path from `WillChange` to `fn_sig` --> $DIR/dep-graph-struct-signature.rs:80:5 | -LL | #[rustc_then_this_would_need(FnSignature)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(fn_sig)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: no path from `WillChange` to `FnSignature` +error: no path from `WillChange` to `fn_sig` --> $DIR/dep-graph-struct-signature.rs:83:5 | -LL | #[rustc_then_this_would_need(FnSignature)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(fn_sig)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: no path from `WillChange` to `TypeckTables` +error: no path from `WillChange` to `typeck_tables_of` --> $DIR/dep-graph-struct-signature.rs:84:5 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-struct-signature.rs:31:9 | -LL | #[rustc_then_this_would_need(FnSignature)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(fn_sig)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: no path from `WillChange` to `FnSignature` +error: no path from `WillChange` to `fn_sig` --> $DIR/dep-graph-struct-signature.rs:76:9 | -LL | #[rustc_then_this_would_need(FnSignature)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(fn_sig)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-struct-signature.rs:47:9 | -LL | #[rustc_then_this_would_need(FnSignature)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(fn_sig)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-struct-signature.rs:48:9 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-struct-signature.rs:54:9 | -LL | #[rustc_then_this_would_need(FnSignature)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(fn_sig)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-struct-signature.rs:55:9 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 22 previous errors diff --git a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.rs b/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.rs index 16e5a705d25e3..38622a754ddb2 100644 --- a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.rs +++ b/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.rs @@ -29,7 +29,7 @@ mod x { mod y { use {Foo, Bar}; - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR OK pub fn with_char() { char::method('a'); } @@ -38,7 +38,7 @@ mod y { mod z { use y; - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR no path pub fn z() { y::with_char(); } diff --git a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.stderr b/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.stderr index 2df4b9ec39d16..3384fd7b4acf5 100644 --- a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.stderr +++ b/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.stderr @@ -1,14 +1,14 @@ error: OK --> $DIR/dep-graph-trait-impl-two-traits-same-method.rs:32:5 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: no path from `x::` to `TypeckTables` +error: no path from `x::` to `typeck_tables_of` --> $DIR/dep-graph-trait-impl-two-traits-same-method.rs:41:5 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.rs b/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.rs index 064302c9c805f..82306b6539c15 100644 --- a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.rs +++ b/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.rs @@ -28,7 +28,7 @@ mod x { mod y { use {Foo, Bar}; - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR no path pub fn call_bar() { char::bar('a'); } @@ -37,7 +37,7 @@ mod y { mod z { use y; - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR no path pub fn z() { y::call_bar(); } diff --git a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.stderr b/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.stderr index 54125367f90c1..d8a1f05dcaa79 100644 --- a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.stderr +++ b/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.stderr @@ -1,14 +1,14 @@ -error: no path from `x::` to `TypeckTables` +error: no path from `x::` to `typeck_tables_of` --> $DIR/dep-graph-trait-impl-two-traits.rs:31:5 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: no path from `x::` to `TypeckTables` +error: no path from `x::` to `typeck_tables_of` --> $DIR/dep-graph-trait-impl-two-traits.rs:40:5 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/dep-graph/dep-graph-trait-impl.rs b/src/test/ui/dep-graph/dep-graph-trait-impl.rs index 7d088082c7a4c..e4483b9f71ddb 100644 --- a/src/test/ui/dep-graph/dep-graph-trait-impl.rs +++ b/src/test/ui/dep-graph/dep-graph-trait-impl.rs @@ -24,22 +24,22 @@ mod x { mod y { use Foo; - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR OK pub fn with_char() { char::method('a'); } - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR OK pub fn take_foo_with_char() { take_foo::('a'); } - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR OK pub fn with_u32() { u32::method(22); } - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR OK pub fn take_foo_with_u32() { take_foo::(22); } @@ -52,7 +52,7 @@ mod z { // These are expected to yield errors, because changes to `x` // affect the BODY of `y`, but not its signature. - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR no path pub fn z() { y::with_char(); y::with_u32(); diff --git a/src/test/ui/dep-graph/dep-graph-trait-impl.stderr b/src/test/ui/dep-graph/dep-graph-trait-impl.stderr index 97072e74f429e..ca9676a9478e4 100644 --- a/src/test/ui/dep-graph/dep-graph-trait-impl.stderr +++ b/src/test/ui/dep-graph/dep-graph-trait-impl.stderr @@ -1,32 +1,32 @@ error: OK --> $DIR/dep-graph-trait-impl.rs:27:5 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-trait-impl.rs:32:5 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-trait-impl.rs:37:5 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-trait-impl.rs:42:5 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: no path from `x::` to `TypeckTables` +error: no path from `x::` to `typeck_tables_of` --> $DIR/dep-graph-trait-impl.rs:55:5 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/dep-graph/dep-graph-type-alias.rs b/src/test/ui/dep-graph/dep-graph-type-alias.rs index 5621284fb18b2..2d4a18f2818b5 100644 --- a/src/test/ui/dep-graph/dep-graph-type-alias.rs +++ b/src/test/ui/dep-graph/dep-graph-type-alias.rs @@ -32,7 +32,7 @@ enum Enum { #[rustc_then_this_would_need(type_of)] //~ ERROR no path trait Trait { - #[rustc_then_this_would_need(FnSignature)] //~ ERROR OK + #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK fn method(&self, _: TypeAlias); } @@ -40,16 +40,16 @@ struct SomeType; #[rustc_then_this_would_need(type_of)] //~ ERROR no path impl SomeType { - #[rustc_then_this_would_need(FnSignature)] //~ ERROR OK - #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + #[rustc_then_this_would_need(fn_sig)] //~ ERROR OK + #[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR OK fn method(&self, _: TypeAlias) {} } #[rustc_then_this_would_need(type_of)] //~ ERROR OK type TypeAlias2 = TypeAlias; -#[rustc_then_this_would_need(FnSignature)] //~ ERROR OK -#[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK +#[rustc_then_this_would_need(fn_sig)] //~ ERROR OK +#[rustc_then_this_would_need(typeck_tables_of)] //~ ERROR OK fn function(_: TypeAlias) { } diff --git a/src/test/ui/dep-graph/dep-graph-type-alias.stderr b/src/test/ui/dep-graph/dep-graph-type-alias.stderr index 520c2a5ed2182..393e4badc1608 100644 --- a/src/test/ui/dep-graph/dep-graph-type-alias.stderr +++ b/src/test/ui/dep-graph/dep-graph-type-alias.stderr @@ -43,32 +43,32 @@ LL | #[rustc_then_this_would_need(type_of)] error: OK --> $DIR/dep-graph-type-alias.rs:51:1 | -LL | #[rustc_then_this_would_need(FnSignature)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(fn_sig)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-type-alias.rs:52:1 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-type-alias.rs:35:5 | -LL | #[rustc_then_this_would_need(FnSignature)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(fn_sig)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-type-alias.rs:43:5 | -LL | #[rustc_then_this_would_need(FnSignature)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(fn_sig)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: OK --> $DIR/dep-graph-type-alias.rs:44:5 | -LL | #[rustc_then_this_would_need(TypeckTables)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(typeck_tables_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 12 previous errors diff --git a/src/test/ui/dep-graph/dep-graph-variance-alias.rs b/src/test/ui/dep-graph/dep-graph-variance-alias.rs index 0a70bfd08bf27..95645687307a3 100644 --- a/src/test/ui/dep-graph/dep-graph-variance-alias.rs +++ b/src/test/ui/dep-graph/dep-graph-variance-alias.rs @@ -16,7 +16,7 @@ struct Foo { #[rustc_if_this_changed(Krate)] type TypeAlias = Foo; -#[rustc_then_this_would_need(ItemVariances)] //~ ERROR OK +#[rustc_then_this_would_need(variances_of)] //~ ERROR OK struct Use { x: TypeAlias } diff --git a/src/test/ui/dep-graph/dep-graph-variance-alias.stderr b/src/test/ui/dep-graph/dep-graph-variance-alias.stderr index 86cb0f9fe325d..554ff455a2073 100644 --- a/src/test/ui/dep-graph/dep-graph-variance-alias.stderr +++ b/src/test/ui/dep-graph/dep-graph-variance-alias.stderr @@ -1,8 +1,8 @@ error: OK --> $DIR/dep-graph-variance-alias.rs:19:1 | -LL | #[rustc_then_this_would_need(ItemVariances)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_then_this_would_need(variances_of)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/tools/miri b/src/tools/miri index 72b4ee0381dec..82f9a0173011b 160000 --- a/src/tools/miri +++ b/src/tools/miri @@ -1 +1 @@ -Subproject commit 72b4ee0381decf609204e5548c1f5e79bdfb18b7 +Subproject commit 82f9a0173011b96411d315b332754ee6b35cf00f diff --git a/src/tools/rustc-workspace-hack/Cargo.toml b/src/tools/rustc-workspace-hack/Cargo.toml index 1aba52bafbbc7..d51841cd65075 100644 --- a/src/tools/rustc-workspace-hack/Cargo.toml +++ b/src/tools/rustc-workspace-hack/Cargo.toml @@ -57,7 +57,7 @@ features = [ [dependencies] curl-sys = { version = "0.4.13", features = ["http2", "libnghttp2-sys"], optional = true } parking_lot = { version = "0.7", features = ['nightly'] } -rand = { version = "0.5.5", features = ["i128_support"] } +rand = { version = "0.6.1", features = ["i128_support"] } serde = { version = "1.0.82", features = ['derive'] } serde_json = { version = "1.0.31", features = ["raw_value"] } smallvec = { version = "0.6", features = ['union', 'may_dangle'] }