about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSeiichi Uchida <seuchida@gmail.com>2018-04-06 23:09:45 +0900
committerGitHub <noreply@github.com>2018-04-06 23:09:45 +0900
commitedcc7b69ebe7f13223bd0e44f766a050df859eaa (patch)
tree2b8d70d962566921d4bef6133ff67b4997321144 /src
parentb6645e345ed3bb50ea881be9b480638094a8933d (diff)
Cargo update (#2602)
Update `rustc-ap-syntax` to 89.0.0 and fix up breaking changes.
Diffstat (limited to 'src')
-rw-r--r--src/expr.rs4
-rw-r--r--src/items.rs4
-rw-r--r--src/utils.rs3
3 files changed, 6 insertions, 5 deletions
diff --git a/src/expr.rs b/src/expr.rs
index 14ba8d0f7a0..d2ae5ba94e1 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -288,9 +288,7 @@ pub fn format_expr(
         }
         // We do not format these expressions yet, but they should still
         // satisfy our width restrictions.
-        ast::ExprKind::InPlace(..) | ast::ExprKind::InlineAsm(..) => {
-            Some(context.snippet(expr.span).to_owned())
-        }
+        ast::ExprKind::InlineAsm(..) => Some(context.snippet(expr.span).to_owned()),
         ast::ExprKind::Catch(ref block) => {
             if let rw @ Some(_) =
                 rewrite_single_line_block(context, "do catch ", block, Some(&expr.attrs), shape)
diff --git a/src/items.rs b/src/items.rs
index 940cd245523..eabd234b0ee 100644
--- a/src/items.rs
+++ b/src/items.rs
@@ -26,6 +26,7 @@ use config::{BraceStyle, Config, Density, IndentStyle};
 use expr::{format_expr, is_empty_block, is_simple_block_stmt, rewrite_assign_rhs,
            rewrite_assign_rhs_with, ExprType, RhsTactics};
 use lists::{definitive_tactic, itemize_list, write_list, ListFormatting, ListItem, Separator};
+use macros::{rewrite_macro, MacroPosition};
 use overflow;
 use rewrite::{Rewrite, RewriteContext};
 use shape::{Indent, Shape};
@@ -2732,6 +2733,9 @@ impl Rewrite for ast::ForeignItem {
                 let vis = format_visibility(&self.vis);
                 Some(format!("{}type {};", vis, self.ident))
             }
+            ast::ForeignItemKind::Macro(ref mac) => {
+                rewrite_macro(mac, None, context, shape, MacroPosition::Item)
+            }
         }?;
 
         let missing_span = if self.attrs.is_empty() {
diff --git a/src/utils.rs b/src/utils.rs
index 522c066b02f..055f75b4609 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -358,8 +358,7 @@ pub fn paren_overhead(context: &RewriteContext) -> usize {
 
 pub fn left_most_sub_expr(e: &ast::Expr) -> &ast::Expr {
     match e.node {
-        ast::ExprKind::InPlace(ref e, _)
-        | ast::ExprKind::Call(ref e, _)
+        ast::ExprKind::Call(ref e, _)
         | ast::ExprKind::Binary(_, ref e, _)
         | ast::ExprKind::Cast(ref e, _)
         | ast::ExprKind::Type(ref e, _)