diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-07-23 02:52:51 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-08-01 12:08:41 +0300 |
| commit | c3e54217e855a2492d9b707eb3fb7cdb6702d45a (patch) | |
| tree | 8ec77f793c09069edeaefd2e32a29e39488952b8 /src/libsyntax/attr | |
| parent | c63bb1d6a7e7ede79ddc5ddf41087668266824ea (diff) | |
| download | rust-c3e54217e855a2492d9b707eb3fb7cdb6702d45a.tar.gz rust-c3e54217e855a2492d9b707eb3fb7cdb6702d45a.zip | |
resolve: Implement prelude search for macro paths
resolve/expansion: Implement tool attributes
Diffstat (limited to 'src/libsyntax/attr')
| -rw-r--r-- | src/libsyntax/attr/mod.rs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/libsyntax/attr/mod.rs b/src/libsyntax/attr/mod.rs index 137b94230a3..938fd2767c9 100644 --- a/src/libsyntax/attr/mod.rs +++ b/src/libsyntax/attr/mod.rs @@ -89,17 +89,8 @@ pub fn is_known(attr: &Attribute) -> bool { }) } -const RUST_KNOWN_TOOL: &[&str] = &["clippy", "rustfmt"]; -const RUST_KNOWN_LINT_TOOL: &[&str] = &["clippy"]; - -pub fn is_known_tool(attr: &Attribute) -> bool { - let tool_name = - attr.path.segments.iter().next().expect("empty path in attribute").ident.name; - RUST_KNOWN_TOOL.contains(&tool_name.as_str().as_ref()) -} - pub fn is_known_lint_tool(m_item: Ident) -> bool { - RUST_KNOWN_LINT_TOOL.contains(&m_item.as_str().as_ref()) + ["clippy"].contains(&m_item.as_str().as_ref()) } impl NestedMetaItem { @@ -245,10 +236,6 @@ impl Attribute { pub fn is_value_str(&self) -> bool { self.value_str().is_some() } - - pub fn is_scoped(&self) -> bool { - self.path.segments.len() > 1 - } } impl MetaItem { |
