From 5e2633b7420b0363720e1770b6c308cfabd0a8dd Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 23 Sep 2015 18:31:31 +0000 Subject: [PATCH] adapt to rust sytax::ast::Mac changes --- src/macros.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/macros.rs b/src/macros.rs index 8c38326ee8a..3fe0c2b1552 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -49,13 +49,12 @@ pub fn rewrite_macro(mac: &ast::Mac, width: usize, offset: Indent) -> Option { - let ast::Mac_::MacInvocTT(ref path, ref tt_vec, _) = mac.node; let style = macro_style(mac, context); - let macro_name = format!("{}!", path); + let macro_name = format!("{}!", mac.node.path); if let MacroStyle::Braces = style { return None; - } else if tt_vec.is_empty() { + } else if mac.node.tts.is_empty() { return if let MacroStyle::Parens = style { Some(format!("{}()", macro_name)) } else { @@ -63,7 +62,7 @@ pub fn rewrite_macro(mac: &ast::Mac, }; } - let wrapped_tt_vec = ForceSend((*tt_vec).clone()); + let wrapped_tt_vec = ForceSend(mac.node.tts.clone()); // Wrap expression parsing logic in a thread since the libsyntax parser // panicks on failure, which we do not want to propagate. let expr_vec_result = thread::catch_panic(move || {