| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
The versions show up in rustdoc.
|
|
|
|
Fix a few links in the docs
r? @steveklabnik
|
|
std: Stabilize APIs for the 1.16.0 release
This commit applies the stabilization/deprecations of the 1.16.0 release, as
tracked by the rust-lang/rust issue tracker and the final-comment-period tag.
The following APIs were stabilized:
* `VecDeque::truncate`
* `VecDeque::resize`
* `String::insert_str`
* `Duration::checked_{add,sub,div,mul}`
* `str::replacen`
* `SocketAddr::is_ipv{4,6}`
* `IpAddr::is_ipv{4,6}`
* `str::repeat`
* `Vec::dedup_by`
* `Vec::dedup_by_key`
* `Result::unwrap_or_default`
* `<*const T>::wrapping_offset`
* `<*mut T>::wrapping_offset`
* `CommandExt::creation_flags` (on Windows)
* `File::set_permissions`
* `String::split_off`
The following APIs were deprecated
* `EnumSet` - replaced with other ecosystem abstractions, long since unstable
Closes #27788
Closes #35553
Closes #35774
Closes #36436
Closes #36949
Closes #37079
Closes #37087
Closes #37516
Closes #37827
Closes #37916
Closes #37966
Closes #38080
|
|
|
|
|
|
Remove Reflect
PR for removing the `Reflect` trait. Opened so that a crater run can be done for testing the impact: https://github.com/rust-lang/rust/issues/27749#issuecomment-272665163
Fixes #27749
|
|
This commit applies the stabilization/deprecations of the 1.16.0 release, as
tracked by the rust-lang/rust issue tracker and the final-comment-period tag.
The following APIs were stabilized:
* `VecDeque::truncate`
* `VecDeque::resize`
* `String::insert_str`
* `Duration::checked_{add,sub,div,mul}`
* `str::replacen`
* `SocketAddr::is_ipv{4,6}`
* `IpAddr::is_ipv{4,6}`
* `str::repeat`
* `Vec::dedup_by`
* `Vec::dedup_by_key`
* `Result::unwrap_or_default`
* `<*const T>::wrapping_offset`
* `<*mut T>::wrapping_offset`
* `CommandExt::creation_flags` (on Windows)
* `File::set_permissions`
* `String::split_off`
The following APIs were deprecated
* `EnumSet` - replaced with other ecosystem abstractions, long since unstable
Closes #27788
Closes #35553
Closes #35774
Closes #36436
Closes #36949
Closes #37079
Closes #37087
Closes #37516
Closes #37827
Closes #37916
Closes #37966
Closes #38080
|
|
Updates to src/libcore/ops.rs docs for RFC#1228 (Placement Left Arrow)
Also fixed a minor typo in docs for `core::ops::Place`.
|
|
Part of #39264
|
|
* Remove the Reflect trait
* Remove the "reflect" lang feature
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Improve the slice iterator's searching methods
Improve all, any, find, position, rposition by explicitly unrolling the loop for the slice iterators.
- Introduce a few extension methods and functions for raw pointers make the new code easy to express
- Introduce helper methods `search_while, rsearch_while` that generalize all the searching methods
LLVM doesn't unroll the loop in `.find()` by default (clang is the same), so performance benefits a lot from explicit unrolling here. An iterator method without conditional exits (like `.fold()`) does not need this on the other hand.
One of the raw pointer extension methods is `fn post_inc(&mut self) -> Self` which is the rustic equivalent of “`ptr++`”, and it is a nice way to express the raw pointer loop (see commit 3).
Specific development notes about `search_while`: I tried both computing an end pointer "rounded" to 4, as well as the `ptrdistance >= 4` loop condition, ptrdistance was better. I tried handling the last 0-3 elements unrolled or with a while loop, the loop was better.
|
|
|
|
r=GuillaumeGomez
Document the optional extra arguments to assert_eq!() / assert_ne!()
And clarify that those arguments in assert!() are in fact formattable.
|
|
|
|
expect_err for Result.
This adds an `expect_err` method to `Result`. Considering how `unwrap_err` already exists, this seems to make sense. Inconsistency noted in Manishearth/rust-clippy#1435.
|
|
|
|
Change `to_owned` to `to_string` in docs
We should teach conversion from `str` to `String` using `to_string` rather than the legacy `to_owned`.
|
|
Fix docs for min/max algorithms
I thought at first "what did they think about when stabilizing this!?", but it turned out it's just wrong docs. Phew.
r? @steveklabnik
Test:
```
use std::cmp::Ordering;
struct S(u8, u8);
impl PartialEq for S {
fn eq(&self, other: &Self) -> bool {
self.0 == other.0
}
}
impl PartialOrd for S {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.0.cmp(&other.0))
}
}
impl Ord for S {
fn cmp(&self, other: &Self) -> Ordering {
self.0.cmp(&other.0)
}
}
fn main() {
let arr = [S(0, 1), S(0, 2)];
println!("min {:?}", arr.iter().min());
println!("min_by {:?}", arr.iter().min_by(|x, y| x.0.cmp(&y.0)));
println!("min_by_key {:?}", arr.iter().min_by_key(|x| x.0));
println!("max {:?}", arr.iter().max());
println!("max_by {:?}", arr.iter().max_by(|x, y| x.0.cmp(&y.0)));
println!("max_by_key {:?}", arr.iter().max_by_key(|x| x.0));
}
```
Output:
```
rustc 1.15.0-beta.3 (a035041ba 2017-01-07)
min Some(S(0, 1))
min_by Some(S(0, 1))
min_by_key Some(S(0, 1))
max Some(S(0, 2))
max_by Some(S(0, 2))
max_by_key Some(S(0, 2))
```
|
|
Clarify Extend behaviour wrt existing keys
This seems to be consistent with all the Extend implementations I found, and isn't documented anywhere else afaik.
|
|
Implement Display for char Escape*, To*case.
See: rust-lang/rfcs#1848.
A good example of where this is useful would be in the example `print!("{}", 'ß'.to_uppercase())`.
Not sure if this requires a formal RFC, but I decided to write the code for it anyway regardless.
|
|
We should teach conversion from `str` to `String` using `to_string`
rather than the legacy `to_owned`.
|
|
UTF-8 validation: Compute block end upfront
Simplify the conditional used for ensuring that the whole word loop is
only used if there are at least two whole words left to read.
This makes the function slightly smaller and simpler, a 0-5% reduction
in runtime for various test cases.
|
|
And clarify that those arguments in assert!() are in fact formattable.
|
|
|
|
|
|
I want to be able to sort a `Vec` of types which contain `TypeId`s, so an `Ord` derivation would be very useful to me. `Hash` already exists, so the missing `PartialOrd` and `Ord` derivations feel like an oversight to me.
|
|
This introduces a private iterator adapter `ResultShunt`, which allows
treating an iterator of `Result<T, E>` as an iterator of `T`.
|
|
|
|
Add more docs for CoerceUnsized and Unsize
here be dragons
r? @ubsan @steveklabnik
|
|
Clarify zero-value behavior of `ctlz`/`cttz` intrinsics.
Fixes https://github.com/rust-lang/rust/issues/34381.
|
|
Improve safety warning on ptr::swap
r? @eddyb @bluss , who I asked about this on IRC
|
|
Also fixed a minor typo in docs for `core::ops::Place`.
|
|
Make members of {std,core}::{i128,u128} unstable
Fixes #38860
|
|
Remove not(stage0) from deny(warnings)
Historically this was done to accommodate bugs in lints, but there hasn't been a
bug in a lint since this feature was added which the warnings affected. Let's
completely purge warnings from all our stages by denying warnings in all stages.
This will also assist in tracking down `stage0` code to be removed whenever
we're updating the bootstrap compiler.
|
|
|
|
|
|
Allow `writeln!` without arguments, in symmetry with `println!`
CC #36825.
|
|
Adding it in a stable form was an accident.
It thankfully only leaked to nightly.
Fixes #38860
|
|
Fix associated types in copy implementations
Fixes an ICE and an error in checking copy implementations.
r? @nikomatsakis
|
|
|