Skip to content

Clippy contains about useless .into() in macro generated code #7845

Open
@LunaBorowska

Description

@LunaBorowska

Lint name: clippy::useless_conversion

Using rocket = "=0.5.0-rc.1" crate, I tried this code:

#[derive(rocket::FromForm)]
struct F {
    #[field(default = true)]
    f: bool,
}

fn main() {
    println!("Hello, world!");
}

I expected to see this happen: no warning about 'useless conversion to the same type: `bool`'

Instead, this happened:

warning: useless conversion to the same type: `bool`
 --> src/main.rs:3:23
  |
3 |     #[field(default = true)]
  |                       ^^^^ help: consider removing `.into()`: `true`
  |
  = note: `#[warn(clippy::useless_conversion)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Meta

Rust version (rustc -Vv):

rustc 1.55.0 (c8dfcfe04 2021-09-06)
binary: rustc
commit-hash: c8dfcfe046a7680554bf4eb612bad840e7631c4b
commit-date: 2021-09-06
host: x86_64-unknown-linux-gnu
release: 1.55.0
LLVM version: 12.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't have

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions