Add test cases for possible missing comma lint
This commit is contained in:
parent
33577ec3f7
commit
cb83a299fa
|
@ -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,
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue