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

Use primitive type associated constants #848

Merged
merged 3 commits into from
Apr 4, 2020

Conversation

faern
Copy link
Contributor

@faern faern commented Apr 4, 2020

Using the primitive type associated constants throughout stdarch

  • Stop importing std::<int/float type> since those constants are now available on the primitive types directly.
  • Search and replace all instances of min_value() with MIN and max_value() with MAX.
  • Remove std:: from all std::<int/float type>::MIN/MAX usage.

If reviewing seems too daunting or the usage of min_value and max_value does not seem that bad, I can remove that specific commit since it's most of the lines. The other two commits should at least stop using the std modules, which is a good step in the right direction and would entail far fewer changes.

r? @dtolnay

Copy link
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT all of the changes are correct.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dtolnay dtolnay merged commit 1a577bd into rust-lang:master Apr 4, 2020
@faern faern deleted the assoc-int-consts2 branch April 6, 2020 00:16
Centril added a commit to Centril/rust that referenced this pull request Apr 7, 2020
…tolnay

Use assoc int submodules

Bumping some submodules to the commits their masters currently point at. The main point of this is to get the associated integer/float constant documentation updates that were recently merged to them:

* rust-lang/nomicon#207
* rust-lang/rust-by-example#1327
* rust-lang/stdarch#848

But for some, a few more changes slipped by that happened to be in the master branch of these submodules.

r? @dtolnay
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 7, 2020
…tolnay

Use assoc int submodules

Bumping some submodules to the commits their masters currently point at. The main point of this is to get the associated integer/float constant documentation updates that were recently merged to them:

* rust-lang/nomicon#207
* rust-lang/rust-by-example#1327
* rust-lang/stdarch#848

But for some, a few more changes slipped by that happened to be in the master branch of these submodules.

r? @dtolnay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants