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

Fix doc example for wrapping_abs #104420

Merged
merged 2 commits into from
Nov 21, 2022
Merged

Fix doc example for wrapping_abs #104420

merged 2 commits into from
Nov 21, 2022

Conversation

TethysSvensson
Copy link
Contributor

The max variable is unused. This change introduces the min_plus variable, to make the example similar to the one from saturating_abs. An alternative would be to remove the unused variable.

The `max` variable is unused. This change introduces the `min_plus`
variable, to make the example similar to the one from `saturating_abs`.
An alternative would be to remove the unused variable.
@rustbot
Copy link
Collaborator

rustbot commented Nov 14, 2022

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 14, 2022
@rustbot
Copy link
Collaborator

rustbot commented Nov 14, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@JohnTitor
Copy link
Member

Looking at https://doc.rust-lang.org/nightly/core/primitive.i8.html#method.wrapping_abs and https://doc.rust-lang.org/nightly/core/primitive.i8.html#method.saturating_abs, we could say min_plus is for saturating_abs. To keep consistency between primitive signed integers and non-zero ones, I'd prefer to hide MAX until the below FIXME is resolved.

@TethysSvensson
Copy link
Contributor Author

@JohnTitor Like this?

@JohnTitor
Copy link
Member

Yeah, thank you :)
@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 21, 2022

📌 Commit 00bf999 has been approved by JohnTitor

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 21, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 21, 2022
Fix doc example for `wrapping_abs`

The `max` variable is unused. This change introduces the `min_plus` variable, to make the example similar to the one from `saturating_abs`. An alternative would be to remove the unused variable.
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 21, 2022
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#104420 (Fix doc example for `wrapping_abs`)
 - rust-lang#104499 (rustdoc JSON: Use `Function` everywhere and remove `Method`)
 - rust-lang#104500 (`rustc_ast`: remove `ref` patterns)
 - rust-lang#104511 (Mark functions created for `raw-dylib` on x86 with DllImport storage class)
 - rust-lang#104595 (Add `PolyExistentialPredicate` type alias)
 - rust-lang#104605 (deduplicate constant evaluation in cranelift backend)
 - rust-lang#104628 (Revert "Update CI to use Android NDK r25b")
 - rust-lang#104662 (Streamline deriving on packed structs.)
 - rust-lang#104667 (Revert formatting changes of a test)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 369e449 into rust-lang:master Nov 21, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants