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

Out-of-range float literals are not checked by type-limits lint #10934

Closed
huonw opened this issue Dec 12, 2013 · 2 comments
Closed

Out-of-range float literals are not checked by type-limits lint #10934

huonw opened this issue Dec 12, 2013 · 2 comments
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut.

Comments

@huonw
Copy link
Member

huonw commented Dec 12, 2013

e.g.

fn main() { println!("{} {}", 1e310, 1e-360 == 0.0); } // prints `inf true`.
@hirschenberger
Copy link
Contributor

I worked on this but unforunately rust's from_str_bytes_common which I have to use for parsing the string representation of ast::LitFloat fails parsing f32::MAX_VALUE and friends.
See #14353 for the issue.

@alexcrichton
Copy link
Member

Closed by #14519, thanks @hirschenberger!

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 30, 2023
…iraffate

new lint [`single_range_in_vec_init`]

Lints on `vec![0..200]` (or `[0..200]`), suggesting either `(0..200).collect::<Vec<i32>>()` or `[0; 200]`.

Haven't tested it with anything that isn't primitive. Probably should!

Closes rust-lang#10932

changelog: new lint [`single_range_in_vec_init`]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut.
Projects
None yet
Development

No branches or pull requests

3 participants