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

[docs] pointer::wrapping_sub has typo #81109

Closed
Lokathor opened this issue Jan 17, 2021 · 4 comments · Fixed by #81186
Closed

[docs] pointer::wrapping_sub has typo #81109

Lokathor opened this issue Jan 17, 2021 · 4 comments · Fixed by #81186
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@Lokathor
Copy link
Contributor

The docs for pointer::wrapping_sub say

Calculates the offset from a pointer using wrapping arithmetic. (convenience for .wrapping_offset((count as isize).wrapping_sub()))

but they should say .wrapping_neg() instead

@jyn514
Copy link
Member

jyn514 commented Jan 17, 2021

@Lokathor are you interested in making a PR to fix it?

@Lokathor
Copy link
Contributor Author

Josh you know I don't ever dare PR to rust-lang/rust ;3

@camelid camelid added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. labels Jan 18, 2021
@soniasingla
Copy link
Contributor

@jyn514 can i take this bug? :)

@jyn514
Copy link
Member

jyn514 commented Jan 18, 2021

Go for it! The docs for this will be somewhere in library/, you can find them by hitting [src] in the docs. There are instructions for building at rustc-dev-guide.rust-lang.org/, the main command is x.py doc library/std.

m-ou-se added a commit to m-ou-se/rust that referenced this issue Jan 18, 2021
…evink

Fixes rust-lang#81109 - Typo in pointer::wrapping_sub

Signed-off-by: soniasingla <[email protected]>

Related to issue rust-lang#81109
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jan 19, 2021
…evink

Fixes rust-lang#81109 - Typo in pointer::wrapping_sub

Signed-off-by: soniasingla <[email protected]>

Related to issue rust-lang#81109
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 19, 2021
…laumeGomez

Rollup of 8 pull requests

Successful merges:

 - rust-lang#80382 (Improve search result tab handling)
 - rust-lang#81112 (Remove unused alloc::std::ops re-export.)
 - rust-lang#81115 (BTreeMap: prefer bulk_steal functions over specialized ones)
 - rust-lang#81147 (Fix structured suggestion for explicit `drop` call)
 - rust-lang#81161 (Remove inline script tags)
 - rust-lang#81164 (Fix typo in simplify.rs)
 - rust-lang#81166 (remove some outdated comments regarding  debug assertions)
 - rust-lang#81168 (Fixes rust-lang#81109 - Typo in pointer::wrapping_sub)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors closed this as completed in 47c2476 Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants