-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Bounds checking for float literals #2252
Comments
How exactly can I implement this in the parser? LIT_FLOAT takes an ident, so would I make LIT_FLOAT take an f64 and then parse it using f32:: for explicitly marked f32 suffixes and f64:: for f64 suffixes and then raise an error if there is an error parsing them? Where/how is this handled for ints? |
This is still not implemented. |
De-milestoning, we agreed it's not a major concern. |
cc me |
Triage, no change. |
Unmarking as easy. Correct string floatification isn't trivial, and Rust doesn't have anything for it today. |
Today, we have
So seems good! |
Format tests with rustfmt (225-275 of 300) Extracted from rust-lang#2097. These cases all involve a line comment at the end of a block that rustfmt has chosen to wrap. ```diff - unsafe { (*ptr).set(20); } //~ ERROR does not exist in the borrow stack + unsafe { + (*ptr).set(20); + } //~ ERROR does not exist in the borrow stack ``` I have moved all of those comments back onto the same line as the content of the block instead, as was indicated being `@RalfJung's` preference in rust-lang/miri#2097 (comment). ```diff + unsafe { + (*ptr).set(20); //~ ERROR does not exist in the borrow stack + } ```
Add note for perf issue
As per a FIXME in syntax::parse::lexer, check (maybe in the parser, definitely somewhere earlier than trans) that 32-bit and 64-bit floating-point literals are in the right range.
The text was updated successfully, but these errors were encountered: