Fix possible_missing_comma false positives
`possible_missing_comma` should only trigger when the binary operator has unary equivalent. Otherwise, it's not possible to insert a comma without breaking compilation. The operators identified were `+`, `&`, `*` and `-`. This fixes the specific examples given in issues #3244 and #3396 but doesn't address the conflict this lint has with the style of starting a line with a binary operator.
This commit is contained in:
parent
a07c271559
commit
0c1ffc1d1f
2 changed files with 35 additions and 13 deletions
|
|
@ -112,4 +112,16 @@ fn main() {
|
|||
1 + 2, 3 +
|
||||
4, 5 + 6,
|
||||
];
|
||||
|
||||
// don't lint for bin op without unary equiv
|
||||
// issue 3244
|
||||
vec![
|
||||
1
|
||||
/ 2,
|
||||
];
|
||||
// issue 3396
|
||||
vec![
|
||||
true
|
||||
| false,
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue