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

stabilize RangeBounds collections_range #30877 #51033

Merged
merged 2 commits into from
May 26, 2018
Merged

Conversation

coryshrmn
Copy link
Contributor

@coryshrmn coryshrmn commented May 24, 2018

The FCP for #30877 closed last month, with the decision to:

  1. move from collections::range::RangeArgument to ops::RangeBounds, and
  2. rename start() and end() to start_bounds() and end_bounds().

Simon Sapin already moved it to ops::RangeBounds in #49163.

I renamed the functions, and removed the old collections::range::RangeArgument alias.

This is my first Rust PR, please let me know if I can improve anything. This passes all tests for me, except the clippy tool (which uses RangeArgument::start()).

I considered deprecating start() and end() instead of removing them, but the contribution guidelines indicate we can break clippy temporarily. I thought it was best to remove the functions, since we're worried about name collisions with Range::start and end.

Closes #30877.

coryshrmn added 2 commits May 24, 2018 05:01
rename RangeBounds::start() -> start_bound()
rename RangeBounds::end() -> end_bound()
was already moved to ops::RangeBounds (see rust-lang#30877)
@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 @bluss (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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 24, 2018
@oli-obk oli-obk added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label May 24, 2018
@coryshrmn
Copy link
Contributor Author

r? @dtolnay

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic, thank you!

@dtolnay dtolnay added the relnotes Marks issues that should be documented in the release notes of the next release. label May 25, 2018
@dtolnay
Copy link
Member

dtolnay commented May 25, 2018

@bors r+

@bors
Copy link
Contributor

bors commented May 25, 2018

📌 Commit f7c4a33 has been approved by dtolnay

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 25, 2018
@bors
Copy link
Contributor

bors commented May 25, 2018

⌛ Testing commit f7c4a33 with merge 07c415c...

bors added a commit that referenced this pull request May 25, 2018
stabilize RangeBounds collections_range #30877

The FCP for #30877 closed last month, with the decision to:
1. move from `collections::range::RangeArgument` to `ops::RangeBounds`, and
2. rename `start()` and `end()` to `start_bounds()` and `end_bounds()`.

Simon Sapin already moved it to `ops::RangeBounds` in #49163.

I renamed the functions, and removed the old `collections::range::RangeArgument` alias.

This is my first Rust PR, please let me know if I can improve anything. This passes all tests for me, except the `clippy` tool (which uses `RangeArgument::start()`).

I considered deprecating `start()` and `end()` instead of removing them, but the contribution guidelines indicate we can break `clippy` temporarily. I thought it was best to remove the functions, since we're worried about name collisions with `Range::start` and `end`.

Closes #30877.
@bors
Copy link
Contributor

bors commented May 26, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: dtolnay
Pushing 07c415c to master...

@bors bors merged commit f7c4a33 into rust-lang:master May 26, 2018
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #51033!

Tested on commit 07c415c.
Direct link to PR: #51033

💔 rls on windows: test-pass → build-fail (cc @nrc, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @nrc, @rust-lang/infra).
💔 rustfmt on windows: test-pass → build-fail (cc @nrc, @rust-lang/infra).
💔 rustfmt on linux: test-pass → build-fail (cc @nrc, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request May 26, 2018
Tested on commit rust-lang/rust@07c415c.
Direct link to PR: <rust-lang/rust#51033>

💔 rls on windows: test-pass → build-fail (cc @nrc, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @nrc, @rust-lang/infra).
💔 rustfmt on windows: test-pass → build-fail (cc @nrc, @rust-lang/infra).
💔 rustfmt on linux: test-pass → build-fail (cc @nrc, @rust-lang/infra).
@DDOtten
Copy link

DDOtten commented Jun 29, 2018

It would be nice to have a into_bounds method that gives a way to get (Bound<T>, Bount<T>). Otherwise there is no way to get the start and end as T instead of &T. I currently came across a situation where I wan't to have an owned vesion of T and where it would be slower to clone it. (And it would require an additional trait bound)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Tracking issue for RangeBounds
7 participants