mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 06:28:20 +03:00
Merge pull request #312 from marcusklaas/closure-fix
Prevent generation of bogus comment in some function calls
This commit is contained in:
+2
-1
@@ -40,7 +40,8 @@ fn rewrite(&self, context: &RewriteContext, width: usize, offset: usize) -> Opti
|
||||
}
|
||||
}
|
||||
ast::Expr_::ExprCall(ref callee, ref args) => {
|
||||
rewrite_call(context, &**callee, args, self.span, width, offset)
|
||||
let inner_span = mk_sp(callee.span.hi, self.span.hi);
|
||||
rewrite_call(context, &**callee, args, inner_span, width, offset)
|
||||
}
|
||||
ast::Expr_::ExprParen(ref subexpr) => {
|
||||
rewrite_paren(context, subexpr, width, offset)
|
||||
|
||||
@@ -44,3 +44,9 @@ fn main() {
|
||||
|arg1, arg2, _, _, arg3, arg4| { let temp = arg4 + arg3;
|
||||
arg2 * arg1 - temp }
|
||||
}
|
||||
|
||||
fn issue311() {
|
||||
let func = |x| println!("{}", x);
|
||||
|
||||
(func)(0.0);
|
||||
}
|
||||
|
||||
@@ -70,3 +70,9 @@ fn main() {
|
||||
arg2 * arg1 - temp
|
||||
}
|
||||
}
|
||||
|
||||
fn issue311() {
|
||||
let func = |x| println!("{}", x);
|
||||
|
||||
(func)(0.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user