| Age | Commit message (Collapse) | Author | Lines |
|
Also remove `stable` stability annotations from inherent impls
(There will be a warning for useless stability annotations soon.)
r? @Gankro
|
|
vec: Remove old comment in Vec::drop
This comment was leftover from an earlier revision of a PR, something
that never was merged. There is no ZST special casing in Vec::drop.
|
|
Remove `stable` stability annotations from inherent impls
|
|
This comment was leftover from an earlier revision of a PR, something
that never was merged. There is no ZST special casing in Vec::drop.
|
|
Fixes #27322
|
|
I think this should fix the test failures in debug mode from #29492
The assertion was written incorrectly, and I don't like the way the new assertion is written, but I _think_ it does the right thing now.
|
|
|
|
|
|
|
|
I see that `extend()` is not called if new_len > len()
|
|
I see that `extend()` is not called if new_len > len()
|
|
This documentation confused me when trying to use truncate on a project. Originally, it was unclear whether truncate removed the last `len` elements, or whether it cut down the vector to be exactly `len` elements long. The example was also ambiguous.
|
|
This commit stabilizes and deprecates library APIs whose FCP has closed in the
last cycle, specifically:
Stabilized APIs:
* `fs::canonicalize`
* `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists,
is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait.
* `Formatter::fill`
* `Formatter::width`
* `Formatter::precision`
* `Formatter::sign_plus`
* `Formatter::sign_minus`
* `Formatter::alternate`
* `Formatter::sign_aware_zero_pad`
* `string::ParseError`
* `Utf8Error::valid_up_to`
* `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}`
* `<[T]>::split_{first,last}{,_mut}`
* `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated
but will be once 1.5 is released.
* `str::{R,}MatchIndices`
* `str::{r,}match_indices`
* `char::from_u32_unchecked`
* `VecDeque::insert`
* `VecDeque::shrink_to_fit`
* `VecDeque::as_slices`
* `VecDeque::as_mut_slices`
* `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`)
* `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`)
* `Vec::resize`
* `str::slice_mut_unchecked`
* `FileTypeExt`
* `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}`
* `BinaryHeap::from` - `from_vec` deprecated in favor of this
* `BinaryHeap::into_vec` - plus a `Into` impl
* `BinaryHeap::into_sorted_vec`
Deprecated APIs
* `slice::ref_slice`
* `slice::mut_ref_slice`
* `iter::{range_inclusive, RangeInclusive}`
* `std::dynamic_lib`
Closes #27706
Closes #27725
cc #27726 (align not stabilized yet)
Closes #27734
Closes #27737
Closes #27742
Closes #27743
Closes #27772
Closes #27774
Closes #27777
Closes #27781
cc #27788 (a few remaining methods though)
Closes #27790
Closes #27793
Closes #27796
Closes #27810
cc #28147 (not all parts stabilized)
|
|
This commit stabilizes and deprecates library APIs whose FCP has closed in the
last cycle, specifically:
Stabilized APIs:
* `fs::canonicalize`
* `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists,
is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait.
* `Formatter::fill`
* `Formatter::width`
* `Formatter::precision`
* `Formatter::sign_plus`
* `Formatter::sign_minus`
* `Formatter::alternate`
* `Formatter::sign_aware_zero_pad`
* `string::ParseError`
* `Utf8Error::valid_up_to`
* `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}`
* `<[T]>::split_{first,last}{,_mut}`
* `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated
but will be once 1.5 is released.
* `str::{R,}MatchIndices`
* `str::{r,}match_indices`
* `char::from_u32_unchecked`
* `VecDeque::insert`
* `VecDeque::shrink_to_fit`
* `VecDeque::as_slices`
* `VecDeque::as_mut_slices`
* `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`)
* `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`)
* `Vec::resize`
* `str::slice_mut_unchecked`
* `FileTypeExt`
* `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}`
* `BinaryHeap::from` - `from_vec` deprecated in favor of this
* `BinaryHeap::into_vec` - plus a `Into` impl
* `BinaryHeap::into_sorted_vec`
Deprecated APIs
* `slice::ref_slice`
* `slice::mut_ref_slice`
* `iter::{range_inclusive, RangeInclusive}`
* `std::dynamic_lib`
Closes #27706
Closes #27725
cc #27726 (align not stabilized yet)
Closes #27734
Closes #27737
Closes #27742
Closes #27743
Closes #27772
Closes #27774
Closes #27777
Closes #27781
cc #27788 (a few remaining methods though)
Closes #27790
Closes #27793
Closes #27796
Closes #27810
cc #28147 (not all parts stabilized)
|
|
Follow https://doc.rust-lang.org/book/documentation.html#special-sections
|
|
{BTree,Hash}{Map,Set} will not update their key if it already exists, which
can matter with more complex keys. This behavior is now documented.
Fixes #26888
|
|
{BTree,Hash}{Map,Set} will not update their key if it already exists, which
can matter with more complex keys. This behavior is now documented.
Fixes #26888
|
|
Add dropck unsafe escape hatch (UGEH) to vec::IntoIter.
Fix #29166
|
|
Fix #29166
|
|
This is a WIP PR for my implementation of drain over the VecDeque data structure supporting ranges. It brings the VecDeque drain implementation in line with Vec's.
Tests haven't been written for the new function yet.
|
|
|
|
|
|
|
|
implement RFC 1238: nonparametric dropck.
cc #28498
cc @nikomatsakis
|
|
|
|
|
|
|
|
I needed it in `RawVec`, `Vec`, and `TypedArena` for `rustc` to
bootstrap; but of course that alone was not sufficient for `make
check`.
Later I added `unsafe_destructor_blind_to_params` to collections, in
particular `LinkedList` and `RawTable` (the backing representation for
`HashMap` and `HashSet`), to get the regression tests exercising
cyclic structure from PR #27185 building.
----
Note that the feature is `dropck_parametricity` (which is not the same
as the attribute's name). We will almost certainly vary our strategy
here in the future, so it makes some sense to have a not-as-ugly name
for the feature gate. (The attribute name was deliberately selected to
be ugly looking.)
|
|
Our docs were very basic for the various versions of from_utf8, so
this commit beefs them up.
It also improves docs for the &str variant's error, Utf8Error.
|
|
|
|
|
|
Fixes #28384
|
|
Remove redundant uses of Iterator::by_ref()
|
|
|
|
Especially when documenting the use of `0`, since zero looks very
similar to `O` in fonts not meant for displaying code.
Other literal characters, traits, etc should also use code formatting.
This change makes this documentation more internally consistent.
|
|
- Successful merges: #28664, #28673, #28681, #28682, #28688
- Failed merges:
|
|
|
|
|
|
Implement AsMut for Vec
Fixes #28549
|
|
It can never be instantiated, so signify this by having it actually be an empty
`enum`.
cc #27734
|
|
This commit updates the `MatchIndices` and `RMatchIndices` iterators to follow
the same pattern as the `chars` and `char_indices` iterators. The `matches`
iterator currently yield `&str` elements, so the `MatchIndices` iterator now
yields the index of the match as well as the `&str` that matched (instead of
start/end indexes).
cc #27743
|
|
|
|
|
|
This commit updates the `MatchIndices` and `RMatchIndices` iterators to follow
the same pattern as the `chars` and `char_indices` iterators. The `matches`
iterator currently yield `&str` elements, so the `MatchIndices` iterator now
yields the index of the match as well as the `&str` that matched (instead of
start/end indexes).
cc #27743
|
|
|
|
Fixes #28549
|
|
It can never be instantiated, so signify this by having it actually be an empty
`enum`.
cc #27734
|
|
r? @bluss
|
|
Before:
test dst_bigger::src_100_dst_1000::clone ... bench: 34 ns/iter (+/- 1)
test dst_bigger::src_100_dst_1000::clone_from ... bench: 75 ns/iter (+/- 3)
test dst_bigger::src_10_dst_100::clone ... bench: 25 ns/iter (+/- 0)
test dst_bigger::src_10_dst_100::clone_from ... bench: 9 ns/iter (+/- 1)
test eq::src_1000_dst_1000::clone ... bench: 105 ns/iter (+/- 2)
test eq::src_1000_dst_1000::clone_from ... bench: 593 ns/iter (+/- 21)
test eq::src_100_dst_100::clone ... bench: 34 ns/iter (+/- 1)
test eq::src_100_dst_100::clone_from ... bench: 75 ns/iter (+/- 1)
test src_bigger::src_1000_dst_100::clone ... bench: 103 ns/iter (+/- 5)
test src_bigger::src_1000_dst_100::clone_from ... bench: 148 ns/iter (+/- 5)
test src_bigger::src_100_dst_10::clone ... bench: 34 ns/iter (+/- 1)
test src_bigger::src_100_dst_10::clone_from ... bench: 20 ns/iter (+/- 0)
After:
test dst_bigger::src_100_dst_1000::clone ... bench: 34 ns/iter (+/- 2)
test dst_bigger::src_100_dst_1000::clone_from ... bench: 15 ns/iter (+/- 1)
test dst_bigger::src_10_dst_100::clone ... bench: 26 ns/iter (+/- 1)
test dst_bigger::src_10_dst_100::clone_from ... bench: 7 ns/iter (+/- 0)
test eq::src_1000_dst_1000::clone ... bench: 103 ns/iter (+/- 1)
test eq::src_1000_dst_1000::clone_from ... bench: 85 ns/iter (+/- 4)
test eq::src_100_dst_100::clone ... bench: 34 ns/iter (+/- 2)
test eq::src_100_dst_100::clone_from ... bench: 15 ns/iter (+/- 1)
test src_bigger::src_1000_dst_100::clone ... bench: 103 ns/iter (+/- 4)
test src_bigger::src_1000_dst_100::clone_from ... bench: 90 ns/iter (+/- 2)
test src_bigger::src_100_dst_10::clone ... bench: 34 ns/iter (+/- 2)
test src_bigger::src_100_dst_10::clone_from ... bench: 20 ns/iter (+/- 0)
Closes #28601.
|
|
|