Fix test failures
This commit is contained in:
parent
c95fa8cbe2
commit
19054347ca
@ -130,7 +130,10 @@ fn rewrite_macro_name(path: &ast::Path, extra_ident: Option<ast::Ident>) -> Stri
|
||||
}
|
||||
|
||||
// Use this on failing to format the macro call.
|
||||
fn return_original_snippet_with_failure_marked(context: &RewriteContext, span: Span) -> Option<String> {
|
||||
fn return_original_snippet_with_failure_marked(
|
||||
context: &RewriteContext,
|
||||
span: Span,
|
||||
) -> Option<String> {
|
||||
context.macro_rewrite_failure.replace(true);
|
||||
Some(context.snippet(span).to_owned())
|
||||
}
|
||||
@ -225,7 +228,11 @@ pub fn rewrite_macro_inner(
|
||||
break;
|
||||
}
|
||||
}
|
||||
None => return return_original_snippet_with_failure_marked(context, mac.span),
|
||||
None => {
|
||||
return return_original_snippet_with_failure_marked(
|
||||
context, mac.span,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -742,7 +742,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
|
||||
where
|
||||
F: Fn(&RewriteContext) -> Option<String>,
|
||||
{
|
||||
let mut result;
|
||||
let result;
|
||||
let macro_rewrite_failure = {
|
||||
let context = self.get_context();
|
||||
result = f(&context);
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
// Do not unindent macro calls in comment with unformattable syntax.
|
||||
//! ```rust
|
||||
//! let x = 3;
|
||||
//! let x = 3 ;
|
||||
//! some_macro!(pub fn fn foo() (
|
||||
//! println!("Don't unindent me!");
|
||||
//! ));
|
||||
|
Loading…
x
Reference in New Issue
Block a user