Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for RangeBounds #30877
Comments
This comment has been minimized.
This comment has been minimized.
|
I'm currently working on inclusive ranges, which is why I noticed this. A PR to change the issue link is incoming. |
sfackler
added
T-libs
B-unstable
labels
Jan 13, 2016
This was referenced Jan 13, 2016
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Jan 14, 2016
bors
added a commit
that referenced
this issue
Mar 5, 2016
bors
added a commit
that referenced
this issue
Mar 6, 2016
This comment has been minimized.
This comment has been minimized.
|
This trait is not actually being exported by |
SimonSapin
referenced this issue
Apr 2, 2016
Closed
Implement RangeArgument for RangeInclusive and RangeInclusiveTo #32681
sfackler
added
the
I-nominated
label
Aug 28, 2016
sfackler
added
final-comment-period
and removed
I-nominated
labels
Sep 7, 2016
This comment has been minimized.
This comment has been minimized.
|
The libs team discussed this, and are placing pub enum Bound<T> {
Unbound,
Inclusive(T),
Exclusive(T),
}
pub trait RangeArgument<T> {
fn lower(&self) -> Bound<&T>;
fn upper(&self) -> Bound<&T>;
} |
This comment has been minimized.
This comment has been minimized.
|
@sfackler shouldn't the new API go though another stabilization period? Also, a way to extract the bounds by-value would be nice (but probably not necessary). |
This comment has been minimized.
This comment has been minimized.
|
Probably at this point yeah, particularly since we still haven't actually made the change. |
This comment has been minimized.
This comment has been minimized.
|
The libs team discussed this at triage the other day and the conclusion was to punt on stabilization/deprecation because we didn't have time to implement the changes here |
alexcrichton
removed
the
final-comment-period
label
Sep 29, 2016
This comment has been minimized.
This comment has been minimized.
|
Question: is there a reason why this trait is in |
This comment has been minimized.
This comment has been minimized.
|
I don't think there's a good reason for it to not be in core off the top of my head - it should probably move! |
This comment has been minimized.
This comment has been minimized.
J-F-Liu
commented
Mar 8, 2017
•
|
Should also impl RangeArgument for usize. impl RangeArgument<usize> for usize {
fn start(&self) -> Bound<usize> { Included(self) }
fn end(&self) -> Bound<usize> { Included(self) }
} |
This comment has been minimized.
This comment has been minimized.
|
@J-F-Liu There’s also a |
This comment has been minimized.
This comment has been minimized.
J-F-Liu
commented
Mar 9, 2017
|
@SimonSapin thanks for let me know this, it indicates should impl RangeArgument for usize as well. |
This comment has been minimized.
This comment has been minimized.
|
Would people be willing to accept a PR for moving this to core? Everything would have the same features, and Only problem I see is that |
This comment has been minimized.
This comment has been minimized.
|
Makes sense to move to me!
…On Sat, Apr 8, 2017 at 9:35 PM Clar ***@***.***> wrote:
Would people be willing to accept a PR for moving this to core? Everything
would have the same features, and collections would re-export them for
compatibility.
Only problem I see is that Bound is already stabilised but I'm not too
worried about that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#30877 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABY2UaqUry1YVcrwUqcWz7caLespreVdks5ruGAdgaJpZM4HEQZG>
.
|
This comment has been minimized.
This comment has been minimized.
|
Can I nominate this for FCP? Seems like it does what it needs to do; fully general. |
This comment has been minimized.
This comment has been minimized.
|
I've had various ideas w.r.t. the design which I posted and each time the discussion got moved somewhere else, I can't remember what they were and I'm too lazy to look them up, but at least let's call it something like |
This comment has been minimized.
This comment has been minimized.
|
Seems reasonable to FCP for stabilization. I'd be fine renaming as part of that! @rfcbot fcp merge |
This comment has been minimized.
This comment has been minimized.
Yes, good point -- I hadn't considered that. I'm going to do it even though it feels pretty icky. Despite my griping, thanks for the pointer! |
This comment has been minimized.
This comment has been minimized.
|
In case anyone else has a collection they want RangeArgument for: https://github.com/Gankro/thin-vec/blob/master/src/range.rs This is an especially clean case of the unstable trait in public API pattern, as there's very little incentive to implement these traits outside of the like 4-5 std types which do. |
SimonSapin
referenced this issue
Mar 19, 2018
Merged
Rename RangeArgument to RangeBounds, move it and Bound to libcore #49163
This comment has been minimized.
This comment has been minimized.
|
PR #49163: Rename RangeArgument to RangeBounds, move it and Bound to libcore |
This comment has been minimized.
This comment has been minimized.
|
Assuming this PR is accepted, the only issue in this thread that I feel might not be resolved is the possibility of replacing this trait with a type to be used with @sfackler wrote “the @rust-lang/libs what do you think? If we decide to keep the dedicated trait, should we do another round of FCP or are we good to stabilize? (Again assuming the PR linked above.) |
LiHRaM
referenced
this issue
in LiHRaM/xi-editor
Mar 25, 2018
cmyr
referenced this issue
Mar 28, 2018
Merged
Use Range instead of `start` & `end` in Rope impl #576
bors
added a commit
that referenced
this issue
Mar 28, 2018
bors
added a commit
that referenced
this issue
Mar 29, 2018
SimonSapin
changed the title
Tracking issue for RangeArgument
Tracking issue for RangeBounds
Mar 30, 2018
This comment has been minimized.
This comment has been minimized.
|
The libs team discussed this and consensus was to stabilize after renaming the methods to @rfcbot fcp merge Affected APIs are: pub trait RangeBounds<T: ?Sized> {
fn start_bound(&self) -> Bound<&T>;
fn end_bound(&self) -> Bound<&T>;
}
impl<T: ?Sized> RangeBounds<T> for RangeFull {…}
impl<T> RangeBounds<T> for RangeFrom<T> {…}
impl<T> RangeBounds<T> for RangeTo<T> {…}
impl<T> RangeBounds<T> for Range<T> {…}
impl<T> RangeBounds<T> for RangeInclusive<T> {…}
impl<T> RangeBounds<T> for RangeToInclusive<T> {…}
impl<T> RangeBounds<T> for (Bound<T>, Bound<T>) {…}
impl<'a, T: ?Sized + 'a> RangeBounds<T> for (Bound<&'a T>, Bound<&'a T>) {…}
impl<'a, T> RangeBounds<T> for RangeFrom<&'a T> {…}
impl<'a, T> RangeBounds<T> for RangeTo<&'a T> {…}
impl<'a, T> RangeBounds<T> for Range<&'a T> {…}
impl<'a, T> RangeBounds<T> for RangeInclusive<&'a T> {…}
impl<'a, T> RangeBounds<T> for RangeToInclusive<&'a T> {…} |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Mar 30, 2018
•
|
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once a majority of reviewers approve (and none object), 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
added
the
proposed-final-comment-period
label
Mar 30, 2018
This comment has been minimized.
This comment has been minimized.
|
Since the bikeshed was opened: why not |
This comment has been minimized.
This comment has been minimized.
|
This change is motivated by avoiding collision with the exact |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Apr 11, 2018
|
|
rfcbot
added
final-comment-period
and removed
proposed-final-comment-period
labels
Apr 11, 2018
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Apr 21, 2018
|
The final comment period is now complete. |
coryshrmn
added a commit
to coryshrmn/rust
that referenced
this issue
May 24, 2018
coryshrmn
added a commit
to coryshrmn/rust
that referenced
this issue
May 24, 2018
coryshrmn
referenced this issue
May 24, 2018
Merged
stabilize RangeBounds collections_range #30877 #51033
Centril
added
disposition-merge
finished-final-comment-period
and removed
final-comment-period
labels
May 24, 2018
coryshrmn
added a commit
to coryshrmn/rust-clippy
that referenced
this issue
May 24, 2018
bors
added a commit
that referenced
this issue
May 25, 2018
bors
closed this
in
#51033
May 26, 2018
This comment has been minimized.
This comment has been minimized.
DDOtten
commented
Jul 1, 2018
•
|
I think a method like This would give a way to get the inner values without having to use |
durka commentedJan 13, 2016
This issue tracks the
collections_rangefeature which applies tostd::collections::range::RangeArgument. It used to be lumped in withdrain(#27711) but that was stabilized whileRangeArgumentmay continue to be affected by experiments with inclusive ranges, so here we are.