Skip to content

Commit 9cf59b5

Browse files
committed
Remove some unnecessary renamings of constants.
1 parent e6d541a commit 9cf59b5

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/librustc_incremental/assert_module_sources.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ use syntax::symbol::{Symbol, sym};
3131
use rustc::ich::{ATTR_PARTITION_REUSED, ATTR_PARTITION_CODEGENED,
3232
ATTR_EXPECTED_CGU_REUSE};
3333

34-
const MODULE: Symbol = sym::module;
35-
const CFG: Symbol = sym::cfg;
36-
const KIND: Symbol = sym::kind;
37-
3834
pub fn assert_module_sources(tcx: TyCtxt<'_>) {
3935
tcx.dep_graph.with_ignore(|| {
4036
if tcx.sess.opts.incremental.is_none() {
@@ -71,7 +67,7 @@ impl AssertModuleSource<'tcx> {
7167
} else if attr.check_name(ATTR_PARTITION_CODEGENED) {
7268
(CguReuse::No, ComparisonKind::Exact)
7369
} else if attr.check_name(ATTR_EXPECTED_CGU_REUSE) {
74-
match &self.field(attr, KIND).as_str()[..] {
70+
match &self.field(attr, sym::kind).as_str()[..] {
7571
"no" => (CguReuse::No, ComparisonKind::Exact),
7672
"pre-lto" => (CguReuse::PreLto, ComparisonKind::Exact),
7773
"post-lto" => (CguReuse::PostLto, ComparisonKind::Exact),
@@ -98,7 +94,7 @@ impl AssertModuleSource<'tcx> {
9894
return;
9995
}
10096

101-
let user_path = self.field(attr, MODULE).as_str().to_string();
97+
let user_path = self.field(attr, sym::module).as_str().to_string();
10298
let crate_name = self.tcx.crate_name(LOCAL_CRATE).as_str().to_string();
10399

104100
if !user_path.starts_with(&crate_name) {
@@ -125,7 +121,7 @@ impl AssertModuleSource<'tcx> {
125121
cgu_path_components,
126122
cgu_special_suffix);
127123

128-
debug!("mapping '{}' to cgu name '{}'", self.field(attr, MODULE), cgu_name);
124+
debug!("mapping '{}' to cgu name '{}'", self.field(attr, sym::module), cgu_name);
129125

130126
if !self.available_cgus.contains(&cgu_name) {
131127
self.tcx.sess.span_err(attr.span,
@@ -169,7 +165,7 @@ impl AssertModuleSource<'tcx> {
169165
/// cfg flag called `foo`.
170166
fn check_config(&self, attr: &ast::Attribute) -> bool {
171167
let config = &self.tcx.sess.parse_sess.config;
172-
let value = self.field(attr, CFG);
168+
let value = self.field(attr, sym::cfg);
173169
debug!("check_config(config={:?}, value={:?})", config, value);
174170
if config.iter().any(|&(name, _)| name == value) {
175171
debug!("check_config: matched");

0 commit comments

Comments
 (0)