diff options
Diffstat (limited to 'src/libsyntax/config.rs')
| -rw-r--r-- | src/libsyntax/config.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libsyntax/config.rs b/src/libsyntax/config.rs index 682c8f71dc8..5f89ed36e2a 100644 --- a/src/libsyntax/config.rs +++ b/src/libsyntax/config.rs @@ -93,10 +93,10 @@ impl<'a> StripUnconfigured<'a> { /// is in the original source file. Gives a compiler error if the syntax of /// the attribute is incorrect. fn process_cfg_attr(&mut self, attr: ast::Attribute) -> Vec<ast::Attribute> { - if attr.item.path != sym::cfg_attr { + if !attr.has_name(sym::cfg_attr) { return vec![attr]; } - if attr.item.tokens.is_empty() { + if attr.get_normal_item().tokens.is_empty() { self.sess.span_diagnostic .struct_span_err( attr.span, @@ -136,10 +136,9 @@ impl<'a> StripUnconfigured<'a> { // `#[cfg_attr(false, cfg_attr(true, some_attr))]`. expanded_attrs.into_iter() .flat_map(|(item, span)| self.process_cfg_attr(ast::Attribute { - item, + kind: ast::AttrKind::Normal(item), id: attr::mk_attr_id(), style: attr.style, - is_sugared_doc: false, span, })) .collect() @@ -212,7 +211,7 @@ impl<'a> StripUnconfigured<'a> { GateIssue::Language, EXPLAIN_STMT_ATTR_SYNTAX); - if attr.is_sugared_doc { + if attr.is_doc_comment() { err.help("`///` is for documentation comments. For a plain comment, use `//`."); } |
