Skip to content
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

".e0".parse() returns Ok(0.0) #40654

Closed
lifthrasiir opened this issue Mar 19, 2017 · 2 comments
Closed

".e0".parse() returns Ok(0.0) #40654

lifthrasiir opened this issue Mar 19, 2017 · 2 comments
Labels
C-bug Category: This is a bug. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@lifthrasiir
Copy link
Contributor

Yes, another incarnation of #30344. +.e0 and -.e0 also have this issue. Note that ".".parse() is an error and has a test for it.

cc #32243

@hanna-kruppe
Copy link
Contributor

Does this also date back to 1.0, like #30344 did?

@lifthrasiir
Copy link
Contributor Author

@rkruppe Yes. The fix would be technically a breaking change.

@steveklabnik steveklabnik added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed A-libs labels Mar 20, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 27, 2017
kennytm added a commit to kennytm/rust that referenced this issue Feb 25, 2018
… r=alexcrichton

Make ".e0" not parse as 0.0

This forces floats to have either a digit before the separating point, or after. Thus `".e0"` is invalid like `"."`, when using `parse()`. Fixes rust-lang#40654. As mentioned in the issue, this is technically a breaking change... but clearly incorrect behaviour at present.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants