about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-08-03 13:11:59 +0200
committerGitHub <noreply@github.com>2019-08-03 13:11:59 +0200
commit15b5aacab65156f06d9f622f75808842dc90e005 (patch)
treeda49d454617d23ce5b946986b05b793d92421e2c /src/libsyntax/parse
parent42a32812751fcd532691f9e29a19ed5bceb928ad (diff)
parentc146344e32018a8b28c456352a873f9feafd6ff3 (diff)
downloadrust-15b5aacab65156f06d9f622f75808842dc90e005.tar.gz
rust-15b5aacab65156f06d9f622f75808842dc90e005.zip
Rollup merge of #63146 - Mark-Simulacrum:clean-attr, r=petrochenkov
Cleanup syntax::attr

Mostly removing needless arguments to constructors

r? @petrochenkov
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/attr.rs4
-rw-r--r--src/libsyntax/parse/parser.rs11
2 files changed, 4 insertions, 11 deletions
diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs
index af484c886ab..a42da112360 100644
--- a/src/libsyntax/parse/attr.rs
+++ b/src/libsyntax/parse/attr.rs
@@ -53,7 +53,7 @@ impl<'a> Parser<'a> {
                     just_parsed_doc_comment = false;
                 }
                 token::DocComment(s) => {
-                    let attr = attr::mk_sugared_doc_attr(attr::mk_attr_id(), s, self.token.span);
+                    let attr = attr::mk_sugared_doc_attr(s, self.token.span);
                     if attr.style != ast::AttrStyle::Outer {
                         let mut err = self.fatal("expected outer doc comment");
                         err.note("inner doc comments like this (starting with \
@@ -239,7 +239,7 @@ impl<'a> Parser<'a> {
                 }
                 token::DocComment(s) => {
                     // we need to get the position of this token before we bump.
-                    let attr = attr::mk_sugared_doc_attr(attr::mk_attr_id(), s, self.token.span);
+                    let attr = attr::mk_sugared_doc_attr(s, self.token.span);
                     if attr.style == ast::AttrStyle::Inner {
                         attrs.push(attr);
                         self.bump();
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index eca1e218fca..880dd6e1649 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -6395,15 +6395,8 @@ impl<'a> Parser<'a> {
                     self.eval_src_mod(path, directory_ownership, id.to_string(), id_span)?;
                 // Record that we fetched the mod from an external file
                 if warn {
-                    let attr = Attribute {
-                        id: attr::mk_attr_id(),
-                        style: ast::AttrStyle::Outer,
-                        path: ast::Path::from_ident(
-                            Ident::with_empty_ctxt(sym::warn_directory_ownership)),
-                        tokens: TokenStream::empty(),
-                        is_sugared_doc: false,
-                        span: DUMMY_SP,
-                    };
+                    let attr = attr::mk_attr_outer(
+                        attr::mk_word_item(Ident::with_empty_ctxt(sym::warn_directory_ownership)));
                     attr::mark_known(&attr);
                     attrs.push(attr);
                 }