diff --git a/tests/compile-fail/formatting.rs b/tests/compile-fail/formatting.rs index 096132b70937..6c6671b0aa40 100644 --- a/tests/compile-fail/formatting.rs +++ b/tests/compile-fail/formatting.rs @@ -98,10 +98,30 @@ fn main() { b = !false; // possible missing comma in an array - let mut c = &[ + let _ = &[ -1, -2, -3 // <= no coma here //~^ ERROR possibly missing a comma here //~| NOTE to remove this lint, add a comma or write the expr in a single line -4, -5, -6 ]; + let _ = &[ + -1, -2, -3 // <= no coma here + //~^ ERROR possibly missing a comma here + //~| NOTE to remove this lint, add a comma or write the expr in a single line + *4, -5, -6 + ]; + + // those are ok: + let _ = &[ + -1, -2, -3, + -4, -5, -6 + ]; + let _ = &[ + -1, -2, -3, + -4, -5, -6, + ]; + let _ = &[ + 1 + 2, 3 + + 4, 5 + 6, + ]; }