Skip to content

Commit 8e087cd

Browse files
committed
Use symbols in lint tool list
1 parent 7de6f54 commit 8e087cd

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/bootstrap/bin/rustc.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,15 @@ fn main() {
306306
}
307307

308308
// This is required for internal lints.
309-
cmd.arg("-Zunstable-options");
310309
if let Some(crate_name) = args.windows(2).find(|a| &*a[0] == "--crate-name") {
311310
let crate_name = crate_name[1].to_string_lossy();
312-
if crate_name.starts_with("rustc")
313-
|| crate_name.starts_with("syntax")
314-
|| crate_name == "arena"
315-
|| crate_name == "fmt_macros"
311+
if crate_name != "rustc_version"
312+
&& (crate_name.starts_with("rustc")
313+
|| crate_name.starts_with("syntax")
314+
|| crate_name == "arena"
315+
|| crate_name == "fmt_macros")
316316
{
317+
cmd.arg("-Zunstable-options");
317318
if stage != "0" {
318319
cmd.arg("-Wrustc::internal");
319320
}

src/libsyntax/attr/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub fn is_known(attr: &Attribute) -> bool {
6060
}
6161

6262
pub fn is_known_lint_tool(m_item: Ident) -> bool {
63-
["clippy", "rustc"].contains(&m_item.as_str().as_ref())
63+
[sym::clippy, sym::rustc].contains(&m_item.name)
6464
}
6565

6666
impl NestedMetaItem {

src/libsyntax_pos/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ symbols! {
173173
cfg_target_thread_local,
174174
cfg_target_vendor,
175175
char,
176+
clippy,
176177
clone,
177178
Clone,
178179
clone_closures,

0 commit comments

Comments
 (0)