-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Fix division syntax in doc comments #148935
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
Conversation
library/core/src/num/f128.rs
Outdated
| } | ||
|
|
||
| /// Calculates the least nonnegative remainder of `self (mod rhs)`. | ||
| /// Calculates the least nonnegative remainder of `self / rhs`. |
There was a problem hiding this comment.
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:
| /// 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.
3d15223 to
95b5bba
Compare
|
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. |
|
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... |
|
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. |
|
@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. |
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
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.
modis a keyword in Rust, and since we're talking about remainders we should be using division syntax here.