diff --git a/src/expr.rs b/src/expr.rs index 31953380a73..9c4f48bbb7e 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -2106,7 +2106,7 @@ fn count_line_breaks(src: &str) -> usize { // Expression did not fit on the same line as the identifier or is // at least three lines big. Try splitting the line and see // if that works better. - let new_shape = try_opt!(shape.block_left(context.config.tab_spaces)); + let new_shape = try_opt!(shape.block_left(context.config.tab_spaces())); let new_rhs = ex.rewrite(context, new_shape); // FIXME: DRY! diff --git a/tests/source/macros.rs b/tests/source/macros.rs index afaf67359ed..b83f74c47d5 100644 --- a/tests/source/macros.rs +++ b/tests/source/macros.rs @@ -41,6 +41,12 @@ fn main() { vec![a, b; c]; vec![a; b, c]; + vec![a; (|x| { let y = x + 1; let z = y + 1; z })(2)]; + vec![a; xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]; + vec![a; unsafe { + x + 1 + }]; + unknown_bracket_macro__comma_should_not_be_stripped![ a, ]; diff --git a/tests/target/macros.rs b/tests/target/macros.rs index 2f65b4e4f6e..c19bb242ca3 100644 --- a/tests/target/macros.rs +++ b/tests/target/macros.rs @@ -45,6 +45,16 @@ fn main() { vec![a, b; c]; vec![a; b, c]; + vec![a; + (|x| { + let y = x + 1; + let z = y + 1; + z + })(2)]; + vec![a; + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]; + vec![a; unsafe { x + 1 }]; + unknown_bracket_macro__comma_should_not_be_stripped![ a, ];