Skip to content

Silecing warnings in struct fields does not work for useless_conversion #5683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
eduardosm opened this issue Jun 4, 2020 · 2 comments
Closed
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages E-medium Call for participation: Medium difficulty level problem and requires some initial experience.

Comments

@eduardosm
Copy link

eduardosm commented Jun 4, 2020

Using #[allow()] in struct fields does not work for useless_conversion.

Can be checked on playground:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=5e438df7bcd3708184a12bc737fe4965

This happens on stable, beta, and nightly.

@flip1995 flip1995 changed the title Silecing warnings in struct fields does not work Silecing warnings in struct fields does not work for useless_conversion Jun 4, 2020
@flip1995
Copy link
Member

flip1995 commented Jun 4, 2020

S {
    #[allow(clippy::useless_conversion)]
    x: value.into()
}

@flip1995 flip1995 added E-medium Call for participation: Medium difficulty level problem and requires some initial experience. C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages labels Jun 4, 2020
@ebroto
Copy link
Member

ebroto commented Jun 4, 2020

I think this is rust-lang/rust#60681

@flip1995 flip1995 closed this as completed Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages E-medium Call for participation: Medium difficulty level problem and requires some initial experience.
Projects
None yet
Development

No branches or pull requests

3 participants