-
Notifications
You must be signed in to change notification settings - Fork 13k
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 core::ops::Range*::contains() as per rust-lang/rust#32311 #32396
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
I wish to have impl<Idx: PartialOrd<Idx>> RangeFull {
fn contains(&self, _: Idx) -> bool { true }
} so that
but it seems like it's not allowed:
|
Travis failures look non-spurious:
Also cc @steveklabnik, quite extensive docs! Not sure if they're idiomatic though? |
/// ``` | ||
/// #![feature(inclusive_range,inclusive_range_syntax,iter_arith)] | ||
/// fn main() { | ||
/// assert_eq!(arr[ ...2], [0,1,2 ]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy/paste error?
Oops, I accidentally rewound my working branch |
@@ -1458,7 +1475,26 @@ impl fmt::Debug for RangeFull { | |||
} | |||
} | |||
|
|||
/// A (half-open) range which is bounded at both ends. | |||
/// A (half-open) range which is bounded at both ends: { x | start <= x < end }. | |||
/// Use `stard..end` (two dots) for its shorthand. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
Signed-off-by: NODA, Kai <nodakai@gmail.com>
Fixed typo |
Wait does |
It passes the unstability to all the child items. |
OK, I remembered something about trait impls being insta-stable. But inherent impls are different I guess. |
The outputs look like this: |
⌛ Testing commit a21c5f2 with merge 37e3ac0... |
@bors: retry force |
Add core::ops::Range*::contains() as per #32311
No description provided.