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};
return true;
}
- let plural_suffix = pluralise!(plural_len);
+ let plural_suffix = pluralize!(plural_len);
match ty.kind {
ty::Adt(..) if ty.is_box() => {
}
}
- 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 \