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

Note rotate_{left,right} in wrapping_sh{lr} docs #31535

Merged
merged 1 commit into from
Feb 14, 2016
Merged

Note rotate_{left,right} in wrapping_sh{lr} docs #31535

merged 1 commit into from
Feb 14, 2016

Conversation

ketsuban
Copy link
Contributor

wrapping_shl and wrapping_shr are easy to mistake for rotations, when in fact they work somewhat differently. The documentation currently available is a little sparse and easy to misinterpret, so I've added a warning to anyone who bumps into them that the equivalent rotate methods may actually be what they're looking for.

If it's deemed useful to add a symmetrical mention to the documentation for the rotate_left and rotate_right methods, I can certainly have a go at that, but my gut feeling is that people likely to want a rotate will already know about the wrapping-arithmetic methods, for example from writing CPU simulators.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@ollie27
Copy link
Member

ollie27 commented Feb 10, 2016

It might also be a good idea to also add or change the examples for these functions to ones that actually behave differently to rotate.

@ketsuban
Copy link
Contributor Author

Good point, since I was in the middle of writing “they already do” when I thought to check in the playground. That definitely contributes to the confusion.

@steveklabnik
Copy link
Member

@bors: r+ rollup

Thanks! Additional examples would be good too, but even just this is an improvement so far.

@bors
Copy link
Contributor

bors commented Feb 10, 2016

📌 Commit 8d5dcf9 has been approved by steveklabnik

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Feb 13, 2016
…ift-documentation, r=steveklabnik

`wrapping_shl` and `wrapping_shr` are easy to mistake for rotations, when in fact they work somewhat differently. The documentation currently available is a little sparse and easy to misinterpret, so I've added a warning to anyone who bumps into them that the equivalent rotate methods may actually be what they're looking for.

If it's deemed useful to add a symmetrical mention to the documentation for the `rotate_left` and `rotate_right` methods, I can certainly have a go at that, but my gut feeling is that people likely to want a rotate will already know about the wrapping-arithmetic methods, for example from writing CPU simulators.
Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 13, 2016
…ift-documentation, r=steveklabnik

`wrapping_shl` and `wrapping_shr` are easy to mistake for rotations, when in fact they work somewhat differently. The documentation currently available is a little sparse and easy to misinterpret, so I've added a warning to anyone who bumps into them that the equivalent rotate methods may actually be what they're looking for.

If it's deemed useful to add a symmetrical mention to the documentation for the `rotate_left` and `rotate_right` methods, I can certainly have a go at that, but my gut feeling is that people likely to want a rotate will already know about the wrapping-arithmetic methods, for example from writing CPU simulators.
bors added a commit that referenced this pull request Feb 13, 2016
@bors bors merged commit 8d5dcf9 into rust-lang:master Feb 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants