Auto merge of #59517 - Zoxc:new-queries, r=oli-obk

Move query definitions over to the proc macro

r? @oli-obk
This commit is contained in:
bors 2019-04-04 08:26:18 +00:00
commit e43f99ce57
59 changed files with 1273 additions and 2315 deletions

View file

@ -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<Self> {
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;

View file

@ -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<ty::GenericPredicates<'tcx>> {}
/// Returns the predicates written explicit by the user.
query explicit_predicates_of(_: DefId)
-> Lrc<ty::GenericPredicates<'tcx>> {}
/// 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<Vec<ty::Predicate<'tcx>>> {}
/// 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<ty::GenericPredicates<'tcx>> {
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<ty::GenericPredicates<'tcx>> {
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<ty::Destructor> {}
// 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<DtorckConstraint<'tcx>, 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<ty::CrateVariancesMap> {
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<Vec<ty::Variance>> {}
}
TypeChecking {
/// Maps from def-id of a type to its (inferred) outlives.
query inferred_outlives_crate(_: CrateNum)
-> Lrc<ty::CratePredicatesMap<'tcx>> {
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<Vec<DefId>> {}
/// Maps from a trait item to the trait item "descriptor"
query associated_item(_: DefId) -> ty::AssociatedItem {}
query impl_trait_ref(_: DefId) -> Option<ty::TraitRef<'tcx>> {}
query impl_polarity(_: DefId) -> hir::ImplPolarity {}
query issue33140_self_ty(_: DefId) -> Option<ty::Ty<'tcx>> {}
}
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<Vec<DefId>> {
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<ty::TypeckTables<'tcx>> = 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<DefIdSet> {}
}
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<BorrowCheckResult> {}
/// 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<CrateInherentImpls> {
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<AccessLevels> {
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<region::ScopeTree> {}
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<Def> {}
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<DeprecationEntry> {}
query item_attrs(_: DefId) -> Lrc<[ast::Attribute]> {}
}
Codegen {
query codegen_fn_attrs(_: DefId) -> CodegenFnAttrs {}
}
Other {
query fn_arg_names(_: DefId) -> Vec<ast::Name> {}
/// Gets the rendered value of the specified constant or associated constant.
/// Used by rustdoc.
query rendered_const(_: DefId) -> String {}
query impl_parent(_: DefId) -> Option<DefId> {}
}
TypeChecking {
query trait_of_item(_: DefId) -> Option<DefId> {}
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<ItemLocalSet> {
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<Vec<Option<(DefId, SubstsRef<'tcx>)>>> {
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<ty::trait_def::TraitImpls> {
desc { |tcx| "trait impls of `{}`", tcx.def_path_str(key) }
}
query specialization_graph_of(_: DefId)
-> Lrc<specialization_graph::Graph> {}
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<Vec<(CrateNum, LinkagePreference)>> {
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<Option<ExternCrate>> {
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<Lrc<FxHashMap<ItemLocalId, Lrc<StableVec<TraitCandidate>>>>> {
eval_always
desc { "traits in scope at a block" }
}
}
Other {
query module_exports(_: DefId) -> Option<Lrc<Vec<Export>>> {
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<DefIdMap<SymbolExportLevel>> {
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<DefIdMap<Lrc<FxHashMap<SubstsRef<'tcx>, CrateNum>>>> {
desc { "collecting available upstream monomorphizations `{:?}`", k }
}
query upstream_monomorphizations_for(_: DefId)
-> Option<Lrc<FxHashMap<SubstsRef<'tcx>, CrateNum>>> {}
}
Other {
query foreign_modules(_: CrateNum) -> Lrc<Vec<ForeignModule>> {
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<DefId> {
desc { "looking up the plugin registrar for a crate" }
}
query proc_macro_decls_static(_: CrateNum) -> Option<DefId> {
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<Vec<DefId>> {
no_force
desc { "looking up implementations of a trait in a crate" }
}
query all_trait_implementations(_: CrateNum)
-> Lrc<Vec<DefId>> {
desc { "looking up all (?) trait implementations" }
}
}
Other {
query dllimport_foreign_items(_: CrateNum)
-> Lrc<FxHashSet<DefId>> {
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<NativeLibraryKind> {}
}
Linking {
query link_args(_: CrateNum) -> Lrc<Vec<String>> {
eval_always
desc { "looking up link arguments for a crate" }
}
}
BorrowChecking {
// Lifetime resolution. See `middle::resolve_lifetimes`.
query resolve_lifetimes(_: CrateNum) -> Lrc<ResolveLifetimes> {
desc { "resolving lifetimes" }
}
query named_region_map(_: DefIndex) ->
Option<Lrc<FxHashMap<ItemLocalId, Region>>> {
desc { "looking up a named region" }
}
query is_late_bound_map(_: DefIndex) ->
Option<Lrc<FxHashSet<ItemLocalId>>> {
desc { "testing if a region is late bound" }
}
query object_lifetime_defaults_map(_: DefIndex)
-> Option<Lrc<FxHashMap<ItemLocalId, Lrc<Vec<ObjectLifetimeDefault>>>>> {
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<Vec<Export>> {}
query extern_mod_stmt_cnum(_: DefId) -> Option<CrateNum> {}
query get_lib_features(_: CrateNum) -> Lrc<LibFeatures> {
eval_always
desc { "calculating the lib features map" }
}
query defined_lib_features(_: CrateNum)
-> Lrc<Vec<(Symbol, Option<Symbol>)>> {
desc { "calculating the lib features defined in a crate" }
}
query get_lang_items(_: CrateNum) -> Lrc<LanguageItems> {
eval_always
desc { "calculating the lang items map" }
}
query defined_lang_items(_: CrateNum) -> Lrc<Vec<(DefId, usize)>> {
desc { "calculating the lang items defined in a crate" }
}
query missing_lang_items(_: CrateNum) -> Lrc<Vec<LangItem>> {
desc { "calculating the missing lang items in a crate" }
}
query visible_parent_map(_: CrateNum)
-> Lrc<DefIdMap<DefId>> {
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<CrateSource> {
eval_always
desc { "looking at the source for a crate" }
}
query postorder_cnums(_: CrateNum) -> Lrc<Vec<CrateNum>> {
eval_always
desc { "generating a postorder list of CrateNums" }
}
query freevars(_: DefId) -> Option<Lrc<Vec<hir::Freevar>>> {
eval_always
}
query maybe_unused_trait_import(_: DefId) -> bool {
eval_always
}
query maybe_unused_extern_crates(_: CrateNum)
-> Lrc<Vec<(DefId, Span)>> {
eval_always
desc { "looking up all possibly unused extern crates" }
}
query names_imported_by_glob_use(_: DefId)
-> Lrc<FxHashSet<ast::Name>> {
eval_always
}
query stability_index(_: CrateNum) -> Lrc<stability::Index<'tcx>> {
eval_always
desc { "calculating the stability index for the local crate" }
}
query all_crate_nums(_: CrateNum) -> Lrc<Vec<CrateNum>> {
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<Vec<DefId>> {
desc { "fetching all foreign and local traits" }
}
}
Linking {
query exported_symbols(_: CrateNum)
-> Arc<Vec<(ExportedSymbol<'tcx>, SymbolExportLevel)>> {
desc { "exported_symbols" }
}
}
Codegen {
query collect_and_partition_mono_items(_: CrateNum)
-> (Arc<DefIdSet>, Arc<Vec<Arc<CodegenUnit<'tcx>>>>) {
eval_always
desc { "collect_and_partition_mono_items" }
}
query is_codegened_item(_: DefId) -> bool {}
query codegen_unit(_: InternedString) -> Arc<CodegenUnit<'tcx>> {
no_force
desc { "codegen_unit" }
}
query backend_optimization_level(_: CrateNum) -> OptLevel {
desc { "optimization level used by backend" }
}
}
Other {
query output_filenames(_: CrateNum) -> Arc<OutputFilenames> {
eval_always
desc { "output_filenames" }
}
}
TypeChecking {
/// Do not call this query directly: invoke `normalize` instead.
query normalize_projection_ty(
goal: CanonicalProjectionGoal<'tcx>
) -> Result<
Lrc<Canonical<'tcx, canonical::QueryResponse<'tcx, NormalizationResult<'tcx>>>>,
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<Canonical<'tcx, canonical::QueryResponse<'tcx, Vec<OutlivesBound<'tcx>>>>>,
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<Canonical<'tcx, canonical::QueryResponse<'tcx, DropckOutlivesResult<'tcx>>>>,
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<traits::EvaluationResult, traits::OverflowError> {
no_force
desc { "evaluating trait selection obligation `{}`", goal.value.value }
}
query evaluate_goal(
goal: traits::ChalkCanonicalGoal<'tcx>
) -> Result<
Lrc<Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>>,
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<Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>>,
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<Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>>,
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<Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>>,
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<Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>>,
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<Canonical<'tcx, canonical::QueryResponse<'tcx, Ty<'tcx>>>>,
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<Canonical<'tcx, canonical::QueryResponse<'tcx, ty::Predicate<'tcx>>>>,
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<Canonical<'tcx, canonical::QueryResponse<'tcx, ty::PolyFnSig<'tcx>>>>,
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<Canonical<'tcx, canonical::QueryResponse<'tcx, ty::FnSig<'tcx>>>>,
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<FxHashMap<String, Option<String>>> {
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<feature_gate::Features> {
eval_always
desc { "looking up enabled feature gates" }
}
}
}

View file

@ -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<Self::Value> {
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<Self::Value> {
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<Self::Value> {
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<Self::Value> {
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<Self::Value> {
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<Self::Value> {
let typeck_tables: Option<ty::TypeckTables<'tcx>> = 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> {

View file

@ -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<ty::GenericPredicates<'tcx>>,
/// Returns the predicates written explicit by the user.
[] fn explicit_predicates_of: ExplicitPredicatesOfItem(DefId)
-> Lrc<ty::GenericPredicates<'tcx>>,
/// 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<Vec<ty::Predicate<'tcx>>>,
/// 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<ty::GenericPredicates<'tcx>>,
/// 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<ty::GenericPredicates<'tcx>>,
[] fn trait_def: TraitDefOfItem(DefId) -> &'tcx ty::TraitDef,
[] fn adt_def: AdtDefOfItem(DefId) -> &'tcx ty::AdtDef,
[] fn adt_destructor: AdtDestructor(DefId) -> Option<ty::Destructor>,
// 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<DtorckConstraint<'tcx>, 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<ty::CrateVariancesMap>,
/// Maps from def-id of a type or region parameter to its
/// (inferred) variance.
[] fn variances_of: ItemVariances(DefId) -> Lrc<Vec<ty::Variance>>,
},
TypeChecking {
/// Maps from def-id of a type to its (inferred) outlives.
[] fn inferred_outlives_crate: InferredOutlivesCrate(CrateNum)
-> Lrc<ty::CratePredicatesMap<'tcx>>,
},
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<Vec<DefId>>,
/// Maps from a trait item to the trait item "descriptor"
[] fn associated_item: AssociatedItems(DefId) -> ty::AssociatedItem,
[] fn impl_trait_ref: ImplTraitRef(DefId) -> Option<ty::TraitRef<'tcx>>,
[] fn impl_polarity: ImplPolarity(DefId) -> hir::ImplPolarity,
[] fn issue33140_self_ty: Issue33140SelfTy(DefId) -> Option<ty::Ty<'tcx>>,
},
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<Vec<DefId>>,
},
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<DefIdSet>,
},
TypeChecking {
[] fn has_typeck_tables: HasTypeckTables(DefId) -> bool,
[] fn coherent_trait: CoherenceCheckTrait(DefId) -> (),
},
BorrowChecking {
[] fn borrowck: BorrowCheck(DefId) -> Lrc<BorrowCheckResult>,
/// 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<CrateInherentImpls>,
/// 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<AccessLevels>,
[] 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<region::ScopeTree>,
[] 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<Def>,
[] fn def_span: DefSpan(DefId) -> Span,
[] fn lookup_stability: LookupStability(DefId) -> Option<&'tcx attr::Stability>,
[] fn lookup_deprecation_entry: LookupDeprecationEntry(DefId) -> Option<DeprecationEntry>,
[] 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<ast::Name>,
/// 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<DefId>,
},
TypeChecking {
[] fn trait_of_item: TraitOfItem(DefId) -> Option<DefId>,
[] fn const_is_rvalue_promotable_to_static: ConstIsRvaluePromotableToStatic(DefId) -> bool,
[] fn rvalue_promotable_map: RvaluePromotableMap(DefId) -> Lrc<ItemLocalSet>,
},
Codegen {
[] fn is_mir_available: IsMirAvailable(DefId) -> bool,
},
Other {
[] fn vtable_methods: vtable_methods_node(ty::PolyTraitRef<'tcx>)
-> Lrc<Vec<Option<(DefId, SubstsRef<'tcx>)>>>,
},
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<ty::trait_def::TraitImpls>,
[] fn specialization_graph_of: SpecializationGraph(DefId)
-> Lrc<specialization_graph::Graph>,
[] 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<Vec<(CrateNum, LinkagePreference)>>,
},
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<Option<ExternCrate>>,
},
TypeChecking {
[] fn specializes: specializes_node((DefId, DefId)) -> bool,
[] fn in_scope_traits_map: InScopeTraits(DefIndex)
-> Option<Lrc<FxHashMap<ItemLocalId, Lrc<StableVec<TraitCandidate>>>>>,
},
Other {
[] fn module_exports: ModuleExports(DefId) -> Option<Lrc<Vec<Export>>>,
},
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<DefIdMap<SymbolExportLevel>>,
[] fn is_reachable_non_generic: IsReachableNonGeneric(DefId) -> bool,
[] fn is_unreachable_local_definition: IsUnreachableLocalDefinition(DefId) -> bool,
},
Codegen {
[] fn upstream_monomorphizations: UpstreamMonomorphizations(CrateNum)
-> Lrc<DefIdMap<Lrc<FxHashMap<SubstsRef<'tcx>, CrateNum>>>>,
[] fn upstream_monomorphizations_for: UpstreamMonomorphizationsFor(DefId)
-> Option<Lrc<FxHashMap<SubstsRef<'tcx>, CrateNum>>>,
},
Other {
[] fn foreign_modules: ForeignModules(CrateNum) -> Lrc<Vec<ForeignModule>>,
/// 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<DefId>,
[] fn proc_macro_decls_static: ProcMacroDeclsStatic(CrateNum) -> Option<DefId>,
[] 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<Vec<DefId>>,
[] fn all_trait_implementations: AllTraitImplementations(CrateNum)
-> Lrc<Vec<DefId>>,
},
Other {
[] fn dllimport_foreign_items: DllimportForeignItems(CrateNum)
-> Lrc<FxHashSet<DefId>>,
[] fn is_dllimport_foreign_item: IsDllimportForeignItem(DefId) -> bool,
[] fn is_statically_included_foreign_item: IsStaticallyIncludedForeignItem(DefId) -> bool,
[] fn native_library_kind: NativeLibraryKind(DefId)
-> Option<NativeLibraryKind>,
},
Linking {
[] fn link_args: link_args_node(CrateNum) -> Lrc<Vec<String>>,
},
BorrowChecking {
// Lifetime resolution. See `middle::resolve_lifetimes`.
[] fn resolve_lifetimes: ResolveLifetimes(CrateNum) -> Lrc<ResolveLifetimes>,
[] fn named_region_map: NamedRegion(DefIndex) ->
Option<Lrc<FxHashMap<ItemLocalId, Region>>>,
[] fn is_late_bound_map: IsLateBound(DefIndex) ->
Option<Lrc<FxHashSet<ItemLocalId>>>,
[] fn object_lifetime_defaults_map: ObjectLifetimeDefaults(DefIndex)
-> Option<Lrc<FxHashMap<ItemLocalId, Lrc<Vec<ObjectLifetimeDefault>>>>>,
},
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<Vec<Export>>,
[] fn extern_mod_stmt_cnum: ExternModStmtCnum(DefId) -> Option<CrateNum>,
[] fn get_lib_features: get_lib_features_node(CrateNum) -> Lrc<LibFeatures>,
[] fn defined_lib_features: DefinedLibFeatures(CrateNum)
-> Lrc<Vec<(Symbol, Option<Symbol>)>>,
[] fn get_lang_items: get_lang_items_node(CrateNum) -> Lrc<LanguageItems>,
[] fn defined_lang_items: DefinedLangItems(CrateNum) -> Lrc<Vec<(DefId, usize)>>,
[] fn missing_lang_items: MissingLangItems(CrateNum) -> Lrc<Vec<LangItem>>,
[] fn visible_parent_map: visible_parent_map_node(CrateNum)
-> Lrc<DefIdMap<DefId>>,
[] fn missing_extern_crate_item: MissingExternCrateItem(CrateNum) -> bool,
[] fn used_crate_source: UsedCrateSource(CrateNum) -> Lrc<CrateSource>,
[] fn postorder_cnums: postorder_cnums_node(CrateNum) -> Lrc<Vec<CrateNum>>,
[] fn freevars: Freevars(DefId) -> Option<Lrc<Vec<hir::Freevar>>>,
[] fn maybe_unused_trait_import: MaybeUnusedTraitImport(DefId) -> bool,
[] fn maybe_unused_extern_crates: maybe_unused_extern_crates_node(CrateNum)
-> Lrc<Vec<(DefId, Span)>>,
[] fn names_imported_by_glob_use: NamesImportedByGlobUse(DefId)
-> Lrc<FxHashSet<ast::Name>>,
[] fn stability_index: stability_index_node(CrateNum) -> Lrc<stability::Index<'tcx>>,
[] fn all_crate_nums: all_crate_nums_node(CrateNum) -> Lrc<Vec<CrateNum>>,
/// 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<Vec<DefId>>,
},
Linking {
[] fn exported_symbols: ExportedSymbols(CrateNum)
-> Arc<Vec<(ExportedSymbol<'tcx>, SymbolExportLevel)>>,
},
Codegen {
[] fn collect_and_partition_mono_items:
collect_and_partition_mono_items_node(CrateNum)
-> (Arc<DefIdSet>, Arc<Vec<Arc<CodegenUnit<'tcx>>>>),
[] fn is_codegened_item: IsCodegenedItem(DefId) -> bool,
[] fn codegen_unit: CodegenUnit(InternedString) -> Arc<CodegenUnit<'tcx>>,
[] fn backend_optimization_level: BackendOptimizationLevel(CrateNum) -> OptLevel,
},
Other {
[] fn output_filenames: output_filenames_node(CrateNum)
-> Arc<OutputFilenames>,
},
TypeChecking {
/// Do not call this query directly: invoke `normalize` instead.
[] fn normalize_projection_ty: NormalizeProjectionTy(
CanonicalProjectionGoal<'tcx>
) -> Result<
Lrc<Canonical<'tcx, canonical::QueryResponse<'tcx, NormalizationResult<'tcx>>>>,
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<Canonical<'tcx, canonical::QueryResponse<'tcx, Vec<OutlivesBound<'tcx>>>>>,
NoSolution,
>,
/// Do not call this query directly: invoke `infcx.at().dropck_outlives()` instead.
[] fn dropck_outlives: DropckOutlives(
CanonicalTyGoal<'tcx>
) -> Result<
Lrc<Canonical<'tcx, canonical::QueryResponse<'tcx, DropckOutlivesResult<'tcx>>>>,
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<traits::EvaluationResult, traits::OverflowError>,
[] fn evaluate_goal: EvaluateGoal(
traits::ChalkCanonicalGoal<'tcx>
) -> Result<
Lrc<Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>>,
NoSolution
>,
/// Do not call this query directly: part of the `Eq` type-op
[] fn type_op_ascribe_user_type: TypeOpAscribeUserType(
CanonicalTypeOpAscribeUserTypeGoal<'tcx>
) -> Result<
Lrc<Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>>,
NoSolution,
>,
/// Do not call this query directly: part of the `Eq` type-op
[] fn type_op_eq: TypeOpEq(
CanonicalTypeOpEqGoal<'tcx>
) -> Result<
Lrc<Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>>,
NoSolution,
>,
/// Do not call this query directly: part of the `Subtype` type-op
[] fn type_op_subtype: TypeOpSubtype(
CanonicalTypeOpSubtypeGoal<'tcx>
) -> Result<
Lrc<Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>>,
NoSolution,
>,
/// Do not call this query directly: part of the `ProvePredicate` type-op
[] fn type_op_prove_predicate: TypeOpProvePredicate(
CanonicalTypeOpProvePredicateGoal<'tcx>
) -> Result<
Lrc<Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>>,
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<Canonical<'tcx, canonical::QueryResponse<'tcx, Ty<'tcx>>>>,
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<Canonical<'tcx, canonical::QueryResponse<'tcx, ty::Predicate<'tcx>>>>,
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<Canonical<'tcx, canonical::QueryResponse<'tcx, ty::PolyFnSig<'tcx>>>>,
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<Canonical<'tcx, canonical::QueryResponse<'tcx, ty::FnSig<'tcx>>>>,
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<FxHashMap<String, Option<String>>>,
// 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<feature_gate::Features>,
},
]}
//////////////////////////////////////////////////////////////////////
// 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
}
}

View file

@ -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,
);

View file

@ -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

View file

@ -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 });

View file

@ -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;
}

View file

@ -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);
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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
}
}

