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

Improve some comments for non-zero ops #118313

Merged

Conversation

WaffleLapkin
Copy link
Member

This makes them a bit more explicit/correct.

@rustbot
Copy link
Collaborator

rustbot commented Nov 26, 2023

r? @thomcc

(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 26, 2023
@WaffleLapkin
Copy link
Member Author

@bors rollup

@thomcc
Copy link
Member

thomcc commented Nov 27, 2023

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Nov 27, 2023

📌 Commit c860ba1 has been approved by thomcc

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 27, 2023
@bors
Copy link
Collaborator

bors commented Nov 27, 2023

⌛ Testing commit c860ba1 with merge 601a427...

@bors
Copy link
Collaborator

bors commented Nov 27, 2023

☀️ Test successful - checks-actions
Approved by: thomcc
Pushing 601a427 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 27, 2023
@bors bors merged commit 601a427 into rust-lang:master Nov 27, 2023
@rustbot rustbot added this to the 1.76.0 milestone Nov 27, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (601a427): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.6% [-3.6%, -3.6%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 674.035s -> 674.674s (0.09%)
Artifact size: 313.34 MiB -> 313.34 MiB (0.00%)

@WaffleLapkin WaffleLapkin deleted the fixup_comments_in_some_nonzero_ops branch November 27, 2023 18:00
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 28, 2023
Fix comments for unsigned non-zero `checked_add`, `saturating_add`

While looking at rust-lang#118313, I happened to notice that two of the expanded comments appear to be slightly inaccurate.

For these two methods, `other` is an ordinary unsigned integer, so it can be zero.

Since the sum of non-zero and zero is always non-zero, the safety argument holds even when `other` is zero.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 28, 2023
Rollup merge of rust-lang#118397 - Zalathar:nonzero, r=WaffleLapkin

Fix comments for unsigned non-zero `checked_add`, `saturating_add`

While looking at rust-lang#118313, I happened to notice that two of the expanded comments appear to be slightly inaccurate.

For these two methods, `other` is an ordinary unsigned integer, so it can be zero.

Since the sum of non-zero and zero is always non-zero, the safety argument holds even when `other` is zero.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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