about summary refs log tree commit diff
path: root/src/libsyntax/print
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2019-05-29 04:10:49 +0300
committerDavid Wood <david@davidtw.co>2019-06-03 10:20:35 +0100
commitd0c78dd7aa692a9338b2085e8d227cde73d2a5f9 (patch)
tree1290fd73b61126610fbfa497888549feea6ba00f /src/libsyntax/print
parentc57ed9d9478dcd12c854a0ef4e83c7f384ade060 (diff)
downloadrust-d0c78dd7aa692a9338b2085e8d227cde73d2a5f9.tar.gz
rust-d0c78dd7aa692a9338b2085e8d227cde73d2a5f9.zip
syntax: revert `ast::AsyncArgument` and associated changes.
Here follows the main reverts applied in order to make this commit:

Revert "Rollup merge of #60676 - davidtwco:issue-60674, r=cramertj"

This reverts commit 45b09453dbf120cc23d889435aac3ed7d2ec8eb7, reversing
changes made to f6df1f6c30b469cb9e65c5453a0efa03cbb6005e.

Revert "Rollup merge of #60437 - davidtwco:issue-60236, r=nikomatsakis"

This reverts commit 16939a50ea440e72cb6ecefdaabb988addb1ec0e, reversing
changes made to 12bf98155249783583a91863c5dccf9e346f1226.

Revert "Rollup merge of #59823 - davidtwco:issue-54716, r=cramertj"

This reverts commit 62d1574876f5531bce1b267e62dff520d7adcbbb, reversing
changes made to 4eff8526a789e0dfa8b97f7dec91b7b5c18e8544.
Diffstat (limited to 'src/libsyntax/print')
-rw-r--r--src/libsyntax/print/pprust.rs23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index cf546332c2c..b81dc53ef68 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -357,7 +357,7 @@ pub fn vis_to_string(v: &ast::Visibility) -> String {
 }
 
 pub fn fun_to_string(decl: &ast::FnDecl,
-                     header: &ast::FnHeader,
+                     header: ast::FnHeader,
                      name: ast::Ident,
                      generics: &ast::Generics)
                      -> String {
@@ -1040,7 +1040,7 @@ impl<'a> State<'a> {
         match item.node {
             ast::ForeignItemKind::Fn(ref decl, ref generics) => {
                 self.head("")?;
-                self.print_fn(decl, &ast::FnHeader::default(),
+                self.print_fn(decl, ast::FnHeader::default(),
                               Some(item.ident),
                               generics, &item.vis)?;
                 self.end()?; // end head-ibox
@@ -1170,7 +1170,7 @@ impl<'a> State<'a> {
                 self.s.word(";")?;
                 self.end()?; // end the outer cbox
             }
-            ast::ItemKind::Fn(ref decl, ref header, ref param_names, ref body) => {
+            ast::ItemKind::Fn(ref decl, header, ref param_names, ref body) => {
                 self.head("")?;
                 self.print_fn(
                     decl,
@@ -1522,7 +1522,7 @@ impl<'a> State<'a> {
                             vis: &ast::Visibility)
                             -> io::Result<()> {
         self.print_fn(&m.decl,
-                      &m.header,
+                      m.header,
                       Some(ident),
                       &generics,
                       vis)
@@ -2113,7 +2113,7 @@ impl<'a> State<'a> {
                 self.bclose_(expr.span, INDENT_UNIT)?;
             }
             ast::ExprKind::Closure(
-                capture_clause, ref asyncness, movability, ref decl, ref body, _) => {
+                capture_clause, asyncness, movability, ref decl, ref body, _) => {
                 self.print_movability(movability)?;
                 self.print_asyncness(asyncness)?;
                 self.print_capture_clause(capture_clause)?;
@@ -2710,7 +2710,7 @@ impl<'a> State<'a> {
 
     pub fn print_fn(&mut self,
                     decl: &ast::FnDecl,
-                    header: &ast::FnHeader,
+                    header: ast::FnHeader,
                     name: Option<ast::Ident>,
                     generics: &ast::Generics,
                     vis: &ast::Visibility) -> io::Result<()> {
@@ -2765,7 +2765,8 @@ impl<'a> State<'a> {
         }
     }
 
-    pub fn print_asyncness(&mut self, asyncness: &ast::IsAsync) -> io::Result<()> {
+    pub fn print_asyncness(&mut self, asyncness: ast::IsAsync)
+                                -> io::Result<()> {
         if asyncness.is_async() {
             self.word_nbsp("async")?;
         }
@@ -3037,7 +3038,7 @@ impl<'a> State<'a> {
             span: syntax_pos::DUMMY_SP,
         };
         self.print_fn(decl,
-                      &ast::FnHeader { unsafety, abi, ..ast::FnHeader::default() },
+                      ast::FnHeader { unsafety, abi, ..ast::FnHeader::default() },
                       name,
                       &generics,
                       &source_map::dummy_spanned(ast::VisibilityKind::Inherited))?;
@@ -3100,7 +3101,7 @@ impl<'a> State<'a> {
     }
 
     pub fn print_fn_header_info(&mut self,
-                                header: &ast::FnHeader,
+                                header: ast::FnHeader,
                                 vis: &ast::Visibility) -> io::Result<()> {
         self.s.word(visibility_qualified(vis, ""))?;
 
@@ -3109,7 +3110,7 @@ impl<'a> State<'a> {
             ast::Constness::Const => self.word_nbsp("const")?
         }
 
-        self.print_asyncness(&header.asyncness.node)?;
+        self.print_asyncness(header.asyncness.node)?;
         self.print_unsafety(header.unsafety)?;
 
         if header.abi != Abi::Rust {
@@ -3158,7 +3159,7 @@ mod tests {
             assert_eq!(
                 fun_to_string(
                     &decl,
-                    &ast::FnHeader {
+                    ast::FnHeader {
                         unsafety: ast::Unsafety::Normal,
                         constness: source_map::dummy_spanned(ast::Constness::NotConst),
                         asyncness: source_map::dummy_spanned(ast::IsAsync::NotAsync),