-
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
Refactor IntErrorKind to avoid "underflow" terminology #77640
Conversation
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.
Thanks for working on this @ethanboxx! I've left a few little comments.
Since we're making some changes to the shape of the ParseIntError
I think we should avoid stabilizing it just yet. Maybe give it a cycle or two with the new variants.
Co-authored-by: Ashley Mannix <[email protected]>
Co-authored-by: Ashley Mannix <[email protected]>
Co-authored-by: Ashley Mannix <[email protected]>
@KodrAus Thank you for your review. This should be ready now. |
Thanks @ethanboxx! This looks good to me. @bors r+ |
📌 Commit e750238 has been approved by |
int_error_matching
attempt 2…t_2, r=KodrAus Refactor IntErrorKind to avoid "underflow" terminology This PR is a continuation of rust-lang#76455 # Changes - `Overflow` renamed to `PosOverflow` and `Underflow` renamed to `NegOverflow` after discussion in rust-lang#76455 - Changed some of the parsing code to return `InvalidDigit` rather than `Empty` for strings "+" and "-". https://users.rust-lang.org/t/misleading-error-in-str-parse-for-int-types/49178 - Carry the problem `char` with the `InvalidDigit` variant. - Necessary changes were made to the compiler as it depends on `int_error_matching`. - Redid tests to match on specific errors. r? `@KodrAus`
…t_2, r=KodrAus Refactor IntErrorKind to avoid "underflow" terminology This PR is a continuation of rust-lang#76455 # Changes - `Overflow` renamed to `PosOverflow` and `Underflow` renamed to `NegOverflow` after discussion in rust-lang#76455 - Changed some of the parsing code to return `InvalidDigit` rather than `Empty` for strings "+" and "-". https://users.rust-lang.org/t/misleading-error-in-str-parse-for-int-types/49178 - Carry the problem `char` with the `InvalidDigit` variant. - Necessary changes were made to the compiler as it depends on `int_error_matching`. - Redid tests to match on specific errors. r? ``@KodrAus``
Rollup of 12 pull requests Successful merges: - rust-lang#77640 (Refactor IntErrorKind to avoid "underflow" terminology) - rust-lang#78026 (Define `fs::hard_link` to not follow symlinks.) - rust-lang#78114 (Recognize `private_intra_doc_links` as a lint) - rust-lang#78228 (Promote aarch64-unknown-linux-gnu to Tier 1) - rust-lang#78345 (Fix handling of item names for HIR) - rust-lang#78437 (BTreeMap: stop mistaking node for an orderly place) - rust-lang#78476 (fix some incorrect aliasing in the BTree) - rust-lang#78674 (inliner: Use substs_for_mir_body) - rust-lang#78748 (Implement destructuring assignment for tuples) - rust-lang#78868 (Fix tab focus on restyled switches) - rust-lang#78878 (Avoid overlapping cfg attributes when both macOS and aarch64) - rust-lang#78882 (Nicer hunk headers for rust files) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…yaahc stabilize `int_error_matching` closes rust-lang#22639 > It has been over half a year since rust-lang#77640 (review), and the indexing question is rejected in rust-lang#79728 (review), so I guess we can submit another stabilization attempt? 😉 _Originally posted by `@kennytm` in rust-lang#22639 (comment)
This PR is a continuation of #76455
Changes
Overflow
renamed toPosOverflow
andUnderflow
renamed toNegOverflow
after discussion in stabilizeint_error_matching
#76455InvalidDigit
rather thanEmpty
for strings "+" and "-". https://users.rust-lang.org/t/misleading-error-in-str-parse-for-int-types/49178char
with theInvalidDigit
variant.int_error_matching
.r? @KodrAus