Skip to content

Conversation

@TanmayArya-1p
Copy link

@TanmayArya-1p TanmayArya-1p commented Feb 2, 2026

Closes #14469

changelog: [cast_lossless]: new lints on char to uint casts (u32/u64/u128), small ints (<=16 bits) to usize/isize and smaller floats to f128(if available). Also improves macro handling.

…`char` and improve macro handling

Also emit lints for f16->f128 conversions, uints->usize/isize conversions
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 2, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 2, 2026

r? @samueltardieu

rustbot has assigned @samueltardieu.
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

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Lintcheck changes for b9024f3

Lint Added Removed Changed
clippy::cast_lossless 533 0 154

This comment will be updated if you push new changes

@TanmayArya-1p
Copy link
Author

I have tried to address the issues pointed out in #14470. Particularly, I've implemented @Jarcho's suggestion using walk_span_to_context for proper macro hygiene check. Also, the type checking logic is derived from this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cast_lossless not triggered by char as u32

3 participants