-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Use assoc int and float consts instead of module level ones #5429
Conversation
346c7d7
to
7f1405a
Compare
The failing CI runs are due to a bug in GHA, so don't mind them |
@faern Do you want to update more constants in this PR or do this in later PRs? I'm good with both. |
So I'd rather have this merged and move on to the other stuff. If that's fine with you. Either way I'm done coding for today so anything else will have to come another day. |
Alright, waiting for GHA to get fixed. |
I'll see if I can make some more of my dirty working directory into commits that suit in this PR. Starting with these two extra commits. Let's see if CI likes them. I can't run the tests locally. Or any help with how to even do that would be appreciated. Any update on the GHA status? |
f1f9db7
to
1647f53
Compare
Sweet. It passes! Now everything I had laying around is pushed to this PR. So it ended up being one large PR with all my changes anyway after all. Hopefully these can be merged before the PR starts experiencing bit rot. |
Thanks! Prioritizing this PR before the big rollup. @bors r+ p=10 |
📌 Commit 1647f53 has been approved by |
🌲 The tree is currently closed for pull requests below priority 2, this pull request will be tested once the tree is reopened |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
changelog: Recommend primitive type associated constants instead of module level constants
In Rust 1.43 integer and float primitive types will have a number of new associated constants. For example
MAX
,MIN
and a number of constants related to the machine representation of floats. rust-lang/rust#68952These new constants are preferred over the module level constants in
{core,std}::{f*, u*, i*}
. I have in the last few days made sure that the documentation in the main rust repository uses the new constants in every place I could find (rust-lang/rust#69860, rust-lang/rust#70782). So the next step is naturally to make the linter recommend the new constants as well.This PR only changes two lints. There are more. But I did not want the PR to be too big. And since I have not contributed to clippy before it felt saner to start with a small PR so I see if there are any quirks. More will come later.