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 overflow checking for str::get with inclusive ranges #42428

Merged
merged 2 commits into from
Jun 14, 2017

Conversation

scottmcm
Copy link
Member

@scottmcm scottmcm commented Jun 4, 2017

Fixes #42401

Two commits here:

  1. The first makes str::index just call SliceIndex<str>::index. It's intended to have no behavior change, except where the two methods were inconsistent.
  2. The second actually adds the overflow checking to get(_mut) (and tests for it)

Move any extra logic that the former had into the latter, so they're consistent.
@rust-highfive
Copy link
Collaborator

r? @aturon

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

@carols10cents carols10cents added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 5, 2017
@arielb1
Copy link
Contributor

arielb1 commented Jun 6, 2017

Thanks for the PR @scottmcm! @aturon (or someone else) should be reviewing your PR soon.

@carols10cents
Copy link
Member

Aturon's on vacation this week, sorry this fell through the cracks last week! Let's try...

r? @nikomatsakis

@rust-highfive rust-highfive assigned nikomatsakis and unassigned aturon Jun 12, 2017
@arielb1
Copy link
Contributor

arielb1 commented Jun 12, 2017

Let's keep this in the libs team

r? @sfackler

@arielb1 arielb1 assigned sfackler and unassigned nikomatsakis Jun 12, 2017
@sfackler
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jun 13, 2017

📌 Commit 808a08a has been approved by sfackler

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Jun 13, 2017
Add overflow checking for `str::get` with inclusive ranges

Fixes rust-lang#42401

Two commits here:

1. The first makes `str::index` just call `SliceIndex<str>::index`.  It's intended to have no behavior change, except where the two methods were inconsistent.
2. The second actually adds the overflow checking to `get(_mut)` (and tests for it)
bors added a commit that referenced this pull request Jun 14, 2017
Rollup of 6 pull requests

- Successful merges: #42408, #42428, #42496, #42597, #42636, #42638
- Failed merges: #42612
@bors
Copy link
Contributor

bors commented Jun 14, 2017

⌛ Testing commit 808a08a with merge e40ef96...

@bors bors merged commit 808a08a into rust-lang:master Jun 14, 2017
@scottmcm scottmcm deleted the str-get-overflow branch June 21, 2017 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants