mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-04 02:54:00 +00:00
Merge pull request #349 from globin/rust-nightly-update
Adapt to rust sytax::ast::Mac changes
This commit is contained in:
commit
c14cfca0e3
@ -49,13 +49,12 @@ pub fn rewrite_macro(mac: &ast::Mac,
|
|||||||
width: usize,
|
width: usize,
|
||||||
offset: Indent)
|
offset: Indent)
|
||||||
-> Option<String> {
|
-> Option<String> {
|
||||||
let ast::Mac_::MacInvocTT(ref path, ref tt_vec, _) = mac.node;
|
|
||||||
let style = macro_style(mac, context);
|
let style = macro_style(mac, context);
|
||||||
let macro_name = format!("{}!", path);
|
let macro_name = format!("{}!", mac.node.path);
|
||||||
|
|
||||||
if let MacroStyle::Braces = style {
|
if let MacroStyle::Braces = style {
|
||||||
return None;
|
return None;
|
||||||
} else if tt_vec.is_empty() {
|
} else if mac.node.tts.is_empty() {
|
||||||
return if let MacroStyle::Parens = style {
|
return if let MacroStyle::Parens = style {
|
||||||
Some(format!("{}()", macro_name))
|
Some(format!("{}()", macro_name))
|
||||||
} else {
|
} 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
|
// Wrap expression parsing logic in a thread since the libsyntax parser
|
||||||
// panicks on failure, which we do not want to propagate.
|
// panicks on failure, which we do not want to propagate.
|
||||||
let expr_vec_result = thread::catch_panic(move || {
|
let expr_vec_result = thread::catch_panic(move || {
|
||||||
|
Loading…
Reference in New Issue
Block a user