Skip to content

Fixed a minor typo. #10912

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

Closed
wants to merge 1 commit into from
Closed

Fixed a minor typo. #10912

wants to merge 1 commit into from

Conversation

DiamondLovesYou
Copy link
Contributor

No description provided.

@bors bors closed this Dec 13, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 30, 2023
handle exponent without digits in `numeric_literal`

Fixes rust-lang#10912

The numeric literal util module didn't check for exponents with no digits.
So:
https://github.com/rust-lang/rust-clippy/blob/384cf376120f09df7710d2ff39c986144a7b1517/clippy_utils/src/numeric_literal.rs#L163-L168

`exponent` here would be the empty string, which passed the `!= "0"` check (when it shouldn't have, it should probably be treated as if the user wrote `E0`), then later fails when counting the digits and subtracting one (0 - 1 = overflow).

Also, interestingly I can't even write a test for this because exponents with no digits is some kind of error by itself and `cargo dev fmt` fails on it.

changelog: [`unreadable_literal`]: don't (debug) ICE on numeric literal with empty exponent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants