Merge pull request #1726 from topecongiro/tuple-overflow

Apply the same overflowing rule to tuple as function call
This commit is contained in:
Nick Cameron 2017-06-19 14:36:50 +12:00 committed by GitHub
commit f2fd4fbf2c
4 changed files with 38 additions and 14 deletions

View File

@ -2309,8 +2309,8 @@ pub fn can_be_overflowed_expr(context: &RewriteContext, expr: &ast::Expr, args_l
ast::ExprKind::Call(..) |
ast::ExprKind::MethodCall(..) |
ast::ExprKind::Mac(..) |
ast::ExprKind::Struct(..) => context.use_block_indent() && args_len == 1,
ast::ExprKind::Tup(..) => context.use_block_indent(),
ast::ExprKind::Struct(..) |
ast::ExprKind::Tup(..) => context.use_block_indent() && args_len == 1,
ast::ExprKind::AddrOf(_, ref expr) |
ast::ExprKind::Box(ref expr) |
ast::ExprKind::Try(ref expr) |

View File

@ -45,3 +45,8 @@ fn issue775() {
mk_object(&[("d".to_string(), String("".to_string()))])]))]);
}
}
fn issue1725() {
bench_antialiased_lines!(bench_draw_antialiased_line_segment_diagonal, (10, 10), (450, 450));
bench_antialiased_lines!(bench_draw_antialiased_line_segment_shallow, (10, 10), (450, 80));
}

View File

@ -257,10 +257,13 @@ fn combine_block() {
foo(param)
});
do_thing(x, (1, 2, 3, |param| {
action();
foo(param)
}));
do_thing(
x,
(1, 2, 3, |param| {
action();
foo(param)
}),
);
Ok(some_function(
lllllllllong_argument_one,

View File

@ -47,14 +47,17 @@ fn b() {
}
fn issue550() {
self.visitor.visit_volume(self.level.sector_id(sector), (
floor_y,
if is_sky_flat(ceil_tex) {
from_wad_height(self.height_range.1)
} else {
ceil_y
},
));
self.visitor.visit_volume(
self.level.sector_id(sector),
(
floor_y,
if is_sky_flat(ceil_tex) {
from_wad_height(self.height_range.1)
} else {
ceil_y
},
),
);
}
fn issue775() {
@ -75,3 +78,16 @@ fn issue775() {
);
}
}
fn issue1725() {
bench_antialiased_lines!(
bench_draw_antialiased_line_segment_diagonal,
(10, 10),
(450, 450)
);
bench_antialiased_lines!(
bench_draw_antialiased_line_segment_shallow,
(10, 10),
(450, 80)
);
}