2020-04-27 17:56:11 +00:00
|
|
|
use rustc_ast::MetaItem;
|
2019-12-29 14:23:55 +00:00
|
|
|
use rustc_expand::base::ExtCtxt;
|
2019-11-30 01:34:18 +00:00
|
|
|
use rustc_feature::AttributeTemplate;
|
2019-12-22 22:42:04 +00:00
|
|
|
use rustc_parse::validate_attr;
|
2019-12-31 17:15:40 +00:00
|
|
|
use rustc_span::Symbol;
|
2019-10-08 12:15:26 +00:00
|
|
|
|
|
|
|
pub fn check_builtin_macro_attribute(ecx: &ExtCtxt<'_>, meta_item: &MetaItem, name: Symbol) {
|
|
|
|
// All the built-in macro attributes are "words" at the moment.
|
2019-12-30 18:38:43 +00:00
|
|
|
let template = AttributeTemplate { word: true, ..Default::default() };
|
2019-10-08 12:15:26 +00:00
|
|
|
let attr = ecx.attribute(meta_item.clone());
|
2020-07-30 01:27:50 +00:00
|
|
|
validate_attr::check_builtin_attribute(&ecx.sess.parse_sess, &attr, name, template);
|
2019-10-08 12:15:26 +00:00
|
|
|
}
|