Add test cases for possible missing comma lint

This commit is contained in:
Bood Qian 2017-02-04 20:02:53 +08:00
parent 33577ec3f7
commit cb83a299fa

View file

@ -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,
];
}