View file

@ -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")]

View file

@ -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;

View file

@ -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 {

View file

@ -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;

View file

@ -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) {}
}

View file

@ -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>) -> 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>) -> u32 {
if let Some(_) = x {
@ -143,7 +143,7 @@ pub fn change_then_branch_if_let(x: Option<u32>) -> 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>) -> u32 {
if let Some(x) = x {
@ -191,7 +191,7 @@ pub fn add_else_branch_if_let(x: Option<u32>) -> 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>) -> u32 {
let mut ret = 1;

View file

@ -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<u32> {
impl<T> Bar<T> {
#[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<u32> {
#[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
#[rustc_clean(cfg="cfail3")]
impl Bar<u64> {
#[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) { }
}

View file

@ -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;

View file

@ -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;

View file

@ -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 {

View file

@ -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 {

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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();
}

View file

@ -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
}

View file

@ -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';
}

View file

@ -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();

View file

@ -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' };
}

View file

@ -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' };
}

View file

@ -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' };
}

View file

@ -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' };
}

View file

@ -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' };
}

View file

@ -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' };
}

View file

@ -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';
}

View file

@ -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, <char as Foo>::T gets
// normalized away, so at a certain point we had no edge to

View file

@ -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

View file

@ -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();
}

View file

@ -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

View file

@ -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) { }
}

View file

@ -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

View file

@ -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();
}

View file

@ -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::<impl Foo for u32>` to `TypeckTables`
error: no path from `x::<impl Foo for u32>` 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

View file

@ -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();
}

View file

@ -1,14 +1,14 @@
error: no path from `x::<impl Foo for char>` to `TypeckTables`
error: no path from `x::<impl Foo for char>` 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::<impl Foo for char>` to `TypeckTables`
error: no path from `x::<impl Foo for char>` 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

View file

@ -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::<char>('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::<u32>(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();

View file

@ -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::<impl Foo for char>` to `TypeckTables`
error: no path from `x::<impl Foo for char>` 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

View file

@ -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) {
}

View file

@ -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

View file

@ -16,7 +16,7 @@ struct Foo<T> {
#[rustc_if_this_changed(Krate)]
type TypeAlias<T> = Foo<T>;
#[rustc_then_this_would_need(ItemVariances)] //~ ERROR OK
#[rustc_then_this_would_need(variances_of)] //~ ERROR OK
struct Use<T> {
x: TypeAlias<T>
}

View file

@ -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