Skip to content

Conversation

@Wilfred
Copy link
Contributor

@Wilfred Wilfred commented Nov 14, 2025

mod is a keyword in Rust, and since we're talking about remainders we should be using division syntax here.

@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, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 14, 2025

r? @joboet

rustbot has assigned @joboet.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

}

/// Calculates the least nonnegative remainder of `self (mod rhs)`.
/// Calculates the least nonnegative remainder of `self / rhs`.
Copy link
Member

Choose a reason for hiding this comment

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

After doing the division (which this syntax suggests), there is no possibility of finding the remainder anymore, but perhaps you meant something like the following:

Suggested change
/// Calculates the least nonnegative remainder of `self / rhs`.
/// Calculates the least nonnegative remainder of `self` when divided by `rhs`.

`mod` is a keyword in Rust, and since we're talking about remainders
we should be using division syntax here.
@rustbot
Copy link
Collaborator

rustbot commented Nov 16, 2025

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@joboet
Copy link
Member

joboet commented Dec 5, 2025

r? libs

Sorry for taking so long to reply. I agree about rephrasing this. I'm not entirely sure whether the suggested fix is correct – is "when" really the right conjunction? I'm not a native English speaker, so I'll reassign this...

@rustbot rustbot assigned Mark-Simulacrum and unassigned joboet Dec 5, 2025
@Wilfred
Copy link
Contributor Author

Wilfred commented Dec 5, 2025

FWIW I'm a native speaker and I think it reads fine, but I'm happy to change further. I just found the usage of mod with backticks confusing.

@Mark-Simulacrum
Copy link
Member

@bors r+

I think the old version was "fine", but I'm relatively familiar with seeing that notation so it doesn't seem surprising to me. I think the new version is likely an improvement, so approving.

@bors
Copy link
Collaborator

bors commented Dec 8, 2025

📌 Commit 95b5bba has been approved by Mark-Simulacrum

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 Dec 8, 2025
bors added a commit that referenced this pull request Dec 8, 2025
Rollup of 8 pull requests

Successful merges:

 - #148935 (Fix division syntax in doc comments)
 - #149207 (Add `ilog10` result range hints)
 - #149676 (Tidying up tests/ui/issues tests [3/N])
 - #149710 (Move ambient gdb discovery from compiletest to bootstrap)
 - #149714 (Check associated type where-clauses for lifetimes)
 - #149722 (contracts: fix lowering final declaration without trailing semicolon)
 - #149736 (contracts: clean up feature flag warning duplicated across tests)
 - #149739 (mailmap: add binarycat)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 80b4c44 into rust-lang:main Dec 8, 2025
11 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 8, 2025
rust-timer added a commit that referenced this pull request Dec 8, 2025
Rollup merge of #148935 - Wilfred:fix_remainder_docs, r=Mark-Simulacrum

Fix division syntax in doc comments

`mod` is a keyword in Rust, and since we're talking about remainders we should be using division syntax here.
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.

6 participants