Skip to content

redundant_field_names FP: path with type parameters #3476

Closed
@sinkuu

Description

@sinkuu
fn foo<T>() {
}

struct S {
    foo: fn(),
}

fn main() {
    S { foo: foo::<i32> };
}
warning: redundant field names in struct initialization
 --> src/main.rs:9:9
  |
9 |     S { foo: foo::<i32> };
  |         ^^^^^^^^^^^^^^^ help: replace it with: `foo`
  |
  = note: #[warn(clippy::redundant_field_names)] on by default

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thinggood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions