10BC0 Add suggestion to `cast_sign_loss` and `cast_possible_wrap` using the `cast_{un,}signed()` methods by RunDevelopment · Pull Request #15384 · rust-lang/rust-clippy · GitHub
[go: up one dir, main page]

Skip to content

Conversation

RunDevelopment
Copy link
Contributor
@RunDevelopment RunDevelopment commented Aug 1, 2025

changelog: [cast_sign_loss, cast_possible_wrap]: add suggestion using cast_{un,}signed() methods

Fixes #14150

This PR adds a suggestion to cast_sign_loss and cast_possible_wrap, which fixes reported warnings using the cast_{un,}signed() methods, as proposed in #14150. Suggestions are only made if MSRV is >=1.87.

Also, I'm not 100% sure about the suggestion message yet. I'm open for suggestions.

@rustbot
Copy link
Collaborator
rustbot commented Aug 1, 2025

r? @Jarcho

rustbot has assigned @Jarcho.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 1, 2025
Copy link
github-actions bot commented Aug 1, 2025

Lintcheck changes for 4e286bb

Lint Added Removed Changed
clippy::cast_possible_wrap 0 0 253
clippy::cast_sign_loss 0 0 294

This comment will be updated if you push new changes

@samueltardieu
Copy link
Member

You should also include a test with a MSRV of 1.86 to ensure the suggestions are not emitted.

@samueltardieu samueltardieu added the C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages label Aug 2, 2025
@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Aug 3, 2025
@rustbot rustbot removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) has-merge-commits PR has merge commits, merge with caution. labels Aug 3, 2025
@RunDevelopment
Copy link
Contributor Author

I applied all suggestions from the review. Hope this is good now.

@RunDevelopment RunDevelopment requested a review from Jarcho August 14, 2025 13:33
@Rua
Copy link
Contributor
Rua commented Sep 11, 2025

Does anything need to be done here?

Copy link
Contributor
@Jarcho Jarcho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jarcho Jarcho added this pull request to the merge queue Sep 11, 2025
Merged via the queue into rust-lang:master with commit c057abd Sep 11, 2025
11 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 11, 2025
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Propose fix for cast_sign_loss and cast_possible_wrap
5 participants
0