Skip to content
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

cast-lossless is too strict #4528

Closed
nrc opened this issue Sep 9, 2019 · 1 comment · Fixed by #4539
Closed

cast-lossless is too strict #4528

nrc opened this issue Sep 9, 2019 · 1 comment · Fixed by #4539
Labels
good-first-issue These issues are a good way to get started with Clippy

Comments

@nrc
Copy link
Member

nrc commented Sep 9, 2019

cast-lossless includes issuing a warning about what might happen if you change your code: warning: casting u8 to i32 may become silently lossy if you later change the type. Given that the cast is totally safe with the code as written, this seems like it should be a pedantic lint, rather than a default one.

@flip1995 flip1995 added the good-first-issue These issues are a good way to get started with Clippy label Sep 10, 2019
@flip1995
Copy link
Member

I agree. Especially because all the other "cast on number to another"-lints are allow-by-default.

flip1995 added a commit to flip1995/rust-clippy that referenced this issue Sep 19, 2019
…lip1995

Changes cast-lossless to a pedantic lint

As discussed in rust-lang#4528, this moves the cast-lossless lint from `all` to `pedantic`.

I couldn't tell from description alone if it should also be removed from the complexity category, so I left it as part of complexity for now. I didn't see any impact to the tests from this change, but I could be wrong (as this is my first PR).

fixes rust-lang#4528

changelog: Moves cast-lossless from default to checking only as a `pedantic` lint.
flip1995 added a commit to flip1995/rust-clippy that referenced this issue Sep 19, 2019
…lip1995

Changes cast-lossless to a pedantic lint

As discussed in rust-lang#4528, this moves the cast-lossless lint from `all` to `pedantic`.

I couldn't tell from description alone if it should also be removed from the complexity category, so I left it as part of complexity for now. I didn't see any impact to the tests from this change, but I could be wrong (as this is my first PR).

fixes rust-lang#4528

changelog: Moves cast-lossless from default to checking only as a `pedantic` lint.
bors added a commit that referenced this issue Sep 19, 2019
Changes cast-lossless to a pedantic lint

As discussed in #4528, this moves the cast-lossless lint from `all` to `pedantic`.

I couldn't tell from description alone if it should also be removed from the complexity category, so I left it as part of complexity for now. I didn't see any impact to the tests from this change, but I could be wrong (as this is my first PR).

fixes #4528

changelog: Moves cast-lossless from default to checking only as a `pedantic` lint.
@bors bors closed this as completed in 6f1f413 Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue These issues are a good way to get started with Clippy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants