]> git.lizzy.rs Git - rust.git/commitdiff
Foramt macro on types
authorSeiichi Uchida <seuchida@gmail.com>
Mon, 4 Dec 2017 23:41:20 +0000 (08:41 +0900)
committerSeiichi Uchida <seuchida@gmail.com>
Mon, 4 Dec 2017 23:42:13 +0000 (08:42 +0900)
src/types.rs

index ef185a3f7d4d1a02bd89afdda3e297826d2be363..88f9dba5c3f0c4ccb00b7735081cbf48c58c364d 100644 (file)
@@ -23,6 +23,7 @@
 use items::{format_generics_item_list, generics_shape_from_config};
 use lists::{definitive_tactic, itemize_list, write_list, ListFormatting, ListTactic, Separator,
             SeparatorPlace, SeparatorTactic};
+use macros::{rewrite_macro, MacroPosition};
 use rewrite::{Rewrite, RewriteContext};
 use shape::Shape;
 use utils::{colon_spaces, extra_offset, first_line_width, format_abi, format_mutability,
@@ -726,7 +727,9 @@ fn rewrite(&self, context: &RewriteContext, shape: Shape) -> Option<String> {
             }
             ast::TyKind::BareFn(ref bare_fn) => rewrite_bare_fn(bare_fn, self.span, context, shape),
             ast::TyKind::Never => Some(String::from("!")),
-            ast::TyKind::Mac(..) => None,
+            ast::TyKind::Mac(ref mac) => {
+                rewrite_macro(mac, None, context, shape, MacroPosition::Expression)
+            }
             ast::TyKind::ImplicitSelf => Some(String::from("")),
             ast::TyKind::ImplTrait(ref it) => it.rewrite(context, shape)
                 .map(|it_str| format!("impl {}", it_str)),