-
Notifications
You must be signed in to change notification settings - Fork 13k
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
If an integer is entered with an upper-case base prefix (0Xbeef, 0O755, 0B1010), suggest to make it lowercase #93019
Conversation
r? @wesleywiser (rust-highfive has picked a reviewer for you, use r? to override) |
This is really nice! I think the main thing we need are some UI tests to cover these cases. Let me know if you need any help with that! 🙂 |
Thanks! I mainly made this now so I can't then forget about it. I've left PRs in progress for Far Too Long a few times. I'll make the wording changes you suggested, then add tests for it, and then it should be good to go. I was debating if I should only make this suggestion if the resulting literal would parse, but will probably decide against that for two reasons
|
d15d689
to
7f24778
Compare
This comment has been minimized.
This comment has been minimized.
UI tests here don't work and it's too late in the night for me to work out why the note is considered expected, lol. Will look at the error annotation syntax some more and hopefully get this done over the weekend. |
This comment has been minimized.
This comment has been minimized.
50e7adb
to
fa38c42
Compare
Okay, bikeshed the error messages with some people and came up with this. Marking this as ready to review because I'm happy with the diagnostic as-is. One difference between current and previous is that the previous diagnostic included the actual number in the |
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.
This looks great to me! I'd just like to see the test expanded for the cases I mentioned before we merge.
fa38c42
to
ec3b711
Compare
Thanks! @bors r+ rollup |
📌 Commit ec3b711 has been approved by |
…iser If an integer is entered with an upper-case base prefix (0Xbeef, 0O755, 0B1010), suggest to make it lowercase The current error for this case isn't really great, it just complains about the whole thing past the `0` being an invalid suffix.
Rollup of 9 pull requests Successful merges: - rust-lang#91343 (Fix suggestion to slice if scrutinee is a `Result` or `Option`) - rust-lang#93019 (If an integer is entered with an upper-case base prefix (0Xbeef, 0O755, 0B1010), suggest to make it lowercase) - rust-lang#93090 (`impl Display for io::ErrorKind`) - rust-lang#93456 (Remove an unnecessary transmute from opaque::Encoder) - rust-lang#93492 (Hide failed command unless in verbose mode) - rust-lang#93504 (kmc-solid: Increase the default stack size) - rust-lang#93513 (Allow any pretty printed line to have at least 60 chars) - rust-lang#93532 (Update books) - rust-lang#93533 (Update cargo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
The current error for this case isn't really great, it just complains about the whole thing past the
0
being an invalid suffix.