-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Lint default numeric type fallback #6064
Comments
It could be helpful to know when under-constrained inference has used a default numeric type, and I agree that pedantic makes sense for the category. Users who want this lint can optionally enable it, while minimizing friction with users that enjoy the current
For an example outside of Rust, Glasgow Haskell Compiler (GHC) has
|
I would rather categorize this lint as |
Ah right, |
Can I take this issue if no one working on it? |
I would clearly put this as warning, specially for integer. It's very strange that the lint suggest to use |
What it does
Lint any integer or floating point constants that have their type determined by the default fallback rather than inference
Categories (optional)
What is the advantage of the recommended code over the original code
Avoids unintended use of the numeric default types, forcing the author to think about what type is appropriate.
Drawbacks
Forcing the author to think about what type is appropriate.
Example
Could be written as:
The text was updated successfully, but these errors were encountered: