diff options
| author | bors <bors@rust-lang.org> | 2017-01-26 04:25:03 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-01-26 04:25:03 +0000 |
| commit | 2f0463a4a4f323c4deffc861349e38c6b5091782 (patch) | |
| tree | a172e30795a2a6eeb51ef62b04e620b2f56f286a | |
| parent | 6991938d3e91c200de7b6c6ef08f9600c075c89b (diff) | |
| parent | 282f7a3c44a428c26155b4686ad95e802fcd4158 (diff) | |
| download | rust-2f0463a4a4f323c4deffc861349e38c6b5091782.tar.gz rust-2f0463a4a4f323c4deffc861349e38c6b5091782.zip | |
Auto merge of #39000 - nikomatsakis:incr_comp_crosscontaminate_impl_item, r=michaelwoerister
process trait/impl items directly from the visitor callback
The current setup processes impl/trait items while visiting
the impl/trait. This means we basically have this setup:
<Lots> -> TypeckItemBody(Impl) -> Tables(ImplItem{0,1,2,3})
But this was largely an artifact of the older code. By moving the
processing of items into method dedicated for their use, we produce this
setup:
<Little> -> TypeckItemBody(ImplItem0) -> Tables(ImplItem0)
...
<Little> -> TypeckItemBody(ImplItem3) -> Tables(ImplItem3)
r? @michaelwoerister
Also, we might consider removing the `TypeckItemBody` node altogether and just using `Tables` as the task. `Tables` is its primary output, I imagine? That would reduce size of dep-graph somewhat.
cc @eddyb -- perhaps this pattern applies elsewhere?
52 files changed, 255 insertions, 259 deletions
diff --git a/src/librustc/cfg/construct.rs b/src/librustc/cfg/construct.rs index 35afdd75cb8..6f2b9ca0c42 100644 --- a/src/librustc/cfg/construct.rs +++ b/src/librustc/cfg/construct.rs @@ -18,7 +18,7 @@ use hir::{self, PatKind}; struct CFGBuilder<'a, 'tcx: 'a> { tcx: TyCtxt<'a, 'tcx, 'tcx>, - tables: &'a ty::Tables<'tcx>, + tables: &'a ty::TypeckTables<'tcx>, graph: CFGGraph, fn_exit: CFGIndex, loop_scopes: Vec<LoopScope>, diff --git a/src/librustc/dep_graph/README.md b/src/librustc/dep_graph/README.md index d2b94db689b..daed41f0470 100644 --- a/src/librustc/dep_graph/README.md +++ b/src/librustc/dep_graph/README.md @@ -326,15 +326,15 @@ The idea is that you can annotate a test like: #[rustc_if_this_changed] fn foo() { } -#[rustc_then_this_would_need(TypeckItemBody)] //~ ERROR OK +#[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK fn bar() { foo(); } -#[rustc_then_this_would_need(TypeckItemBody)] //~ ERROR no path +#[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path fn baz() { } ``` This will check whether there is a path in the dependency graph from -`Hir(foo)` to `TypeckItemBody(bar)`. An error is reported for each +`Hir(foo)` to `TypeckTables(bar)`. An error is reported for each `#[rustc_then_this_would_need]` annotation that indicates whether a path exists. `//~ ERROR` annotations can then be used to test if a path is found (as demonstrated above). @@ -371,27 +371,27 @@ A node is considered to match a filter if all of those strings appear in its label. So, for example: ``` -RUST_DEP_GRAPH_FILTER='-> TypeckItemBody' +RUST_DEP_GRAPH_FILTER='-> TypeckTables' ``` -would select the predecessors of all `TypeckItemBody` nodes. Usually though you -want the `TypeckItemBody` node for some particular fn, so you might write: +would select the predecessors of all `TypeckTables` nodes. Usually though you +want the `TypeckTables` node for some particular fn, so you might write: ``` -RUST_DEP_GRAPH_FILTER='-> TypeckItemBody & bar' +RUST_DEP_GRAPH_FILTER='-> TypeckTables & bar' ``` -This will select only the `TypeckItemBody` nodes for fns with `bar` in their name. +This will select only the `TypeckTables` nodes for fns with `bar` in their name. Perhaps you are finding that when you change `foo` you need to re-type-check `bar`, but you don't think you should have to. In that case, you might do: ``` -RUST_DEP_GRAPH_FILTER='Hir&foo -> TypeckItemBody & bar' +RUST_DEP_GRAPH_FILTER='Hir&foo -> TypeckTables & bar' ``` This will dump out all the nodes that lead from `Hir(foo)` to -`TypeckItemBody(bar)`, from which you can (hopefully) see the source +`TypeckTables(bar)`, from which you can (hopefully) see the source of the erroneous edge. #### Tracking down incorrect edges @@ -417,27 +417,8 @@ dep-graph as described in the previous section and open `dep-graph.txt` to see something like: Hir(foo) -> Collect(bar) - Collect(bar) -> TypeckItemBody(bar) - + Collect(bar) -> TypeckTables(bar) + That first edge looks suspicious to you. So you set `RUST_FORBID_DEP_GRAPH_EDGE` to `Hir&foo -> Collect&bar`, re-run, and then observe the backtrace. Voila, bug fixed! - -### Inlining of HIR nodes - -For the time being, at least, we still sometimes "inline" HIR nodes -from other crates into the current HIR map. This creates a weird -scenario where the same logical item (let's call it `X`) has two -def-ids: the original def-id `X` and a new, inlined one `X'`. `X'` is -in the current crate, but it's not like other HIR nodes: in -particular, when we restart compilation, it will not be available to -hash. Therefore, we do not want `Hir(X')` nodes appearing in our -graph. Instead, we want a "read" of `Hir(X')` to be represented as a -read of `MetaData(X)`, since the metadata for `X` is where the inlined -representation originated in the first place. - -To achieve this, the HIR map will detect if the def-id originates in -an inlined node and add a dependency to a suitable `MetaData` node -instead. If you are reading a HIR node and are not sure if it may be -inlined or not, you can use `tcx.map.read(node_id)` and it will detect -whether the node is inlined or not and do the right thing. diff --git a/src/librustc/dep_graph/dep_node.rs b/src/librustc/dep_graph/dep_node.rs index a68876b5ae9..d9fd0b9a1f9 100644 --- a/src/librustc/dep_graph/dep_node.rs +++ b/src/librustc/dep_graph/dep_node.rs @@ -78,7 +78,6 @@ pub enum DepNode<D: Clone + Debug> { Variance, WfCheck(D), TypeckItemType(D), - TypeckItemBody(D), Dropck, DropckImpl(D), UnusedTraitCheck, @@ -113,7 +112,7 @@ pub enum DepNode<D: Clone + Debug> { SizedConstraint(D), AssociatedItemDefIds(D), InherentImpls(D), - Tables(D), + TypeckTables(D), // The set of impls for a given trait. Ultimately, it would be // nice to get more fine-grained here (e.g., to include a @@ -158,12 +157,11 @@ impl<D: Clone + Debug> DepNode<D> { HirBody, TransCrateItem, TypeckItemType, - TypeckItemBody, AssociatedItems, ItemSignature, AssociatedItemDefIds, InherentImpls, - Tables, + TypeckTables, TraitImpls, ReprHints, } @@ -216,7 +214,6 @@ impl<D: Clone + Debug> DepNode<D> { CoherenceOrphanCheck(ref d) => op(d).map(CoherenceOrphanCheck), WfCheck(ref d) => op(d).map(WfCheck), TypeckItemType(ref d) => op(d).map(TypeckItemType), - TypeckItemBody(ref d) => op(d).map(TypeckItemBody), DropckImpl(ref d) => op(d).map(DropckImpl), CheckConst(ref d) => op(d).map(CheckConst), IntrinsicCheck(ref d) => op(d).map(IntrinsicCheck), @@ -232,7 +229,7 @@ impl<D: Clone + Debug> DepNode<D> { SizedConstraint(ref d) => op(d).map(SizedConstraint), AssociatedItemDefIds(ref d) => op(d).map(AssociatedItemDefIds), InherentImpls(ref d) => op(d).map(InherentImpls), - Tables(ref d) => op(d).map(Tables), + TypeckTables(ref d) => op(d).map(TypeckTables), TraitImpls(ref d) => op(d).map(TraitImpls), TraitItems(ref d) => op(d).map(TraitItems), ReprHints(ref d) => op(d).map(ReprHints), diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs index b44e1563ee7..4e64dda1a30 100644 --- a/src/librustc/infer/mod.rs +++ b/src/librustc/infer/mod.rs @@ -76,23 +76,23 @@ pub type Bound<T> = Option<T>; pub type UnitResult<'tcx> = RelateResult<'tcx, ()>; // "unify result" pub type FixupResult<T> = Result<T, FixupError>; // "fixup result" -/// A version of &ty::Tables which can be `Missing` (not needed), +/// A version of &ty::TypeckTables which can be `Missing` (not needed), /// `InProgress` (during typeck) or `Interned` (result of typeck). /// Only the `InProgress` version supports `borrow_mut`. #[derive(Copy, Clone)] pub enum InferTables<'a, 'gcx: 'a+'tcx, 'tcx: 'a> { - Interned(&'a ty::Tables<'gcx>), - InProgress(&'a RefCell<ty::Tables<'tcx>>), + Interned(&'a ty::TypeckTables<'gcx>), + InProgress(&'a RefCell<ty::TypeckTables<'tcx>>), Missing } pub enum InferTablesRef<'a, 'gcx: 'a+'tcx, 'tcx: 'a> { - Interned(&'a ty::Tables<'gcx>), - InProgress(Ref<'a, ty::Tables<'tcx>>) + Interned(&'a ty::TypeckTables<'gcx>), + InProgress(Ref<'a, ty::TypeckTables<'tcx>>) } impl<'a, 'gcx, 'tcx> Deref for InferTablesRef<'a, 'gcx, 'tcx> { - type Target = ty::Tables<'tcx>; + type Target = ty::TypeckTables<'tcx>; fn deref(&self) -> &Self::Target { match *self { InferTablesRef::Interned(tables) => tables, @@ -112,7 +112,7 @@ impl<'a, 'gcx, 'tcx> InferTables<'a, 'gcx, 'tcx> { } } - pub fn expect_interned(self) -> &'a ty::Tables<'gcx> { + pub fn expect_interned(self) -> &'a ty::TypeckTables<'gcx> { match self { InferTables::Interned(tables) => tables, InferTables::InProgress(_) => { @@ -124,7 +124,7 @@ impl<'a, 'gcx, 'tcx> InferTables<'a, 'gcx, 'tcx> { } } - pub fn borrow_mut(self) -> RefMut<'a, ty::Tables<'tcx>> { + pub fn borrow_mut(self) -> RefMut<'a, ty::TypeckTables<'tcx>> { match self { InferTables::Interned(_) => { bug!("InferTables: infcx.tables.borrow_mut() outside of type-checking"); @@ -407,15 +407,15 @@ impl fmt::Display for FixupError { pub trait InferEnv<'a, 'tcx> { fn to_parts(self, tcx: TyCtxt<'a, 'tcx, 'tcx>) - -> (Option<&'a ty::Tables<'tcx>>, - Option<ty::Tables<'tcx>>, + -> (Option<&'a ty::TypeckTables<'tcx>>, + Option<ty::TypeckTables<'tcx>>, Option<ty::ParameterEnvironment<'tcx>>); } impl<'a, 'tcx> InferEnv<'a, 'tcx> for () { fn to_parts(self, _: TyCtxt<'a, 'tcx, 'tcx>) - -> (Option<&'a ty::Tables<'tcx>>, - Option<ty::Tables<'tcx>>, + -> (Option<&'a ty::TypeckTables<'tcx>>, + Option<ty::TypeckTables<'tcx>>, Option<ty::ParameterEnvironment<'tcx>>) { (None, None, None) } @@ -423,26 +423,26 @@ impl<'a, 'tcx> InferEnv<'a, 'tcx> for () { impl<'a, 'tcx> InferEnv<'a, 'tcx> for ty::ParameterEnvironment<'tcx> { fn to_parts(self, _: TyCtxt<'a, 'tcx, 'tcx>) - -> (Option<&'a ty::Tables<'tcx>>, - Option<ty::Tables<'tcx>>, + -> (Option<&'a ty::TypeckTables<'tcx>>, + Option<ty::TypeckTables<'tcx>>, Option<ty::ParameterEnvironment<'tcx>>) { (None, None, Some(self)) } } -impl<'a, 'tcx> InferEnv<'a, 'tcx> for (&'a ty::Tables<'tcx>, ty::ParameterEnvironment<'tcx>) { +impl<'a, 'tcx> InferEnv<'a, 'tcx> for (&'a ty::TypeckTables<'tcx>, ty::ParameterEnvironment<'tcx>) { fn to_parts(self, _: TyCtxt<'a, 'tcx, 'tcx>) - -> (Option<&'a ty::Tables<'tcx>>, - Option<ty::Tables<'tcx>>, + -> (Option<&'a ty::TypeckTables<'tcx>>, + Option<ty::TypeckTables<'tcx>>, Option<ty::ParameterEnvironment<'tcx>>) { (Some(self.0), None, Some(self.1)) } } -impl<'a, 'tcx> InferEnv<'a, 'tcx> for (ty::Tables<'tcx>, ty::ParameterEnvironment<'tcx>) { +impl<'a, 'tcx> InferEnv<'a, 'tcx> for (ty::TypeckTables<'tcx>, ty::ParameterEnvironment<'tcx>) { fn to_parts(self, _: TyCtxt<'a, 'tcx, 'tcx>) - -> (Option<&'a ty::Tables<'tcx>>, - Option<ty::Tables<'tcx>>, + -> (Option<&'a ty::TypeckTables<'tcx>>, + Option<ty::TypeckTables<'tcx>>, Option<ty::ParameterEnvironment<'tcx>>) { (None, Some(self.0), Some(self.1)) } @@ -450,8 +450,8 @@ impl<'a, 'tcx> InferEnv<'a, 'tcx> for (ty::Tables<'tcx>, ty::ParameterEnvironmen impl<'a, 'tcx> InferEnv<'a, 'tcx> for hir::BodyId { fn to_parts(self, tcx: TyCtxt<'a, 'tcx, 'tcx>) - -> (Option<&'a ty::Tables<'tcx>>, - Option<ty::Tables<'tcx>>, + -> (Option<&'a ty::TypeckTables<'tcx>>, + Option<ty::TypeckTables<'tcx>>, Option<ty::ParameterEnvironment<'tcx>>) { let item_id = tcx.map.body_owner(self); (Some(tcx.item_tables(tcx.map.local_def_id(item_id))), @@ -466,8 +466,8 @@ impl<'a, 'tcx> InferEnv<'a, 'tcx> for hir::BodyId { pub struct InferCtxtBuilder<'a, 'gcx: 'a+'tcx, 'tcx: 'a> { global_tcx: TyCtxt<'a, 'gcx, 'gcx>, arena: DroplessArena, - fresh_tables: Option<RefCell<ty::Tables<'tcx>>>, - tables: Option<&'a ty::Tables<'gcx>>, + fresh_tables: Option<RefCell<ty::TypeckTables<'tcx>>>, + tables: Option<&'a ty::TypeckTables<'gcx>>, param_env: Option<ty::ParameterEnvironment<'gcx>>, projection_mode: Reveal, } diff --git a/src/librustc/lint/context.rs b/src/librustc/lint/context.rs index 4b731ed7a70..5ac000923e0 100644 --- a/src/librustc/lint/context.rs +++ b/src/librustc/lint/context.rs @@ -337,7 +337,7 @@ pub struct LateContext<'a, 'tcx: 'a> { pub tcx: TyCtxt<'a, 'tcx, 'tcx>, /// Side-tables for the body we are in. - pub tables: &'a ty::Tables<'tcx>, + pub tables: &'a ty::TypeckTables<'tcx>, /// The crate being checked. pub krate: &'a hir::Crate, @@ -1212,7 +1212,7 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let lint_store = mem::replace(&mut *tcx.sess.lint_store.borrow_mut(), LintStore::new()); let mut cx = LateContext { tcx: tcx, - tables: &ty::Tables::empty(), + tables: &ty::TypeckTables::empty(), krate: krate, access_levels: access_levels, lints: lint_store, diff --git a/src/librustc/middle/dead.rs b/src/librustc/middle/dead.rs index 5af62d0172f..38fbe650a89 100644 --- a/src/librustc/middle/dead.rs +++ b/src/librustc/middle/dead.rs @@ -49,7 +49,7 @@ fn should_explore<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, struct MarkSymbolVisitor<'a, 'tcx: 'a> { worklist: Vec<ast::NodeId>, tcx: TyCtxt<'a, 'tcx, 'tcx>, - tables: &'a ty::Tables<'tcx>, + tables: &'a ty::TypeckTables<'tcx>, live_symbols: Box<FxHashSet<ast::NodeId>>, struct_has_extern_repr: bool, ignore_non_const_paths: bool, @@ -392,7 +392,7 @@ fn find_live<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let mut symbol_visitor = MarkSymbolVisitor { worklist: worklist, tcx: tcx, - tables: &ty::Tables::empty(), + tables: &ty::TypeckTables::empty(), live_symbols: box FxHashSet(), struct_has_extern_repr: false, ignore_non_const_paths: false, diff --git a/src/librustc/middle/effect.rs b/src/librustc/middle/effect.rs index c42e8fcb08c..f90d9143e9d 100644 --- a/src/librustc/middle/effect.rs +++ b/src/librustc/middle/effect.rs @@ -52,7 +52,7 @@ fn type_is_unsafe_function(ty: Ty) -> bool { struct EffectCheckVisitor<'a, 'tcx: 'a> { tcx: TyCtxt<'a, 'tcx, 'tcx>, - tables: &'a ty::Tables<'tcx>, + tables: &'a ty::TypeckTables<'tcx>, /// Whether we're in an unsafe context. unsafe_context: UnsafeContext, @@ -245,7 +245,7 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { let mut visitor = EffectCheckVisitor { tcx: tcx, - tables: &ty::Tables::empty(), + tables: &ty::TypeckTables::empty(), unsafe_context: UnsafeContext::new(SafeContext), }; diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index 5307b4ec774..e0521f98416 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -512,7 +512,7 @@ const ACC_USE: u32 = 4; struct Liveness<'a, 'tcx: 'a> { ir: &'a mut IrMaps<'a, 'tcx>, - tables: &'a ty::Tables<'tcx>, + tables: &'a ty::TypeckTables<'tcx>, s: Specials, successors: Vec<LiveNode>, users: Vec<Users>, diff --git a/src/librustc/middle/reachable.rs b/src/librustc/middle/reachable.rs index 6eaf3448d02..385dd3d9bf7 100644 --- a/src/librustc/middle/reachable.rs +++ b/src/librustc/middle/reachable.rs @@ -79,7 +79,7 @@ fn method_might_be_inlined<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, struct ReachableContext<'a, 'tcx: 'a> { // The type context. tcx: TyCtxt<'a, 'tcx, 'tcx>, - tables: &'a ty::Tables<'tcx>, + tables: &'a ty::TypeckTables<'tcx>, // The set of items which must be exported in the linkage sense. reachable_symbols: NodeSet, // A worklist of item IDs. Each item ID in this worklist will be inlined @@ -370,7 +370,7 @@ pub fn find_reachable<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, }); let mut reachable_context = ReachableContext { tcx: tcx, - tables: &ty::Tables::empty(), + tables: &ty::TypeckTables::empty(), reachable_symbols: NodeSet(), worklist: Vec::new(), any_library: any_library, diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index 3df64ebd158..c32e40c6cef 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -65,7 +65,7 @@ pub struct GlobalArenas<'tcx> { trait_def: TypedArena<ty::TraitDef>, adt_def: TypedArena<ty::AdtDef>, mir: TypedArena<RefCell<Mir<'tcx>>>, - tables: TypedArena<ty::Tables<'tcx>>, + tables: TypedArena<ty::TypeckTables<'tcx>>, } impl<'tcx> GlobalArenas<'tcx> { @@ -192,7 +192,7 @@ pub struct CommonTypes<'tcx> { } #[derive(RustcEncodable, RustcDecodable)] -pub struct Tables<'tcx> { +pub struct TypeckTables<'tcx> { /// Resolved definitions for `<T>::X` associated paths. pub type_relative_path_defs: NodeMap<Def>, @@ -234,9 +234,9 @@ pub struct Tables<'tcx> { pub fru_field_types: NodeMap<Vec<Ty<'tcx>>> } -impl<'tcx> Tables<'tcx> { - pub fn empty() -> Tables<'tcx> { - Tables { +impl<'tcx> TypeckTables<'tcx> { + pub fn empty() -> TypeckTables<'tcx> { + TypeckTables { type_relative_path_defs: NodeMap(), node_types: FxHashMap(), item_substs: NodeMap(), @@ -402,7 +402,7 @@ pub struct GlobalCtxt<'tcx> { free_region_maps: RefCell<NodeMap<FreeRegionMap>>, // FIXME: jroesch make this a refcell - pub tables: RefCell<DepTrackingMap<maps::Tables<'tcx>>>, + pub tables: RefCell<DepTrackingMap<maps::TypeckTables<'tcx>>>, /// Maps from a trait item to the trait item "descriptor" pub associated_items: RefCell<DepTrackingMap<maps::AssociatedItems<'tcx>>>, @@ -654,7 +654,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { self.global_arenas.mir.alloc(RefCell::new(mir)) } - pub fn alloc_tables(self, tables: ty::Tables<'gcx>) -> &'gcx ty::Tables<'gcx> { + pub fn alloc_tables(self, tables: ty::TypeckTables<'gcx>) -> &'gcx ty::TypeckTables<'gcx> { self.global_arenas.tables.alloc(tables) } diff --git a/src/librustc/ty/maps.rs b/src/librustc/ty/maps.rs index 59d22d270b1..c0cf1d72427 100644 --- a/src/librustc/ty/maps.rs +++ b/src/librustc/ty/maps.rs @@ -48,4 +48,4 @@ dep_map_ty! { ReprHints: ReprHints(DefId) -> Rc<Vec<attr::ReprAttr>> } dep_map_ty! { Mir: Mir(DefId) -> &'tcx RefCell<mir::Mir<'tcx>> } dep_map_ty! { ClosureKinds: ItemSignature(DefId) -> ty::ClosureKind } dep_map_ty! { ClosureTypes: ItemSignature(DefId) -> ty::ClosureTy<'tcx> } -dep_map_ty! { Tables: Tables(DefId) -> &'tcx ty::Tables<'tcx> } +dep_map_ty! { TypeckTables: TypeckTables(DefId) -> &'tcx ty::TypeckTables<'tcx> } diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index a88b1e3ece9..697ab6ee491 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -69,7 +69,7 @@ pub use self::sty::TypeVariants::*; pub use self::contents::TypeContents; pub use self::context::{TyCtxt, GlobalArenas, tls}; -pub use self::context::{Lift, Tables}; +pub use self::context::{Lift, TypeckTables}; pub use self::trait_def::{TraitDef, TraitFlags}; @@ -1917,11 +1917,11 @@ impl BorrowKind { } impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { - pub fn body_tables(self, body: hir::BodyId) -> &'gcx Tables<'gcx> { + pub fn body_tables(self, body: hir::BodyId) -> &'gcx TypeckTables<'gcx> { self.item_tables(self.map.body_owner_def_id(body)) } - pub fn item_tables(self, def_id: DefId) -> &'gcx Tables<'gcx> { + pub fn item_tables(self, def_id: DefId) -> &'gcx TypeckTables<'gcx> { self.tables.memoize(def_id, || { if def_id.is_local() { // Closures' tables come from their outermost function, diff --git a/src/librustc_const_eval/check_match.rs b/src/librustc_const_eval/check_match.rs index 52f332a30c0..a6452a3f031 100644 --- a/src/librustc_const_eval/check_match.rs +++ b/src/librustc_const_eval/check_match.rs @@ -69,7 +69,7 @@ fn create_e0004<'a>(sess: &'a Session, sp: Span, error_message: String) -> Diagn struct MatchVisitor<'a, 'tcx: 'a> { tcx: TyCtxt<'a, 'tcx, 'tcx>, - tables: &'a ty::Tables<'tcx>, + tables: &'a ty::TypeckTables<'tcx>, param_env: &'a ty::ParameterEnvironment<'tcx> } diff --git a/src/librustc_const_eval/eval.rs b/src/librustc_const_eval/eval.rs index c899d2109f5..2325c37bc40 100644 --- a/src/librustc_const_eval/eval.rs +++ b/src/librustc_const_eval/eval.rs @@ -52,7 +52,7 @@ macro_rules! math { fn lookup_variant_by_id<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, variant_def: DefId) - -> Option<(&'tcx Expr, Option<&'a ty::Tables<'tcx>>)> { + -> Option<(&'tcx Expr, Option<&'a ty::TypeckTables<'tcx>>)> { if let Some(variant_node_id) = tcx.map.as_local_node_id(variant_def) { let enum_node_id = tcx.map.get_parent(variant_node_id); if let Some(ast_map::NodeItem(it)) = tcx.map.find(enum_node_id) { @@ -81,7 +81,7 @@ pub fn lookup_const_by_id<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId, substs: Option<&'tcx Substs<'tcx>>) -> Option<(&'tcx Expr, - Option<&'a ty::Tables<'tcx>>, + Option<&'a ty::TypeckTables<'tcx>>, Option<ty::Ty<'tcx>>)> { if let Some(node_id) = tcx.map.as_local_node_id(def_id) { match tcx.map.find(node_id) { @@ -154,7 +154,7 @@ pub fn lookup_const_by_id<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, } fn lookup_const_fn_by_id<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) - -> Option<(&'tcx hir::Body, Option<&'a ty::Tables<'tcx>>)> + -> Option<(&'tcx hir::Body, Option<&'a ty::TypeckTables<'tcx>>)> { if let Some(node_id) = tcx.map.as_local_node_id(def_id) { FnLikeNode::from_node(tcx.map.get(node_id)).and_then(|fn_like| { @@ -226,7 +226,7 @@ pub fn note_const_eval_err<'a, 'tcx>( pub struct ConstContext<'a, 'tcx: 'a> { tcx: TyCtxt<'a, 'tcx, 'tcx>, - tables: Option<&'a ty::Tables<'tcx>>, + tables: Option<&'a ty::TypeckTables<'tcx>>, fn_args: Option<DefIdMap<ConstVal>> } @@ -240,7 +240,7 @@ impl<'a, 'tcx> ConstContext<'a, 'tcx> { } } - pub fn with_tables(tcx: TyCtxt<'a, 'tcx, 'tcx>, tables: &'a ty::Tables<'tcx>) -> Self { + pub fn with_tables(tcx: TyCtxt<'a, 'tcx, 'tcx>, tables: &'a ty::TypeckTables<'tcx>) -> Self { ConstContext { tcx: tcx, tables: Some(tables), @@ -920,10 +920,10 @@ fn infer<'a, 'tcx>(i: ConstInt, fn resolve_trait_associated_const<'a, 'tcx: 'a>( tcx: TyCtxt<'a, 'tcx, 'tcx>, trait_item_id: DefId, - default_value: Option<(&'tcx Expr, Option<&'a ty::Tables<'tcx>>, Option<ty::Ty<'tcx>>)>, + default_value: Option<(&'tcx Expr, Option<&'a ty::TypeckTables<'tcx>>, Option<ty::Ty<'tcx>>)>, trait_id: DefId, rcvr_substs: &'tcx Substs<'tcx> -) -> Option<(&'tcx Expr, Option<&'a ty::Tables<'tcx>>, Option<ty::Ty<'tcx>>)> +) -> Option<(&'tcx Expr, Option<&'a ty::TypeckTables<'tcx>>, Option<ty::Ty<'tcx>>)> { let trait_ref = ty::Binder(ty::TraitRef::new(trait_id, rcvr_substs)); debug!("resolve_trait_associated_const: trait_ref={:?}", diff --git a/src/librustc_const_eval/pattern.rs b/src/librustc_const_eval/pattern.rs index 3235e06b806..24c795befa3 100644 --- a/src/librustc_const_eval/pattern.rs +++ b/src/librustc_const_eval/pattern.rs @@ -264,13 +264,13 @@ impl<'tcx> fmt::Display for Pattern<'tcx> { pub struct PatternContext<'a, 'gcx: 'tcx, 'tcx: 'a> { pub tcx: TyCtxt<'a, 'gcx, 'tcx>, - pub tables: &'a ty::Tables<'gcx>, + pub tables: &'a ty::TypeckTables<'gcx>, pub errors: Vec<PatternError>, } impl<'a, 'gcx, 'tcx> Pattern<'tcx> { pub fn from_hir(tcx: TyCtxt<'a, 'gcx, 'tcx>, - tables: &'a ty::Tables<'gcx>, + tables: &'a ty::TypeckTables<'gcx>, pat: &hir::Pat) -> Self { let mut pcx = PatternContext::new(tcx, tables); let result = pcx.lower_pattern(pat); @@ -283,7 +283,7 @@ impl<'a, 'gcx, 'tcx> Pattern<'tcx> { } impl<'a, 'gcx, 'tcx> PatternContext<'a, 'gcx, 'tcx> { - pub fn new(tcx: TyCtxt<'a, 'gcx, 'tcx>, tables: &'a ty::Tables<'gcx>) -> Self { + pub fn new(tcx: TyCtxt<'a, 'gcx, 'tcx>, tables: &'a ty::TypeckTables<'gcx>) -> Self { PatternContext { tcx: tcx, tables: tables, errors: vec![] } } diff --git a/src/librustc_driver/pretty.rs b/src/librustc_driver/pretty.rs index 3c8a529bdae..c5e0e8fb45f 100644 --- a/src/librustc_driver/pretty.rs +++ b/src/librustc_driver/pretty.rs @@ -237,7 +237,7 @@ impl PpSourceMode { arenas, id, |tcx, _, _, _| { - let empty_tables = ty::Tables::empty(); + let empty_tables = ty::TypeckTables::empty(); let annotation = TypedAnnotation { tcx: tcx, tables: Cell::new(&empty_tables) @@ -493,7 +493,7 @@ impl<'ast> pprust::PpAnn for HygieneAnnotation<'ast> { struct TypedAnnotation<'a, 'tcx: 'a> { tcx: TyCtxt<'a, 'tcx, 'tcx>, - tables: Cell<&'a ty::Tables<'tcx>>, + tables: Cell<&'a ty::TypeckTables<'tcx>>, } impl<'b, 'tcx> HirPrinterSupport<'tcx> for TypedAnnotation<'b, 'tcx> { diff --git a/src/librustc_incremental/persist/dirty_clean.rs b/src/librustc_incremental/persist/dirty_clean.rs index 481462dff86..4cefc16efe5 100644 --- a/src/librustc_incremental/persist/dirty_clean.rs +++ b/src/librustc_incremental/persist/dirty_clean.rs @@ -14,11 +14,11 @@ //! we will check that a suitable node for that item either appears //! or does not appear in the dep-graph, as appropriate: //! -//! - `#[rustc_dirty(label="TypeckItemBody", cfg="rev2")]` if we are +//! - `#[rustc_dirty(label="TypeckTables", cfg="rev2")]` if we are //! in `#[cfg(rev2)]`, then there MUST NOT be a node -//! `DepNode::TypeckItemBody(X)` where `X` is the def-id of the +//! `DepNode::TypeckTables(X)` where `X` is the def-id of the //! current node. -//! - `#[rustc_clean(label="TypeckItemBody", cfg="rev2")]` same as above, +//! - `#[rustc_clean(label="TypeckTables", cfg="rev2")]` same as above, //! except that the node MUST exist. //! //! Errors are reported if we are in the suitable configuration but diff --git a/src/librustc_incremental/persist/preds.rs b/src/librustc_incremental/persist/preds.rs index b2a4a2772ec..c75a325941f 100644 --- a/src/librustc_incremental/persist/preds.rs +++ b/src/librustc_incremental/persist/preds.rs @@ -56,7 +56,7 @@ impl<'q> Predecessors<'q> { // if -Z query-dep-graph is passed, save more extended data // to enable better unit testing - DepNode::TypeckItemBody(_) | + DepNode::TypeckTables(_) | DepNode::TransCrateItem(_) => tcx.sess.opts.debugging_opts.query_dep_graph, _ => false, diff --git a/src/librustc_metadata/astencode.rs b/src/librustc_metadata/astencode.rs index 3c14d38cc38..ef7bb80312e 100644 --- a/src/librustc_metadata/astencode.rs +++ b/src/librustc_metadata/astencode.rs @@ -21,7 +21,7 @@ use rustc_serialize::Encodable; #[derive(RustcEncodable, RustcDecodable)] pub struct Ast<'tcx> { pub body: Lazy<hir::Body>, - pub tables: Lazy<ty::Tables<'tcx>>, + pub tables: Lazy<ty::TypeckTables<'tcx>>, pub nested_bodies: LazySeq<hir::Body>, pub rvalue_promotable_to_static: bool, } diff --git a/src/librustc_mir/hair/cx/mod.rs b/src/librustc_mir/hair/cx/mod.rs index 4b553a71b83..533d804a236 100644 --- a/src/librustc_mir/hair/cx/mod.rs +++ b/src/librustc_mir/hair/cx/mod.rs @@ -170,7 +170,7 @@ impl<'a, 'gcx, 'tcx> Cx<'a, 'gcx, 'tcx> { self.tcx } - pub fn tables(&self) -> &'a ty::Tables<'gcx> { + pub fn tables(&self) -> &'a ty::TypeckTables<'gcx> { self.infcx.tables.expect_interned() } diff --git a/src/librustc_passes/consts.rs b/src/librustc_passes/consts.rs index 4bdc113e516..fa148da2e39 100644 --- a/src/librustc_passes/consts.rs +++ b/src/librustc_passes/consts.rs @@ -60,7 +60,7 @@ struct CheckCrateVisitor<'a, 'tcx: 'a> { promotable: bool, mut_rvalue_borrows: NodeSet, param_env: ty::ParameterEnvironment<'tcx>, - tables: &'a ty::Tables<'tcx>, + tables: &'a ty::TypeckTables<'tcx>, } impl<'a, 'gcx> CheckCrateVisitor<'a, 'gcx> { @@ -462,7 +462,7 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { tcx.visit_all_item_likes_in_krate(DepNode::CheckConst, &mut CheckCrateVisitor { tcx: tcx, - tables: &ty::Tables::empty(), + tables: &ty::TypeckTables::empty(), in_fn: false, promotable: false, mut_rvalue_borrows: NodeSet(), diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index ff4c92bb40e..445da5a8c3f 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -392,7 +392,7 @@ struct PrivacyVisitor<'a, 'tcx: 'a> { tcx: TyCtxt<'a, 'tcx, 'tcx>, curitem: DefId, in_foreign: bool, - tables: &'a ty::Tables<'tcx>, + tables: &'a ty::TypeckTables<'tcx>, } impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> { @@ -1212,7 +1212,7 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, curitem: DefId::local(CRATE_DEF_INDEX), in_foreign: false, tcx: tcx, - tables: &ty::Tables::empty(), + tables: &ty::TypeckTables::empty(), }; intravisit::walk_crate(&mut visitor, krate); diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index 0fbe29880b9..ded59cfccf1 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -84,7 +84,7 @@ pub mod recorder { pub struct SaveContext<'l, 'tcx: 'l> { tcx: TyCtxt<'l, 'tcx, 'tcx>, - tables: &'l ty::Tables<'tcx>, + tables: &'l ty::TypeckTables<'tcx>, analysis: &'l ty::CrateAnalysis<'tcx>, span_utils: SpanUtils<'tcx>, } @@ -899,7 +899,7 @@ pub fn process_crate<'l, 'tcx>(tcx: TyCtxt<'l, 'tcx, 'tcx>, let save_ctxt = SaveContext { tcx: tcx, - tables: &ty::Tables::empty(), + tables: &ty::TypeckTables::empty(), analysis: analysis, span_utils: SpanUtils::new(&tcx.sess), }; diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index e240c70aaa3..7a9df90c1a6 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -483,7 +483,7 @@ pub struct InheritedBuilder<'a, 'gcx: 'a+'tcx, 'tcx: 'a> { impl<'a, 'gcx, 'tcx> CrateCtxt<'a, 'gcx> { pub fn inherited(&'a self, id: ast::NodeId) -> InheritedBuilder<'a, 'gcx, 'tcx> { - let tables = ty::Tables::empty(); + let tables = ty::TypeckTables::empty(); let param_env = ParameterEnvironment::for_item(self.tcx, id); InheritedBuilder { ccx: self, @@ -570,16 +570,43 @@ impl<'a, 'tcx> Visitor<'tcx> for CheckItemTypesVisitor<'a, 'tcx> { } impl<'a, 'tcx> ItemLikeVisitor<'tcx> for CheckItemBodiesVisitor<'a, 'tcx> { - fn visit_item(&mut self, i: &'tcx hir::Item) { - check_item_body(self.ccx, i); + fn visit_item(&mut self, item: &'tcx hir::Item) { + match item.node { + hir::ItemFn(ref decl, .., body_id) => { + check_bare_fn(self.ccx, &decl, body_id, item.id, item.span); + } + _ => { } + } } - fn visit_trait_item(&mut self, _item: &'tcx hir::TraitItem) { - // done as part of `visit_item` above + fn visit_trait_item(&mut self, trait_item: &'tcx hir::TraitItem) { + match trait_item.node { + hir::TraitItemKind::Const(_, Some(expr)) => { + check_const(self.ccx, expr, trait_item.id) + } + hir::TraitItemKind::Method(ref sig, hir::TraitMethod::Provided(body_id)) => { + check_bare_fn(self.ccx, &sig.decl, body_id, trait_item.id, trait_item.span); + } + hir::TraitItemKind::Method(_, hir::TraitMethod::Required(_)) | + hir::TraitItemKind::Const(_, None) | + hir::TraitItemKind::Type(..) => { + // Nothing to do. + } + } } - fn visit_impl_item(&mut self, _item: &'tcx hir::ImplItem) { - // done as part of `visit_item` above + fn visit_impl_item(&mut self, impl_item: &'tcx hir::ImplItem) { + match impl_item.node { + hir::ImplItemKind::Const(_, expr) => { + check_const(self.ccx, expr, impl_item.id) + } + hir::ImplItemKind::Method(ref sig, body_id) => { + check_bare_fn(self.ccx, &sig.decl, body_id, impl_item.id, impl_item.span); + } + hir::ImplItemKind::Type(_) => { + // Nothing to do here. + } + } } } @@ -601,14 +628,14 @@ pub fn check_item_types(ccx: &CrateCtxt) -> CompileResult { pub fn check_item_bodies(ccx: &CrateCtxt) -> CompileResult { ccx.tcx.sess.track_errors(|| { let mut visit = CheckItemBodiesVisitor { ccx: ccx }; - ccx.tcx.visit_all_item_likes_in_krate(DepNode::TypeckItemBody, &mut visit); + ccx.tcx.visit_all_item_likes_in_krate(DepNode::TypeckTables, &mut visit); // Process deferred obligations, now that all functions // bodies have been fully inferred. for (&item_id, obligations) in ccx.deferred_obligations.borrow().iter() { // Use the same DepNode as for the body of the original function/item. let def_id = ccx.tcx.map.local_def_id(item_id); - let _task = ccx.tcx.dep_graph.in_task(DepNode::TypeckItemBody(def_id)); + let _task = ccx.tcx.dep_graph.in_task(DepNode::TypeckTables(def_id)); let param_env = ParameterEnvironment::for_item(ccx.tcx, item_id); ccx.tcx.infer_ctxt(param_env, Reveal::NotSpecializable).enter(|infcx| { @@ -897,55 +924,6 @@ pub fn check_item_type<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, it: &'tcx hir::Item) { } } -pub fn check_item_body<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, it: &'tcx hir::Item) { - debug!("check_item_body(it.id={}, it.name={})", - it.id, - ccx.tcx.item_path_str(ccx.tcx.map.local_def_id(it.id))); - let _indenter = indenter(); - match it.node { - hir::ItemFn(ref decl, .., body_id) => { - check_bare_fn(ccx, &decl, body_id, it.id, it.span); - } - hir::ItemImpl(.., ref impl_item_refs) => { - debug!("ItemImpl {} with id {}", it.name, it.id); - - for impl_item_ref in impl_item_refs { - let impl_item = ccx.tcx.map.impl_item(impl_item_ref.id); - match impl_item.node { - hir::ImplItemKind::Const(_, expr) => { - check_const(ccx, expr, impl_item.id) - } - hir::ImplItemKind::Method(ref sig, body_id) => { - check_bare_fn(ccx, &sig.decl, body_id, impl_item.id, impl_item.span); - } - hir::ImplItemKind::Type(_) => { - // Nothing to do here. - } - } - } - } - hir::ItemTrait(.., ref trait_item_refs) => { - for trait_item_ref in trait_item_refs { - let trait_item = ccx.tcx.map.trait_item(trait_item_ref.id); - match trait_item.node { - hir::TraitItemKind::Const(_, Some(expr)) => { - check_const(ccx, expr, trait_item.id) - } - hir::TraitItemKind::Method(ref sig, hir::TraitMethod::Provided(body_id)) => { - check_bare_fn(ccx, &sig.decl, body_id, trait_item.id, trait_item.span); - } - hir::TraitItemKind::Method(_, hir::TraitMethod::Required(_)) | - hir::TraitItemKind::Const(_, None) | - hir::TraitItemKind::Type(..) => { - // Nothing to do. - } - } - } - } - _ => {/* nothing to do */ } - } -} - fn check_on_unimplemented<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, def_id: DefId, item: &hir::Item) { diff --git a/src/librustc_typeck/check/writeback.rs b/src/librustc_typeck/check/writeback.rs index 02ac7c196b5..172c1dfe35e 100644 --- a/src/librustc_typeck/check/writeback.rs +++ b/src/librustc_typeck/check/writeback.rs @@ -68,7 +68,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { struct WritebackCx<'cx, 'gcx: 'cx+'tcx, 'tcx: 'cx> { fcx: &'cx FnCtxt<'cx, 'gcx, 'tcx>, - tables: ty::Tables<'gcx>, + tables: ty::TypeckTables<'gcx>, // Mapping from free regions of the function to the // early-bound versions of them, visible from the @@ -81,7 +81,7 @@ impl<'cx, 'gcx, 'tcx> WritebackCx<'cx, 'gcx, 'tcx> { fn new(fcx: &'cx FnCtxt<'cx, 'gcx, 'tcx>) -> WritebackCx<'cx, 'gcx, 'tcx> { let mut wbcx = WritebackCx { fcx: fcx, - tables: ty::Tables::empty(), + tables: ty::TypeckTables::empty(), free_to_bound_regions: DefIdMap() }; diff --git a/src/test/compile-fail/dep-graph-assoc-type-trans.rs b/src/test/compile-fail/dep-graph-assoc-type-trans.rs index b56be9e5683..fe76a4d439f 100644 --- a/src/test/compile-fail/dep-graph-assoc-type-trans.rs +++ b/src/test/compile-fail/dep-graph-assoc-type-trans.rs @@ -35,7 +35,7 @@ mod x { mod y { use Foo; - #[rustc_then_this_would_need(TypeckItemBody)] //~ ERROR OK + #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK #[rustc_then_this_would_need(TransCrateItem)] //~ ERROR OK pub fn use_char_assoc() { // Careful here: in the representation, <char as Foo>::T gets diff --git a/src/test/compile-fail/dep-graph-caller-callee.rs b/src/test/compile-fail/dep-graph-caller-callee.rs index 0d6954ab9df..9cb87886809 100644 --- a/src/test/compile-fail/dep-graph-caller-callee.rs +++ b/src/test/compile-fail/dep-graph-caller-callee.rs @@ -27,7 +27,7 @@ mod y { use x; // These dependencies SHOULD exist: - #[rustc_then_this_would_need(TypeckItemBody)] //~ ERROR OK + #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK #[rustc_then_this_would_need(TransCrateItem)] //~ ERROR OK pub fn y() { x::x(); @@ -39,7 +39,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(TypeckItemBody)] //~ ERROR no path + #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path #[rustc_then_this_would_need(TransCrateItem)] //~ ERROR no path pub fn z() { y::y(); diff --git a/src/test/compile-fail/dep-graph-trait-impl-two-traits-same-method.rs b/src/test/compile-fail/dep-graph-trait-impl-two-traits-same-method.rs index 5e4f43af669..7dd02f57b36 100644 --- a/src/test/compile-fail/dep-graph-trait-impl-two-traits-same-method.rs +++ b/src/test/compile-fail/dep-graph-trait-impl-two-traits-same-method.rs @@ -39,7 +39,7 @@ mod x { mod y { use {Foo, Bar}; - #[rustc_then_this_would_need(TypeckItemBody)] //~ ERROR OK + #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK pub fn with_char() { char::method('a'); } @@ -48,7 +48,7 @@ mod y { mod z { use y; - #[rustc_then_this_would_need(TypeckItemBody)] //~ ERROR no path + #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path pub fn z() { y::with_char(); } diff --git a/src/test/compile-fail/dep-graph-trait-impl-two-traits.rs b/src/test/compile-fail/dep-graph-trait-impl-two-traits.rs index 2ec7573cb81..6b3525333bc 100644 --- a/src/test/compile-fail/dep-graph-trait-impl-two-traits.rs +++ b/src/test/compile-fail/dep-graph-trait-impl-two-traits.rs @@ -38,7 +38,7 @@ mod x { mod y { use {Foo, Bar}; - #[rustc_then_this_would_need(TypeckItemBody)] //~ ERROR no path + #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path pub fn call_bar() { char::bar('a'); } @@ -47,7 +47,7 @@ mod y { mod z { use y; - #[rustc_then_this_would_need(TypeckItemBody)] //~ ERROR no path + #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path pub fn z() { y::call_bar(); } diff --git a/src/test/compile-fail/dep-graph-trait-impl.rs b/src/test/compile-fail/dep-graph-trait-impl.rs index d87d7a6be1c..c0f9f054626 100644 --- a/src/test/compile-fail/dep-graph-trait-impl.rs +++ b/src/test/compile-fail/dep-graph-trait-impl.rs @@ -34,25 +34,25 @@ mod x { mod y { use Foo; - #[rustc_then_this_would_need(TypeckItemBody)] //~ ERROR OK + #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK #[rustc_then_this_would_need(TransCrateItem)] //~ ERROR OK pub fn with_char() { char::method('a'); } - #[rustc_then_this_would_need(TypeckItemBody)] //~ ERROR OK + #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK #[rustc_then_this_would_need(TransCrateItem)] //~ ERROR OK pub fn take_foo_with_char() { take_foo::<char>('a'); } - #[rustc_then_this_would_need(TypeckItemBody)] //~ ERROR OK + #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK #[rustc_then_this_would_need(TransCrateItem)] //~ ERROR OK pub fn with_u32() { u32::method(22); } - #[rustc_then_this_would_need(TypeckItemBody)] //~ ERROR OK + #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK #[rustc_then_this_would_need(TransCrateItem)] //~ ERROR OK pub fn take_foo_with_u32() { take_foo::<u32>(22); @@ -66,7 +66,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(TypeckItemBody)] //~ ERROR no path + #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path #[rustc_then_this_would_need(TransCrateItem)] //~ ERROR no path pub fn z() { y::with_char(); diff --git a/src/test/compile-fail/dep_graph_crosscontaminate_tables.rs b/src/test/compile-fail/dep_graph_crosscontaminate_tables.rs new file mode 100644 index 00000000000..2520e3a095e --- /dev/null +++ b/src/test/compile-fail/dep_graph_crosscontaminate_tables.rs @@ -0,0 +1,40 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that the `TypeckTables` nodes for impl items are independent from +// one another. + +// compile-flags: -Z query-dep-graph + +#![feature(rustc_attrs)] + +struct Foo { + x: u8 +} + +impl Foo { + // Changing the item `new`... + #[rustc_if_this_changed(HirBody)] + fn new() -> Foo { + Foo { x: 0 } + } + + // ...should not cause us to recompute the tables for `with`! + #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path + fn with(x: u8) -> Foo { + Foo { x: x } + } +} + +fn main() { + let f = Foo::new(); + let g = Foo::with(22); + assert_eq!(f.x, g.x - 22); +} diff --git a/src/test/incremental/add_private_fn_at_krate_root_cc/struct_point.rs b/src/test/incremental/add_private_fn_at_krate_root_cc/struct_point.rs index 489427ba1c1..40067efd575 100644 --- a/src/test/incremental/add_private_fn_at_krate_root_cc/struct_point.rs +++ b/src/test/incremental/add_private_fn_at_krate_root_cc/struct_point.rs @@ -32,7 +32,7 @@ extern crate point; mod fn_calls_methods_in_same_impl { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn check() { let x = Point { x: 2.0, y: 2.0 }; x.distance_from_origin(); @@ -43,7 +43,7 @@ mod fn_calls_methods_in_same_impl { mod fn_calls_free_fn { use point::{self, Point}; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn check() { let x = Point { x: 2.0, y: 2.0 }; point::distance_squared(&x); @@ -54,7 +54,7 @@ mod fn_calls_free_fn { mod fn_make_struct { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn make_origin() -> Point { Point { x: 2.0, y: 2.0 } } @@ -64,7 +64,7 @@ mod fn_make_struct { mod fn_read_field { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -74,7 +74,7 @@ mod fn_read_field { mod fn_write_field { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/src/test/incremental/callee_caller_cross_crate/b.rs b/src/test/incremental/callee_caller_cross_crate/b.rs index e8b187b5454..9e56d34636f 100644 --- a/src/test/incremental/callee_caller_cross_crate/b.rs +++ b/src/test/incremental/callee_caller_cross_crate/b.rs @@ -16,12 +16,12 @@ extern crate a; -#[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] +#[rustc_dirty(label="TypeckTables", cfg="rpass2")] pub fn call_function0() { a::function0(77); } -#[rustc_clean(label="TypeckItemBody", cfg="rpass2")] +#[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn call_function1() { a::function1(77); } diff --git a/src/test/incremental/change_add_field/struct_point.rs b/src/test/incremental/change_add_field/struct_point.rs index 261eb38a51a..e18b30a8c72 100644 --- a/src/test/incremental/change_add_field/struct_point.rs +++ b/src/test/incremental/change_add_field/struct_point.rs @@ -79,7 +79,7 @@ mod point { mod fn_with_type_in_sig { use point::Point; - #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] + #[rustc_dirty(label="TypeckTables", cfg="rpass2")] pub fn boop(p: Option<&Point>) -> f32 { p.map(|p| p.total()).unwrap_or(0.0) } @@ -95,7 +95,7 @@ mod fn_with_type_in_sig { mod call_fn_with_type_in_sig { use fn_with_type_in_sig; - #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] + #[rustc_dirty(label="TypeckTables", cfg="rpass2")] pub fn bip() -> f32 { fn_with_type_in_sig::boop(None) } @@ -111,7 +111,7 @@ mod call_fn_with_type_in_sig { mod fn_with_type_in_body { use point::Point; - #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] + #[rustc_dirty(label="TypeckTables", cfg="rpass2")] pub fn boop() -> f32 { Point::origin().total() } @@ -124,7 +124,7 @@ mod fn_with_type_in_body { mod call_fn_with_type_in_body { use fn_with_type_in_body; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn bip() -> f32 { fn_with_type_in_body::boop() } @@ -134,7 +134,7 @@ mod call_fn_with_type_in_body { mod fn_make_struct { use point::Point; - #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] + #[rustc_dirty(label="TypeckTables", cfg="rpass2")] pub fn make_origin(p: Point) -> Point { Point { ..p } } @@ -144,7 +144,7 @@ mod fn_make_struct { mod fn_read_field { use point::Point; - #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] + #[rustc_dirty(label="TypeckTables", cfg="rpass2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -154,7 +154,7 @@ mod fn_read_field { mod fn_write_field { use point::Point; - #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] + #[rustc_dirty(label="TypeckTables", cfg="rpass2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/src/test/incremental/change_crate_order/main.rs b/src/test/incremental/change_crate_order/main.rs index bd8742ff38e..5ee75d44f1d 100644 --- a/src/test/incremental/change_crate_order/main.rs +++ b/src/test/incremental/change_crate_order/main.rs @@ -28,7 +28,7 @@ extern crate a; use a::A; use b::B; -//? #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] +//? #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn main() { A + B; } diff --git a/src/test/incremental/change_private_fn/struct_point.rs b/src/test/incremental/change_private_fn/struct_point.rs index 678bc10f1e5..abfd55ba52c 100644 --- a/src/test/incremental/change_private_fn/struct_point.rs +++ b/src/test/incremental/change_private_fn/struct_point.rs @@ -59,7 +59,7 @@ mod point { mod fn_calls_methods_in_same_impl { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn check() { let x = Point { x: 2.0, y: 2.0 }; x.distance_from_origin(); @@ -70,7 +70,7 @@ mod fn_calls_methods_in_same_impl { mod fn_calls_methods_in_another_impl { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn check() { let mut x = Point { x: 2.0, y: 2.0 }; x.translate(3.0, 3.0); @@ -81,7 +81,7 @@ mod fn_calls_methods_in_another_impl { mod fn_make_struct { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn make_origin() -> Point { Point { x: 2.0, y: 2.0 } } @@ -91,7 +91,7 @@ mod fn_make_struct { mod fn_read_field { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -101,7 +101,7 @@ mod fn_read_field { mod fn_write_field { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/src/test/incremental/change_private_fn_cc/struct_point.rs b/src/test/incremental/change_private_fn_cc/struct_point.rs index ded87dd27f4..a6d029515d7 100644 --- a/src/test/incremental/change_private_fn_cc/struct_point.rs +++ b/src/test/incremental/change_private_fn_cc/struct_point.rs @@ -31,7 +31,7 @@ extern crate point; mod fn_calls_methods_in_same_impl { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn check() { let x = Point { x: 2.0, y: 2.0 }; x.distance_from_origin(); @@ -42,7 +42,7 @@ mod fn_calls_methods_in_same_impl { mod fn_calls_methods_in_another_impl { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn check() { let mut x = Point { x: 2.0, y: 2.0 }; x.translate(3.0, 3.0); @@ -53,7 +53,7 @@ mod fn_calls_methods_in_another_impl { mod fn_make_struct { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn make_origin() -> Point { Point { x: 2.0, y: 2.0 } } @@ -63,7 +63,7 @@ mod fn_make_struct { mod fn_read_field { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -73,7 +73,7 @@ mod fn_read_field { mod fn_write_field { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/src/test/incremental/change_private_impl_method/struct_point.rs b/src/test/incremental/change_private_impl_method/struct_point.rs index 46e5a88eef9..d8c6cafe596 100644 --- a/src/test/incremental/change_private_impl_method/struct_point.rs +++ b/src/test/incremental/change_private_impl_method/struct_point.rs @@ -59,7 +59,7 @@ mod point { mod fn_calls_methods_in_same_impl { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn check() { let x = Point { x: 2.0, y: 2.0 }; x.distance_from_origin(); @@ -70,7 +70,7 @@ mod fn_calls_methods_in_same_impl { mod fn_calls_methods_in_another_impl { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn check() { let mut x = Point { x: 2.0, y: 2.0 }; x.translate(3.0, 3.0); @@ -81,7 +81,7 @@ mod fn_calls_methods_in_another_impl { mod fn_make_struct { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn make_origin() -> Point { Point { x: 2.0, y: 2.0 } } @@ -91,7 +91,7 @@ mod fn_make_struct { mod fn_read_field { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -101,7 +101,7 @@ mod fn_read_field { mod fn_write_field { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/src/test/incremental/change_private_impl_method_cc/struct_point.rs b/src/test/incremental/change_private_impl_method_cc/struct_point.rs index 4d9ca77969b..05c076b9f4b 100644 --- a/src/test/incremental/change_private_impl_method_cc/struct_point.rs +++ b/src/test/incremental/change_private_impl_method_cc/struct_point.rs @@ -32,7 +32,7 @@ extern crate point; mod fn_calls_methods_in_same_impl { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn check() { let x = Point { x: 2.0, y: 2.0 }; x.distance_from_origin(); @@ -43,7 +43,7 @@ mod fn_calls_methods_in_same_impl { mod fn_calls_methods_in_another_impl { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn dirty() { let mut x = Point { x: 2.0, y: 2.0 }; x.translate(3.0, 3.0); @@ -54,7 +54,7 @@ mod fn_calls_methods_in_another_impl { mod fn_make_struct { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn make_origin() -> Point { Point { x: 2.0, y: 2.0 } } @@ -64,7 +64,7 @@ mod fn_make_struct { mod fn_read_field { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -74,7 +74,7 @@ mod fn_read_field { mod fn_write_field { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/src/test/incremental/change_pub_inherent_method_body/struct_point.rs b/src/test/incremental/change_pub_inherent_method_body/struct_point.rs index e0047e5ec64..5b29ee1435f 100644 --- a/src/test/incremental/change_pub_inherent_method_body/struct_point.rs +++ b/src/test/incremental/change_pub_inherent_method_body/struct_point.rs @@ -50,7 +50,7 @@ mod point { mod fn_calls_changed_method { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn check() { let p = Point { x: 2.0, y: 2.0 }; p.distance_from_origin(); @@ -61,7 +61,7 @@ mod fn_calls_changed_method { mod fn_calls_another_method { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn check() { let p = Point { x: 2.0, y: 2.0 }; p.x(); @@ -72,7 +72,7 @@ mod fn_calls_another_method { mod fn_make_struct { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn make_origin() -> Point { Point { x: 2.0, y: 2.0 } } @@ -82,7 +82,7 @@ mod fn_make_struct { mod fn_read_field { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -92,7 +92,7 @@ mod fn_read_field { mod fn_write_field { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/src/test/incremental/change_pub_inherent_method_sig/struct_point.rs b/src/test/incremental/change_pub_inherent_method_sig/struct_point.rs index 54e06e16998..f8db6c69a76 100644 --- a/src/test/incremental/change_pub_inherent_method_sig/struct_point.rs +++ b/src/test/incremental/change_pub_inherent_method_sig/struct_point.rs @@ -61,7 +61,7 @@ mod point { mod fn_calls_changed_method { use point::Point; - #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] + #[rustc_dirty(label="TypeckTables", cfg="rpass2")] pub fn check() { let p = Point { x: 2.0, y: 2.0 }; p.distance_from_point(None); @@ -72,7 +72,7 @@ mod fn_calls_changed_method { mod fn_calls_another_method { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn check() { let p = Point { x: 2.0, y: 2.0 }; p.x(); @@ -83,7 +83,7 @@ mod fn_calls_another_method { mod fn_make_struct { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn make_origin() -> Point { Point { x: 2.0, y: 2.0 } } @@ -93,7 +93,7 @@ mod fn_make_struct { mod fn_read_field { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn get_x(p: Point) -> f32 { p.x } @@ -103,7 +103,7 @@ mod fn_read_field { mod fn_write_field { use point::Point; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn inc_x(p: &mut Point) { p.x += 1.0; } diff --git a/src/test/incremental/dirty_clean.rs b/src/test/incremental/dirty_clean.rs index 64b7f2951d2..9f20128de4f 100644 --- a/src/test/incremental/dirty_clean.rs +++ b/src/test/incremental/dirty_clean.rs @@ -35,20 +35,20 @@ mod x { mod y { use x; - #[rustc_clean(label="TypeckItemBody", cfg="cfail2")] + #[rustc_clean(label="TypeckTables", cfg="cfail2")] #[rustc_clean(label="TransCrateItem", cfg="cfail2")] pub fn y() { - //[cfail2]~^ ERROR `TypeckItemBody("y::y")` not found in dep graph, but should be clean + //[cfail2]~^ ERROR `TypeckTables("y::y")` not found in dep graph, but should be clean //[cfail2]~| ERROR `TransCrateItem("y::y")` not found in dep graph, but should be clean x::x(); } } mod z { - #[rustc_dirty(label="TypeckItemBody", cfg="cfail2")] + #[rustc_dirty(label="TypeckTables", cfg="cfail2")] #[rustc_dirty(label="TransCrateItem", cfg="cfail2")] pub fn z() { - //[cfail2]~^ ERROR `TypeckItemBody("z::z")` found in dep graph, but should be dirty + //[cfail2]~^ ERROR `TypeckTables("z::z")` found in dep graph, but should be dirty //[cfail2]~| ERROR `TransCrateItem("z::z")` found in dep graph, but should be dirty } } diff --git a/src/test/incremental/hello_world.rs b/src/test/incremental/hello_world.rs index b7f90c09b56..2d65e0aa657 100644 --- a/src/test/incremental/hello_world.rs +++ b/src/test/incremental/hello_world.rs @@ -31,7 +31,7 @@ mod x { mod y { use x; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn yyyy() { x::xxxx(); } @@ -40,7 +40,7 @@ mod y { mod z { use y; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn z() { y::yyyy(); } diff --git a/src/test/incremental/rlib_cross_crate/b.rs b/src/test/incremental/rlib_cross_crate/b.rs index 21b654bdf58..9849e93d3ff 100644 --- a/src/test/incremental/rlib_cross_crate/b.rs +++ b/src/test/incremental/rlib_cross_crate/b.rs @@ -22,15 +22,15 @@ extern crate a; -#[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] -#[rustc_clean(label="TypeckItemBody", cfg="rpass3")] +#[rustc_dirty(label="TypeckTables", cfg="rpass2")] +#[rustc_clean(label="TypeckTables", cfg="rpass3")] pub fn use_X() -> u32 { let x: a::X = 22; x as u32 } -#[rustc_clean(label="TypeckItemBody", cfg="rpass2")] -#[rustc_clean(label="TypeckItemBody", cfg="rpass3")] +#[rustc_clean(label="TypeckTables", cfg="rpass2")] +#[rustc_clean(label="TypeckTables", cfg="rpass3")] pub fn use_Y() { let x: a::Y = 'c'; } diff --git a/src/test/incremental/string_constant.rs b/src/test/incremental/string_constant.rs index 8651a67bae2..669d001cc63 100644 --- a/src/test/incremental/string_constant.rs +++ b/src/test/incremental/string_constant.rs @@ -27,7 +27,7 @@ mod x { } #[cfg(rpass2)] - #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] + #[rustc_dirty(label="TypeckTables", cfg="rpass2")] #[rustc_dirty(label="TransCrateItem", cfg="rpass2")] pub fn x() { println!("{}", "2"); @@ -37,7 +37,7 @@ mod x { mod y { use x; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] #[rustc_clean(label="TransCrateItem", cfg="rpass2")] pub fn y() { x::x(); @@ -47,7 +47,7 @@ mod y { mod z { use y; - #[rustc_clean(label="TypeckItemBody", cfg="rpass2")] + #[rustc_clean(label="TypeckTables", cfg="rpass2")] #[rustc_clean(label="TransCrateItem", cfg="rpass2")] pub fn z() { y::y(); diff --git a/src/test/incremental/struct_add_field.rs b/src/test/incremental/struct_add_field.rs index da1b32cd73d..42681eb2be4 100644 --- a/src/test/incremental/struct_add_field.rs +++ b/src/test/incremental/struct_add_field.rs @@ -31,17 +31,17 @@ pub struct Y { pub y: char } -#[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] +#[rustc_dirty(label="TypeckTables", cfg="rpass2")] pub fn use_X(x: X) -> u32 { x.x as u32 } -#[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] +#[rustc_dirty(label="TypeckTables", cfg="rpass2")] pub fn use_EmbedX(embed: EmbedX) -> u32 { embed.x.x as u32 } -#[rustc_clean(label="TypeckItemBody", cfg="rpass2")] +#[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn use_Y() { let x: Y = Y { y: 'c' }; } diff --git a/src/test/incremental/struct_change_field_name.rs b/src/test/incremental/struct_change_field_name.rs index cb43d127405..63df407d5c0 100644 --- a/src/test/incremental/struct_change_field_name.rs +++ b/src/test/incremental/struct_change_field_name.rs @@ -34,7 +34,7 @@ pub struct Y { pub y: char } -#[rustc_dirty(label="TypeckItemBody", cfg="cfail2")] +#[rustc_dirty(label="TypeckTables", cfg="cfail2")] pub fn use_X() -> u32 { let x: X = X { x: 22 }; //[cfail2]~^ ERROR struct `X` has no field named `x` @@ -42,13 +42,13 @@ pub fn use_X() -> u32 { //[cfail2]~^ ERROR no field `x` on type `X` } -#[rustc_dirty(label="TypeckItemBody", cfg="cfail2")] +#[rustc_dirty(label="TypeckTables", 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="TypeckItemBody", cfg="cfail2")] +#[rustc_clean(label="TypeckTables", cfg="cfail2")] pub fn use_Y() { let x: Y = Y { y: 'c' }; } diff --git a/src/test/incremental/struct_change_field_type.rs b/src/test/incremental/struct_change_field_type.rs index 65f3b1b4f36..67b34163979 100644 --- a/src/test/incremental/struct_change_field_type.rs +++ b/src/test/incremental/struct_change_field_type.rs @@ -34,19 +34,19 @@ pub struct Y { pub y: char } -#[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] +#[rustc_dirty(label="TypeckTables", cfg="rpass2")] pub fn use_X() -> u32 { let x: X = X { x: 22 }; x.x as u32 } -#[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] +#[rustc_dirty(label="TypeckTables", cfg="rpass2")] pub fn use_EmbedX(x: EmbedX) -> u32 { let x: X = X { x: 22 }; x.x as u32 } -#[rustc_clean(label="TypeckItemBody", cfg="rpass2")] +#[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn use_Y() { let x: Y = Y { y: 'c' }; } diff --git a/src/test/incremental/struct_change_field_type_cross_crate/b.rs b/src/test/incremental/struct_change_field_type_cross_crate/b.rs index 95e15d0b7f9..9660f47da35 100644 --- a/src/test/incremental/struct_change_field_type_cross_crate/b.rs +++ b/src/test/incremental/struct_change_field_type_cross_crate/b.rs @@ -18,18 +18,18 @@ extern crate a; use a::*; -#[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] +#[rustc_dirty(label="TypeckTables", cfg="rpass2")] pub fn use_X() -> u32 { let x: X = X { x: 22 }; x.x as u32 } -#[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] +#[rustc_dirty(label="TypeckTables", cfg="rpass2")] pub fn use_EmbedX(embed: EmbedX) -> u32 { embed.x.x as u32 } -#[rustc_clean(label="TypeckItemBody", cfg="rpass2")] +#[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn use_Y() { let x: Y = Y { y: 'c' }; } diff --git a/src/test/incremental/struct_change_nothing.rs b/src/test/incremental/struct_change_nothing.rs index 2bc636153f7..e2d40458744 100644 --- a/src/test/incremental/struct_change_nothing.rs +++ b/src/test/incremental/struct_change_nothing.rs @@ -34,19 +34,19 @@ pub struct Y { pub y: char } -#[rustc_clean(label="TypeckItemBody", cfg="rpass2")] +#[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn use_X() -> u32 { let x: X = X { x: 22 }; x.x as u32 } -#[rustc_clean(label="TypeckItemBody", cfg="rpass2")] +#[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn use_EmbedX(x: EmbedX) -> u32 { let x: X = X { x: 22 }; x.x as u32 } -#[rustc_clean(label="TypeckItemBody", cfg="rpass2")] +#[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn use_Y() { let x: Y = Y { y: 'c' }; } diff --git a/src/test/incremental/struct_remove_field.rs b/src/test/incremental/struct_remove_field.rs index a7ed79d1a5a..fba965ff5a0 100644 --- a/src/test/incremental/struct_remove_field.rs +++ b/src/test/incremental/struct_remove_field.rs @@ -35,17 +35,17 @@ pub struct Y { pub y: char } -#[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] +#[rustc_dirty(label="TypeckTables", cfg="rpass2")] pub fn use_X(x: X) -> u32 { x.x as u32 } -#[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] +#[rustc_dirty(label="TypeckTables", cfg="rpass2")] pub fn use_EmbedX(embed: EmbedX) -> u32 { embed.x.x as u32 } -#[rustc_clean(label="TypeckItemBody", cfg="rpass2")] +#[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn use_Y() { let x: Y = Y { y: 'c' }; } diff --git a/src/test/incremental/type_alias_cross_crate/b.rs b/src/test/incremental/type_alias_cross_crate/b.rs index 09d4db33198..ee35a4d9b9c 100644 --- a/src/test/incremental/type_alias_cross_crate/b.rs +++ b/src/test/incremental/type_alias_cross_crate/b.rs @@ -16,15 +16,15 @@ extern crate a; -#[rustc_dirty(label="TypeckItemBody", cfg="rpass2")] -#[rustc_clean(label="TypeckItemBody", cfg="rpass3")] +#[rustc_dirty(label="TypeckTables", cfg="rpass2")] +#[rustc_clean(label="TypeckTables", cfg="rpass3")] pub fn use_X() -> u32 { let x: a::X = 22; x as u32 } -#[rustc_clean(label="TypeckItemBody", cfg="rpass2")] -#[rustc_clean(label="TypeckItemBody", cfg="rpass3")] +#[rustc_clean(label="TypeckTables", cfg="rpass2")] +#[rustc_clean(label="TypeckTables", cfg="rpass3")] pub fn use_Y() { let x: a::Y = 'c'; } |
