-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Fix two small issues in compiler/rustc_lint/src/types.rs #78155
Conversation
In this instance, we can just pass a &str slice and save an allocation.
.into() guarantees safety of the conversion. Furthermore, the minimum value of all uints is known to be 0.
r? @davidtwco (rust_highfive has picked a reviewer for you, use r? to override) |
Re the second commit, actually it's me who made this code so weird, back in #38482 . Maybe there was a reason for it, e.g. i128 wasn't able to be casted to directly. But nowadays this is supported, and i128 support is available on stable so that shouldn't be a concern any more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@bors r+ |
📌 Commit 00d23cf has been approved by |
Rollup of 10 pull requests Successful merges: - rust-lang#77420 (Unify const-checking structured errors for `&mut` and `&raw mut`) - rust-lang#77554 (Support signed integers and `char` in v0 mangling) - rust-lang#77976 (Mark inout asm! operands as used in liveness pass) - rust-lang#78009 (Haiku: explicitly set CMAKE_SYSTEM_NAME when cross-compiling) - rust-lang#78084 (Greatly improve display for small mobile devices screens) - rust-lang#78155 (Fix two small issues in compiler/rustc_lint/src/types.rs) - rust-lang#78156 (Fixed build failure of `rustfmt`) - rust-lang#78172 (Add test case for rust-lang#77062) - rust-lang#78188 (Add tracking issue number for pin_static_ref) - rust-lang#78200 (Add `ControlFlow::is_{break,continue}` methods) Failed merges: r? `@ghost`
Two small improvements of
compiler/rustc_lint/src/types.rs