]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_lint/unused.rs
Fix rebase fallout.
[rust.git] / src / librustc_lint / unused.rs
index 3f85e6d772ec146249dc81da9ae4dbb8baeb5d1d..9f293bdaa105e592c69d3e4be57ce8a721534de8 100644 (file)
@@ -10,7 +10,7 @@
 
 use syntax::ast;
 use syntax::attr;
-use syntax::errors::{Applicability, pluralise};
+use syntax::errors::{Applicability, pluralize};
 use syntax::feature_gate::{AttributeType, BuiltinAttribute, BUILTIN_ATTRIBUTE_MAP};
 use syntax::print::pprust;
 use syntax::symbol::{kw, sym};
@@ -144,7 +144,7 @@ fn check_must_use_ty<'tcx>(
                 return true;
             }
 
-            let plural_suffix = pluralise!(plural_len);
+            let plural_suffix = pluralize!(plural_len);
 
             match ty.kind {
                 ty::Adt(..) if ty.is_box() => {
@@ -309,29 +309,11 @@ fn check_attribute(&mut self, cx: &LateContext<'_, '_>, attr: &ast::Attribute) {
             }
         }
 
-        let plugin_attributes = cx.sess().plugin_attributes.borrow();
-        for &(name, ty) in plugin_attributes.iter() {
-            if ty == AttributeType::Whitelisted && attr.check_name(name) {
-                debug!("{:?} (plugin attr) is whitelisted with ty {:?}", name, ty);
-                break;
-            }
-        }
-
-        let name = attr.name_or_empty();
         if !attr::is_used(attr) {
             debug!("emitting warning for: {:?}", attr);
             cx.span_lint(UNUSED_ATTRIBUTES, attr.span, "unused attribute");
             // Is it a builtin attribute that must be used at the crate level?
-            let known_crate = attr_info.map(|&&(_, ty, ..)| {
-                    ty == AttributeType::CrateLevel
-            }).unwrap_or(false);
-
-            // Has a plugin registered this attribute as one that must be used at
-            // the crate level?
-            let plugin_crate = plugin_attributes.iter()
-                .find(|&&(x, t)| name == x && AttributeType::CrateLevel == t)
-                .is_some();
-            if known_crate || plugin_crate {
+            if attr_info.map_or(false, |(_, ty, ..)| ty == &AttributeType::CrateLevel) {
                 let msg = match attr.style {
                     ast::AttrStyle::Outer => {
                         "crate-level attribute should be an inner attribute: add an exclamation \