| Age | Commit message (Collapse) | Author | Lines |
|
This includes the following stabilizations:
- tcpstream_connect_timeout https://github.com/rust-lang/rust/pull/44563
- iterator_for_each https://github.com/rust-lang/rust/pull/44567
- ord_max_min https://github.com/rust-lang/rust/pull/44593
- compiler_fences https://github.com/rust-lang/rust/pull/44595
- needs_drop https://github.com/rust-lang/rust/pull/44639
- vec_splice https://github.com/rust-lang/rust/pull/44640
|
|
You can otherwise end up in a situation where you don't actually resize
but still call into handle_cap_increase which then corrupts head/tail.
Closes #44800
|
|
Add ..= to the parser
Add ..= to libproc_macro
Add ..= to ICH
Highlight ..= in rustdoc
Update impl Debug for RangeInclusive to ..=
Replace `...` to `..=` in range docs
Make the dotdoteq warning point to the ...
Add warning for ... in expressions
Updated more tests to the ..= syntax
Updated even more tests to the ..= syntax
Updated the inclusive_range entry in unstable book
|
|
|
|
Add iterator method .rfold(init, function); the reverse of fold
rfold is the reverse version of fold.
Fold allows iterators to implement a different (non-resumable) internal
iteration when it is more efficient than the external iteration implemented
through the next method. (Common examples are VecDeque and .chain()).
Introduce rfold() so that the same customization is available for reverse
iteration. This is achieved by both adding the method, and by having the
Rev\<I> adaptor connect Rev::rfold → I::fold and Rev::fold → I::rfold.
On the surface, rfold(..) is just .rev().fold(..), but the special case
implementations allow a data structure specific fold to be used through for
example .iter().rev(); we thus have gains even for users never calling exactly
rfold themselves.
|
|
Optimize drain_filter
This PR cuts out two copies from each iteration of `drain_filter` by exchanging the swap operation for a copy_nonoverlapping function call instead. Since the data being swapped is not needed anymore we can just overwrite it instead.
|
|
|
|
|
|
Stabilized vec_splice and modified splice tracking issue
This stabilizes the vec_splice (Vec part of splice RFC)
Fixes #32310.
|
|
Implement `Arc`/`Rc` raw pointer conversions for `?Sized`
* Add `T: ?Sized` bound to {`Arc`,`Rc`}::{`from_raw`,`into_raw`}
|
|
|
|
|
|
Implement <Rc<Any>>::downcast
* Implement `<Rc<Any>>::downcast::<T>`
* New unstable method. Works just like Box\<Any\>, but for Rc.
* Any has two cases for its methods: Any and Any + Send; Rc is never Send, so that case is skipped for Rc.
* Motivation for being a method with self is to match Box and there is no user-supplied type; the inner type is Any and downcast does not conflict with any method of Any.
* Arc was skipped because Any itself has no downcast for the case that makes most sense: Any + Send + Sync
|
|
* Add `T: ?Sized` bound to {`Arc`,`Rc`}::{`from_raw`,`into_raw`}
|
|
|
|
Clarify return type of `String::from_utf16_lossy`.
Fixes https://github.com/rust-lang/rust/issues/32874
|
|
Remove unneeded `loop`.
None
|
|
Fix example in transmute; add safety requirement to Vec::from_raw_parts
This fixes the second bullet point on #44281 and also removes some incorrect information.
|
|
Fix drain_filter doctest.
Fixes #44499.
Also change some of the hidden logic in the doctest as a regression test; two bugs in the original would now cause test failure.
|
|
Add an example of std::str::encode_utf16
Closes #44419
|
|
Add doc example to str::from_boxed_utf8_unchecked
Fixes #44463.
|
|
Added an example for `std::str::into_boxed_bytes()`
This solves issue #44423.
|
|
Add doc example to String::as_mut_str
Fixes #44429.
|
|
Fixes https://github.com/rust-lang/rust/issues/32874
|
|
|
|
|
|
|
|
impl Hasher for {&mut Hasher, Box<Hasher>}
**Rationale:** The `Hash` trait has `fn hash<H: Hasher>(&self, state: &mut H)`, which can only accept a `Sized` hasher, even if the `Hasher` trait is object-safe. We cannot retroactively add the `?Sized` bound without breaking stability, thus implementing `Hasher` to a trait object reference is the next best solution.
**Warning:** These `impl` are insta-stable, and should need an FCP. I don't think a full RFC is necessary.
|
|
Closes #44419
|
|
Add or_default to Entry APIs
As argued for in #44324, this PR adds a new `or_default` method to the various `Entry` APIs (currently just for `BTreeMap` and `HashMap`) when `V: Default`. This method is effectively a shorthand for `or_insert_with(Default::default)`.
|
|
|
|
|
|
|
|
Fixes #44463.
|
|
|
|
|
|
Fixes #44429.
|
|
documentation update to demonstrate mutability
#44467
- demonstrate correct implementation returns `Some`
- demonstrate out of bounds returns `None`
- demonstrate mutability
|
|
Add doc examples for str::as_bytes_mut
Fixes #44427
|
|
|
|
Fixes #44427
|
|
Fixes #44428.
|
|
|
|
|
|
|
|
|
|
Moved the examples from split_at_mut to split_at so the example at
split_at_mut can just demonstrate mutability.
|
|
Implement downcast the like it exists for Box.
The implementation avoids using into_raw/from_raw, because the pointer
arithmetic which should cancel does not seem to optimize out at the
moment.
Since Rc<T> is never Send, only Rc<Any> and not Rc<Any + Send>
implements downcast.
|
|
API docs: macros. Standard Documentation Checklist
Fixes #29381
r? @steveklabnik
|
|
Remove Splice struct return value from String::splice
The implementation is now almost identical to the one in the RFC.
Fixes #44038
cc #32310
|