Skip to content

False positive in possible_missing_comma #4399

Closed
@YaLTeR

Description

@YaLTeR

clippy 0.0.212 (e3cb40e 2019-06-25) and also the nightly clippy 0.0.212 (72da101 2019-08-11)

Looks like a similar case to #3244 and #3396.

We have code like this:

  let hfilter: [i32; 7] = [
    coeffs[1][0] as i32,
    coeffs[1][1] as i32,
    coeffs[1][2] as i32,
    128
      - 2 * (coeffs[1][0] as i32 + coeffs[1][1] as i32 + coeffs[1][2] as i32),
    coeffs[1][2] as i32,
    coeffs[1][1] as i32,
    coeffs[1][0] as i32,
  ];

That expression starting with 128 got broken into two lines by rustfmt as it doesn't fit into a single line, and now clippy is reporting a possible_missing_comma there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions