| Age | Commit message (Collapse) | Author | Lines |
|
* Use `i32` (`u32`) in doc examples, not `int` (`u32`).
* Switch impl macros to use `isize`/`usize` rather than `int`/`uint`.
|
|
* cast 3-valued `core::cmp::Ordering` to `i32`, not `int`.
* use `isize`/`usize` in the impl macros.
|
|
|
|
Casting the pointer to an integer requires a ptrtoint, while casting 0
to a pointer is directly folded to a `null` value.
|
|
|
|
Conflicts:
src/libstd/sync/task_pool.rs
src/libstd/thread.rs
src/libtest/lib.rs
src/test/bench/shootout-reverse-complement.rs
src/test/bench/shootout-spectralnorm.rs
|
|
|
|
Conflicts:
src/test/bench/rt-messaging-ping-pong.rs
src/test/bench/rt-parfib.rs
src/test/bench/task-perf-spawnalot.rs
|
|
Now that the necessary associated types exist for the `IntoIterator` trait this
commit stabilizes the trait as-is as well as all existing implementations.
|
|
|
|
|
|
|
|
|
|
Per RFC 458.
Closes #22251.
|
|
Previously Send was defined as `trait Send: 'static {}`. As detailed in
https://github.com/rust-lang/rfcs/pull/458, the `'static` bound is not
actually necessary for safety, we can use lifetimes to enforce that more
flexibly.
`unsafe` code that was previously relying on `Send` to insert a
`'static` bound now may allow incorrect patterns, and so should be
audited (a quick way to ensure safety immediately and postpone the audit
is to add an explicit `'static` bound to any uses of the `Send` type).
cc #22251.
|
|
Now that the necessary associated types exist for the `IntoIterator` trait this
commit stabilizes the trait as-is as well as all existing implementations.
|
|
This brings it in line with its namesake in `std::io`.
[breaking-change]
r? @aturon
|
|
This brings it in line with its namesake in `std::io`.
[breaking-change]
r? @aturon
|
|
fixes #22203
r? @nikomatsakis
This breaks code that might be using attributes randomly, so it's technically a
[breaking-change]
|
|
cc #22240
|
|
The `Arguments::new_v1_formatted` function was accidentally left out when this
module was stabilized.
|
|
Some newcomers might look for a "flatMap" method on Option. Include the
reference so that searching the page would find "and_then".
|
|
The first commit adds a short note which I believe will reduce worries in people who work with closures very often and read the Rust book for their first time.
The second commit consists solely of tiny typo fixes. In some cases, I changed "logical" quotations like
She said, "I like programming".
to
She said, "I like programming."
because the latter seems to be the prevalent style in the book.
|
|
Fix up, add examples, make them all the same.
|
|
`IntoIterator` now has an extra associated item:
``` rust
trait IntoIterator {
type Item;
type IntoIter: Iterator<Self=Self::Item>;
}
```
This lets you bind the iterator \"`Item`\" directly when writing generic functions:
``` rust
// hypothetical change, not included in this PR
impl Extend<T> for Vec<T> {
// you can now write
fn extend<I>(&mut self, it: I) where I: IntoIterator<Item=T> { .. }
// instead of
fn extend<I: IntoIterator>(&mut self, it: I) where I::IntoIter: Iterator<Item=T> { .. }
}
```
The downside is that now you have to write an extra associated type in your `IntoIterator` implementations:
``` diff
impl<T> IntoIterator for Vec<T> {
+ type Item = T;
type IntoIter = IntoIter<T>;
fn into_iter(self) -> IntoIter<T> { .. }
}
```
Because this breaks all downstream implementations of `IntoIterator`, this is a [breaking-change]
---
r? @aturon
|
|
Appears to be just an oversight given it is the only method in a stable trait.
r? @aturon because you did final alpha stabilisation of iterators.
|
|
cc https://github.com/rust-lang/rust/issues/22240
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Some function signatures have changed, so this is a [breaking-change].
In particular, radixes and numerical values of digits are represented by `u32` now.
Part of #22240
|
|
cc https://github.com/rust-lang/rust/issues/22240
|
|
Fixes #22047
`Range<u64>` and `Range<i64>` may be longer than usize::MAX on 32-bit
platforms, and thus they cannot fulfill the protocol for
ExactSizeIterator. We don't want a nonobvious platform dependency in
basic iterator traits, so the trait impl is removed.
The logic of this change assumes that usize is at least 32-bit.
This is technically a breaking change; note that `Range<usize>` and
`Range<isize>` are always ExactSizeIterators.
[breaking-change]
|
|
|
|
Fixes #22064.
|
|
`Unsafe` was renamed to `UnsafeCell` a while ago, but the corresponding lang item kept the old name. This patch fixes the inconsistency.
r? @eddyb
|
|
In `std::f32` and `std::f64`:
- `MIN_VALUE` → `MIN`
- `MAX_VALUE` → `MAX`
- `MIN_POS_VALUE` → `MIN_POSITIVE`
This matches the corresponding integer constants.
[breaking-change]
|
|
Some newcomers might look for a "flatMap" method on Option. Include the
reference so that searching the page would find "and_then".
|
|
|
|
|
|
|
|
|
|
|
|
|