Commit e43f99ce authored by bors's avatar bors

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

Move query definitions over to the proc macro

r? @oli-obk
parents f717b58d 45580684
......@@ -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;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -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
......
......@@ -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 });
......
......@@ -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;
}
......
......@@ -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);
}
......
......@@ -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;
}
......
......@@ -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;
}
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;