Skip to content

Commit 03b8091

Browse files
Move some constants to rustc::ich.
1 parent 9af97e7 commit 03b8091

File tree

5 files changed

+21
-22
lines changed

5 files changed

+21
-22
lines changed

src/librustc/ich/mod.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,20 @@ pub use self::caching_codemap_view::CachingCodemapView;
1515
mod fingerprint;
1616
mod def_path_hash;
1717
mod caching_codemap_view;
18+
19+
pub const ATTR_DIRTY: &'static str = "rustc_dirty";
20+
pub const ATTR_CLEAN: &'static str = "rustc_clean";
21+
pub const ATTR_DIRTY_METADATA: &'static str = "rustc_metadata_dirty";
22+
pub const ATTR_CLEAN_METADATA: &'static str = "rustc_metadata_clean";
23+
pub const ATTR_IF_THIS_CHANGED: &'static str = "rustc_if_this_changed";
24+
pub const ATTR_THEN_THIS_WOULD_NEED: &'static str = "rustc_then_this_would_need";
25+
26+
pub const IGNORED_ATTRIBUTES: &'static [&'static str] = &[
27+
"cfg",
28+
ATTR_IF_THIS_CHANGED,
29+
ATTR_THEN_THIS_WOULD_NEED,
30+
ATTR_DIRTY,
31+
ATTR_CLEAN,
32+
ATTR_DIRTY_METADATA,
33+
ATTR_CLEAN_METADATA
34+
];

src/librustc_incremental/assert_dep_graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ use rustc_data_structures::fx::FxHashSet;
5252
use rustc_data_structures::graph::{Direction, INCOMING, OUTGOING, NodeIndex};
5353
use rustc::hir;
5454
use rustc::hir::itemlikevisit::ItemLikeVisitor;
55+
use rustc::ich::{ATTR_IF_THIS_CHANGED, ATTR_THEN_THIS_WOULD_NEED};
5556
use graphviz::IntoCow;
5657
use std::env;
5758
use std::fs::File;
5859
use std::io::Write;
5960
use syntax::ast;
6061
use syntax_pos::Span;
61-
use {ATTR_IF_THIS_CHANGED, ATTR_THEN_THIS_WOULD_NEED};
6262

6363
pub fn assert_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
6464
let _ignore = tcx.dep_graph.in_ignore();

src/librustc_incremental/calculate_svh/svh_visitor.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,12 @@ use rustc::hir::*;
2626
use rustc::hir::def::Def;
2727
use rustc::hir::def_id::DefId;
2828
use rustc::hir::intravisit::{self as visit, Visitor};
29-
use rustc::ich::{DefPathHashes, CachingCodemapView};
29+
use rustc::ich::{DefPathHashes, CachingCodemapView, IGNORED_ATTRIBUTES};
3030
use rustc::ty::TyCtxt;
3131
use std::hash::{Hash, Hasher};
3232

3333
use super::IchHasher;
3434

35-
const IGNORED_ATTRIBUTES: &'static [&'static str] = &[
36-
"cfg",
37-
::ATTR_IF_THIS_CHANGED,
38-
::ATTR_THEN_THIS_WOULD_NEED,
39-
::ATTR_DIRTY,
40-
::ATTR_CLEAN,
41-
::ATTR_DIRTY_METADATA,
42-
::ATTR_CLEAN_METADATA
43-
];
44-
4535
pub struct StrictVersionHashVisitor<'a, 'hash: 'a, 'tcx: 'hash> {
4636
pub tcx: TyCtxt<'hash, 'tcx, 'tcx>,
4737
pub st: &'a mut IchHasher,

src/librustc_incremental/lib.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ extern crate serialize as rustc_serialize;
3636
extern crate syntax;
3737
extern crate syntax_pos;
3838

39-
const ATTR_DIRTY: &'static str = "rustc_dirty";
40-
const ATTR_CLEAN: &'static str = "rustc_clean";
41-
const ATTR_DIRTY_METADATA: &'static str = "rustc_metadata_dirty";
42-
const ATTR_CLEAN_METADATA: &'static str = "rustc_metadata_clean";
43-
const ATTR_IF_THIS_CHANGED: &'static str = "rustc_if_this_changed";
44-
const ATTR_THEN_THIS_WOULD_NEED: &'static str = "rustc_then_this_would_need";
45-
4639
mod assert_dep_graph;
4740
mod calculate_svh;
4841
mod persist;

src/librustc_incremental/persist/dirty_clean.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,13 @@ use rustc::hir;
4747
use rustc::hir::def_id::DefId;
4848
use rustc::hir::itemlikevisit::ItemLikeVisitor;
4949
use rustc::hir::intravisit;
50-
use rustc::ich::Fingerprint;
50+
use rustc::ich::{Fingerprint, ATTR_DIRTY, ATTR_CLEAN, ATTR_DIRTY_METADATA,
51+
ATTR_CLEAN_METADATA};
5152
use syntax::ast::{self, Attribute, NestedMetaItem};
5253
use rustc_data_structures::fx::{FxHashSet, FxHashMap};
5354
use syntax_pos::Span;
5455
use rustc::ty::TyCtxt;
5556

56-
use {ATTR_DIRTY, ATTR_CLEAN, ATTR_DIRTY_METADATA, ATTR_CLEAN_METADATA};
57-
5857
const LABEL: &'static str = "label";
5958
const CFG: &'static str = "cfg";
6059

0 commit comments

Comments
 (0)