-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Final pre-alpha stabilization of: iter, ops, slice, collections #20560
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
Conversation
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
(We should probably wait to land this until we've had a chance to discuss |
@@ -418,7 +418,7 @@ impl<T: Sync + Send> Clone for Weak<T> { | |||
} | |||
|
|||
#[unsafe_destructor] | |||
#[experimental = "Weak pointers may not belong in this module."] | |||
#[stable] |
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.
Any notes on this call?
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.
Don't read anything into the #[stable]
here other than: if we have Weak
, we'll keep the Drop
impl.
c11d268
to
ee5109b
Compare
@gankro pushed a revision marking the correct |
fn size_hint(&self) -> (uint, Option<uint>) { (0, None) } | ||
} | ||
|
||
/// Conversion from an `Iterator` | ||
#[unstable = "may be replaced by a more general conversion trait"] | ||
#[stable] | ||
pub trait FromIterator<A> { | ||
/// Build a container with elements from an external iterator. | ||
fn from_iter<T: Iterator<Item=A>>(iterator: T) -> Self; | ||
} |
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.
This seems slightly odd to still have a type parameter now that Item
is an associated type, but I suppose T: Iterator
doesn't tell you much and you need to write down the Item
type somewhere.
Just confirming.
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.
This is desired to allow types to be created (or extended) via iterators from multiple items. For example, String
can be extended by char
or &str
iterators.
This looks great to me, this is all really falling into place! |
Also should we explicitly mark the other modules as |
This should also add |
This commit wraps up the adjustments to the iterator for recent language changes. * Moves `rposition` from `ExactSizeIterator` to `IteratorExt` using a `where` clause, thereby removing the `ExactSizeIterator: DoubleEndedIterator` constraint. * Merges `MutableDoubleEndedIterator` into `IteratorExt`, renaming `reverse_` to `reverse_in_place`. * Merges `IteratorOrdExt`, `IteratorCloneExt` and `CloneIteratorExt` into `IteratorExt` using `where` clauses. Marks as `#[stable]`: * the `iter` module itself * `FromIterator`, `Extend` * `Iterator`, `IteratorExt` * `map` * `filter` * `filter_map` * `skip_while` * `take_while` * `scan` * `flat_map` * `inspect` * `collect` * `fold` * `all` * `any` * `find` * `rposition` * `max`, `min` * Various adapter types related to the above methods Because of the trait merging, this is a: [breaking-change]
This commit marks as stable those parts of `core::ops` that are in their final planned form: `Drop`, all of the mathematical operators (`Add`, `Sub`, etc), `Deref`/`DerefMut`. It leaves the `Index*`, `Slice*` and `Fn*` traits unstable, as they are still undergoing active changes.
ee5109b
to
5371ae2
Compare
Marks as `#[stable]`: * Various iterator structs for stable methods, e.g. `Chunks` and `Windows`. * The `SliceExt` trait itself.
The earlier collections stabilization did not cover the modules themselves. This commit marks as stable those modules whose types have been stabilized.
@alexcrichton updated. After a bunch of discussion on the topic, I think we should move forward stabilizing |
Looks like rust-installer was reverted, but r=me otherwise |
I hate submodules 💢 |
5371ae2
to
c6f4a03
Compare
Conflicts: src/libcollections/slice.rs src/libcore/iter.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/rwlock.rs
c6f4a03
to
107fe6e
Compare
Landed in #20610 |
Now that various language features have been rolled out and RFCs implemented, this PR takes a final stabilization pass over
iter
,ops
,slice
andcollections
.Commit summaries copied below:
Final alpha stabilization of core::iter
This commit wraps up the adjustments to the iterator for recent language
changes.
rposition
fromExactSizeIterator
toIteratorExt
using awhere
clause, thereby removing theExactSizeIterator: DoubleEndedIterator
constraint.MutableDoubleEndedIterator
intoIteratorExt
, renamingreverse_
toreverse_in_place
.IteratorOrdExt
,IteratorCloneExt
andCloneIteratorExt
into
IteratorExt
usingwhere
clauses.Marks as
#[stable]
:iter
module itselfFromIterator
,Extend
Iterator
,IteratorExt
map
filter
filter_map
skip_while
take_while
scan
flat_map
inspect
collect
fold
all
any
find
rposition
max
,min
Because of the trait merging, this is a:
[breaking-change]
Stabilize core::ops
This commit marks as stable those parts of
core::ops
that are in theirfinal planned form:
Drop
, all of the mathematical operators (Add
,Sub
, etc),Deref
/DerefMut
. It leaves theIndex*
,Slice*
andFn*
traits unstable, as they are still undergoing active changes.Final alpha stabilization of std::slice
Marks as
#[stable]
:Chunks
andWindows
.SliceExt
trait itself.Stabilize collection modules
The earlier collections stabilization did not cover the modules
themselves. This commit marks as stable those modules whose types have
been stabilized.
Stabilization of impls and fallout from stabilization
Stabilizes
impl
s of now-stable traits.