[ER] Propose the use of XX::MAX instead of -1 for unsigned integers #77416
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Another of those little enhancement suggestions. This code:
With rustc 1.48.0-nightly gives this error message:
I suggest to modify the note, to suggest that u32::MAX may be desired instead, because in C code often you see people use -1 to get the max unsigned value.
The text was updated successfully, but these errors were encountered: