Use symbols in lint tool list
This commit is contained in:
parent
7de6f54728
commit
8e087cdd98
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -173,6 +173,7 @@ symbols! {
|
|||
cfg_target_thread_local,
|
||||
cfg_target_vendor,
|
||||
char,
|
||||
clippy,
|
||||
clone,
|
||||
Clone,
|
||||
clone_closures,
|
||||
|
|
Loading…
Reference in New Issue