diff options
| author | bors <bors@rust-lang.org> | 2015-10-02 07:10:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-10-02 07:10:43 +0000 |
| commit | a004ff5cafb6111bcb3a00d67133a84ff727bad1 (patch) | |
| tree | b258548e86807b1afb3aa33c243557d2de459e20 /src/libsyntax/parse | |
| parent | 7643c4ca75305d37121616ca89fd5d994eeddfbc (diff) | |
| parent | b093060c2a122ff1433bbb46aa603b99be5ef8f9 (diff) | |
| download | rust-a004ff5cafb6111bcb3a00d67133a84ff727bad1.tar.gz rust-a004ff5cafb6111bcb3a00d67133a84ff727bad1.zip | |
Auto merge of #28793 - Ms2ger:AttrStyle, r=alexcrichton
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/attr.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/parse/lexer/comments.rs | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index 015cf60f0cf..219360093d1 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -44,7 +44,7 @@ impl<'a> ParserAttr for Parser<'a> { self.span.lo, self.span.hi ); - if attr.node.style != ast::AttrOuter { + if attr.node.style != ast::AttrStyle::Outer { panic!(self.fatal("expected outer comment")); } attrs.push(attr); @@ -79,9 +79,9 @@ impl<'a> ParserAttr for Parser<'a> { self.fileline_help(span, "place inner attribute at the top of the module or block"); } - ast::AttrInner + ast::AttrStyle::Inner } else { - ast::AttrOuter + ast::AttrStyle::Outer }; panictry!(self.expect(&token::OpenDelim(token::Bracket))); @@ -101,7 +101,7 @@ impl<'a> ParserAttr for Parser<'a> { panictry!(self.bump()); self.span_warn(span, "this inner attribute syntax is deprecated. \ The new syntax is `#![foo]`, with a bang and no semicolon"); - style = ast::AttrInner; + style = ast::AttrStyle::Inner; } return Spanned { @@ -131,7 +131,7 @@ impl<'a> ParserAttr for Parser<'a> { } let attr = self.parse_attribute(true); - assert!(attr.node.style == ast::AttrInner); + assert!(attr.node.style == ast::AttrStyle::Inner); attrs.push(attr); } token::DocComment(s) => { @@ -139,7 +139,7 @@ impl<'a> ParserAttr for Parser<'a> { let Span { lo, hi, .. } = self.span; let str = self.id_to_interned_str(ast::Ident::with_empty_ctxt(s)); let attr = attr::mk_sugared_doc_attr(attr::mk_attr_id(), str, lo, hi); - if attr.node.style == ast::AttrInner { + if attr.node.style == ast::AttrStyle::Inner { attrs.push(attr); panictry!(self.bump()); } else { diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs index 9033208fbdb..137996a35ee 100644 --- a/src/libsyntax/parse/lexer/comments.rs +++ b/src/libsyntax/parse/lexer/comments.rs @@ -52,9 +52,9 @@ pub fn is_doc_comment(s: &str) -> bool { pub fn doc_comment_style(comment: &str) -> ast::AttrStyle { assert!(is_doc_comment(comment)); if comment.starts_with("//!") || comment.starts_with("/*!") { - ast::AttrInner + ast::AttrStyle::Inner } else { - ast::AttrOuter + ast::AttrStyle::Outer } } |
