diff --git a/src/librustc/ich/mod.rs b/src/librustc/ich/mod.rs index b8cf52ec672..209953f3c68 100644 --- a/src/librustc/ich/mod.rs +++ b/src/librustc/ich/mod.rs @@ -15,3 +15,20 @@ pub use self::caching_codemap_view::CachingCodemapView; mod fingerprint; mod def_path_hash; mod caching_codemap_view; + +pub const ATTR_DIRTY: &'static str = "rustc_dirty"; +pub const ATTR_CLEAN: &'static str = "rustc_clean"; +pub const ATTR_DIRTY_METADATA: &'static str = "rustc_metadata_dirty"; +pub const ATTR_CLEAN_METADATA: &'static str = "rustc_metadata_clean"; +pub const ATTR_IF_THIS_CHANGED: &'static str = "rustc_if_this_changed"; +pub const ATTR_THEN_THIS_WOULD_NEED: &'static str = "rustc_then_this_would_need"; + +pub const IGNORED_ATTRIBUTES: &'static [&'static str] = &[ + "cfg", + ATTR_IF_THIS_CHANGED, + ATTR_THEN_THIS_WOULD_NEED, + ATTR_DIRTY, + ATTR_CLEAN, + ATTR_DIRTY_METADATA, + ATTR_CLEAN_METADATA +]; diff --git a/src/librustc_incremental/assert_dep_graph.rs b/src/librustc_incremental/assert_dep_graph.rs index 287ee7dd13e..897ca0f2957 100644 --- a/src/librustc_incremental/assert_dep_graph.rs +++ b/src/librustc_incremental/assert_dep_graph.rs @@ -52,13 +52,13 @@ use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::graph::{Direction, INCOMING, OUTGOING, NodeIndex}; use rustc::hir; use rustc::hir::itemlikevisit::ItemLikeVisitor; +use rustc::ich::{ATTR_IF_THIS_CHANGED, ATTR_THEN_THIS_WOULD_NEED}; use graphviz::IntoCow; use std::env; use std::fs::File; use std::io::Write; use syntax::ast; use syntax_pos::Span; -use {ATTR_IF_THIS_CHANGED, ATTR_THEN_THIS_WOULD_NEED}; pub fn assert_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { let _ignore = tcx.dep_graph.in_ignore(); diff --git a/src/librustc_incremental/calculate_svh/svh_visitor.rs b/src/librustc_incremental/calculate_svh/svh_visitor.rs index 3b6e2748e97..210803c3f32 100644 --- a/src/librustc_incremental/calculate_svh/svh_visitor.rs +++ b/src/librustc_incremental/calculate_svh/svh_visitor.rs @@ -26,22 +26,12 @@ use rustc::hir::*; use rustc::hir::def::Def; use rustc::hir::def_id::DefId; use rustc::hir::intravisit::{self as visit, Visitor}; -use rustc::ich::{DefPathHashes, CachingCodemapView}; +use rustc::ich::{DefPathHashes, CachingCodemapView, IGNORED_ATTRIBUTES}; use rustc::ty::TyCtxt; use std::hash::{Hash, Hasher}; use super::IchHasher; -const IGNORED_ATTRIBUTES: &'static [&'static str] = &[ - "cfg", - ::ATTR_IF_THIS_CHANGED, - ::ATTR_THEN_THIS_WOULD_NEED, - ::ATTR_DIRTY, - ::ATTR_CLEAN, - ::ATTR_DIRTY_METADATA, - ::ATTR_CLEAN_METADATA -]; - pub struct StrictVersionHashVisitor<'a, 'hash: 'a, 'tcx: 'hash> { pub tcx: TyCtxt<'hash, 'tcx, 'tcx>, pub st: &'a mut IchHasher, diff --git a/src/librustc_incremental/lib.rs b/src/librustc_incremental/lib.rs index 40e9cb97d66..3b61cc1464a 100644 --- a/src/librustc_incremental/lib.rs +++ b/src/librustc_incremental/lib.rs @@ -36,13 +36,6 @@ extern crate serialize as rustc_serialize; extern crate syntax; extern crate syntax_pos; -const ATTR_DIRTY: &'static str = "rustc_dirty"; -const ATTR_CLEAN: &'static str = "rustc_clean"; -const ATTR_DIRTY_METADATA: &'static str = "rustc_metadata_dirty"; -const ATTR_CLEAN_METADATA: &'static str = "rustc_metadata_clean"; -const ATTR_IF_THIS_CHANGED: &'static str = "rustc_if_this_changed"; -const ATTR_THEN_THIS_WOULD_NEED: &'static str = "rustc_then_this_would_need"; - mod assert_dep_graph; mod calculate_svh; mod persist; diff --git a/src/librustc_incremental/persist/dirty_clean.rs b/src/librustc_incremental/persist/dirty_clean.rs index cd5c8900092..d931f64d579 100644 --- a/src/librustc_incremental/persist/dirty_clean.rs +++ b/src/librustc_incremental/persist/dirty_clean.rs @@ -47,14 +47,13 @@ use rustc::hir; use rustc::hir::def_id::DefId; use rustc::hir::itemlikevisit::ItemLikeVisitor; use rustc::hir::intravisit; -use rustc::ich::Fingerprint; +use rustc::ich::{Fingerprint, ATTR_DIRTY, ATTR_CLEAN, ATTR_DIRTY_METADATA, + ATTR_CLEAN_METADATA}; use syntax::ast::{self, Attribute, NestedMetaItem}; use rustc_data_structures::fx::{FxHashSet, FxHashMap}; use syntax_pos::Span; use rustc::ty::TyCtxt; -use {ATTR_DIRTY, ATTR_CLEAN, ATTR_DIRTY_METADATA, ATTR_CLEAN_METADATA}; - const LABEL: &'static str = "label"; const CFG: &'static str = "cfg";