Use symbols in lint tool list

This commit is contained in:
flip1995 2019-06-24 18:14:04 +02:00
parent 7de6f54728
commit 8e087cdd98
No known key found for this signature in database
GPG Key ID: 693086869D506637
3 changed files with 8 additions and 6 deletions

View File

@ -306,14 +306,15 @@ fn main() {
}
// This is required for internal lints.
cmd.arg("-Zunstable-options");
if let Some(crate_name) = args.windows(2).find(|a| &*a[0] == "--crate-name") {
let crate_name = crate_name[1].to_string_lossy();
if crate_name.starts_with("rustc")
|| crate_name.starts_with("syntax")
|| crate_name == "arena"
|| crate_name == "fmt_macros"
if crate_name != "rustc_version"
&& (crate_name.starts_with("rustc")
|| crate_name.starts_with("syntax")
|| crate_name == "arena"
|| crate_name == "fmt_macros")
{
cmd.arg("-Zunstable-options");
if stage != "0" {
cmd.arg("-Wrustc::internal");
}

View File

@ -60,7 +60,7 @@ pub fn is_known(attr: &Attribute) -> bool {
}
pub fn is_known_lint_tool(m_item: Ident) -> bool {
["clippy", "rustc"].contains(&m_item.as_str().as_ref())
[sym::clippy, sym::rustc].contains(&m_item.name)
}
impl NestedMetaItem {

View File

@ -173,6 +173,7 @@ symbols! {
cfg_target_thread_local,
cfg_target_vendor,
char,
clippy,
clone,
Clone,
clone_closures,