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

Add .wrapping_offset() methods #37422

Merged
merged 2 commits into from
Nov 5, 2016
Merged

Add .wrapping_offset() methods #37422

merged 2 commits into from
Nov 5, 2016

Conversation

bluss
Copy link
Member

@bluss bluss commented Oct 26, 2016

.wrapping_offset() exposes the arith_offset intrinsic in the core
module (as methods on raw pointers, next to offset). This is the
first step in making it possible to stabilize the interface later.

arith_offset is a useful tool for developing iterators for two
reasons:

  1. arith_offset is used by the slice's iterator, the most important
    iterator in libcore, and it is natural that Rust users need the same
    power available to implement similar iterators.
  2. It is a good way to implement raw pointer iterations with step
    greater than one.

The name seems to fit the style of methods like "wrapping_add".

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@bluss bluss force-pushed the wrapping-offset branch 2 times, most recently from 2a3eb28 to ef591e5 Compare October 26, 2016 22:06
.wrapping_offset() exposes the arith_offset intrinsic in the core
module. This is the first step in making it possible to stabilize the
interface later.

`arith_offset` is a useful tool for developing iterators for two
reasons:

1. `arith_offset` is used by the slice's iterator, the most important
   iterator in libcore, and it is natural that Rust users need the same
   power available to implement similar iterators.
2. It is a good way to implement raw pointer iterations with step
   greater than one.

The name seems to fit the style of methods like "wrapping_add".
@alexcrichton alexcrichton added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Oct 27, 2016
@alexcrichton
Copy link
Member

Sounds great to me!

@rfcbot fcp merge

@rfcbot
Copy link

rfcbot commented Oct 27, 2016

Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged teams:

No concerns currently listed.

Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot
Copy link

rfcbot commented Nov 3, 2016

🔔 This is now entering its final comment period, as per the review above. 🔔

psst @alexcrichton, I wasn't able to add the final-comment-period label, please do so.

@alexcrichton
Copy link
Member

Ok! @bluss want to open a tracking issue for this and I'll r+?

@bluss
Copy link
Member Author

bluss commented Nov 3, 2016

Great! Tracking issue is #37570

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Nov 3, 2016

📌 Commit 67626e0 has been approved by alexcrichton

sophiajt pushed a commit to sophiajt/rust that referenced this pull request Nov 4, 2016
Add .wrapping_offset() methods

.wrapping_offset() exposes the arith_offset intrinsic in the core
module (as methods on raw pointers, next to offset). This is the
first step in making it possible to stabilize the interface later.

`arith_offset` is a useful tool for developing iterators for two
reasons:
1. `arith_offset` is used by the slice's iterator, the most important
   iterator in libcore, and it is natural that Rust users need the same
   power available to implement similar iterators.
2. It is a good way to implement raw pointer iterations with step
   greater than one.

The name seems to fit the style of methods like "wrapping_add".
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Nov 4, 2016
Add .wrapping_offset() methods

.wrapping_offset() exposes the arith_offset intrinsic in the core
module (as methods on raw pointers, next to offset). This is the
first step in making it possible to stabilize the interface later.

`arith_offset` is a useful tool for developing iterators for two
reasons:
1. `arith_offset` is used by the slice's iterator, the most important
   iterator in libcore, and it is natural that Rust users need the same
   power available to implement similar iterators.
2. It is a good way to implement raw pointer iterations with step
   greater than one.

The name seems to fit the style of methods like "wrapping_add".
@bors
Copy link
Contributor

bors commented Nov 5, 2016

⌛ Testing commit 67626e0 with merge e96b9d2...

bors added a commit that referenced this pull request Nov 5, 2016
Add .wrapping_offset() methods

.wrapping_offset() exposes the arith_offset intrinsic in the core
module (as methods on raw pointers, next to offset). This is the
first step in making it possible to stabilize the interface later.

`arith_offset` is a useful tool for developing iterators for two
reasons:
1. `arith_offset` is used by the slice's iterator, the most important
   iterator in libcore, and it is natural that Rust users need the same
   power available to implement similar iterators.
2. It is a good way to implement raw pointer iterations with step
   greater than one.

The name seems to fit the style of methods like "wrapping_add".
@bors bors merged commit 67626e0 into rust-lang:master Nov 5, 2016
bors added a commit that referenced this pull request Nov 5, 2016
@bluss bluss deleted the wrapping-offset branch November 5, 2016 09:30
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Nov 5, 2016
Add .wrapping_offset() methods

.wrapping_offset() exposes the arith_offset intrinsic in the core
module (as methods on raw pointers, next to offset). This is the
first step in making it possible to stabilize the interface later.

`arith_offset` is a useful tool for developing iterators for two
reasons:
1. `arith_offset` is used by the slice's iterator, the most important
   iterator in libcore, and it is natural that Rust users need the same
   power available to implement similar iterators.
2. It is a good way to implement raw pointer iterations with step
   greater than one.

The name seems to fit the style of methods like "wrapping_add".
bors added a commit that referenced this pull request Nov 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API 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