[beta] backports
This backports two beta-accepted PRs, fixing CVE-2020-36323 and CVE-2021-31162.
- Fixes API soundness issue in `join()` #81728
- Fix double-drop in `Vec::from_iter(vec.into_iter())` specialization when items drop during panic #83629
[beta] Bump LLVM to a upstream 12.0 release
Currently the `beta` branch utilizes a release candidate of LLVM 12.0. Since then a large number of issues have been fixed upstream, including those that are known to affect Rust code.
It would be unfortunate if we released a stable Rust with all of those issues when we have the fixes in the actual LLVM release and/or our backports of commits that didn't make the release cut on top of it.
cc `@cuviper` / `@nikic`
[beta] Beta rollups
- Upgrade expat dependency in riscv64 to newer version. #84394
- Fix Self keyword doc URL conflict on case insensitive file systems (until definitely fixed on rustdoc) #83678
- Cargo:
- Backport "Don't give a hard error when the end-user specifies RUSTC_BOOTSTRAP=crate_name" (rust-lang/cargo#9385)
- [beta] Revert rust-lang/cargo#9133, moving to git HEAD dependencies by default (rust-lang/cargo#9383)
Upgrade `expat` dependency in riscv64 to newer version.
The old version was renamed to `expat-2.2.6-RENAMED-VULNERABLE-PLEASE-USE-2.3.0-INSTEAD`. :)
r? `@Mark-Simulacrum`
[beta] backports
Initial round of beta backports, with 1 PR:
* SplitInclusive is public API #83372
This also includes a bump to the released stable compiler.
r? `@Mark-Simulacrum`
Revert performance-sensitive change in #82436
This change was done in #82436, as an "optimization". Unfortunately I
missed that this code is not always executed, because of the "continue"
in the conditional above it.
This commit should solve the perf regressions introduced by #82436 as I
think there isn't anything else that could affect runtime performance in
that PR. The `Pick` type grows only one word, which I doubt can cause up
to 8.8% increase in RSS in some of the benchmarks.
---
Could someone with the rights start a perf job please?
Rollup of 8 pull requests
Successful merges:
- #79986 (Only build help popup when it's really needed)
- #82570 (Add `as_str` method for split whitespace str iterators)
- #83244 (Fix overflowing length in Vec<ZST> to VecDeque)
- #83254 (Include output stream in `panic!()` documentation)
- #83269 (Revert the second deprecation of collections::Bound)
- #83277 (Mark early otherwise optimization unsound)
- #83285 (Update LLVM to bring in SIMD updates for WebAssembly)
- #83297 (Do not ICE on ty::Error as an error must already have been reported)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Update LLVM to bring in SIMD updates for WebAssembly
This is a continuation of https://github.com/rust-lang/llvm-project/pull/96
to continue to make progress on updating Rust's support for SIMD
intrinsics on WebAssembly to the latest version of the specification.
Mark early otherwise optimization unsound
r? `@oli-obk`
cc `@tmiasko`
Related to #78496 and #82905
Should I also bump this one to level 3 or 4 or given that is unsound it doesn't matter?.
Probably need to adjust some tests.
Fix overflowing length in Vec<ZST> to VecDeque
`Vec` can hold up to `usize::MAX` ZST items, but `VecDeque` has a lower
limit to keep its raw capacity as a power of two, so we should check
that in `From<Vec<T>> for VecDeque<T>`. We can also simplify the
capacity check for the remaining non-ZST case.
Before this fix, the new test would fail on the length:
```
thread 'collections::vec_deque::tests::test_from_vec_zst_overflow' panicked at 'assertion failed: `(left == right)`
left: `0`,
right: `9223372036854775808`', library/alloc/src/collections/vec_deque/tests.rs:474:5
note: panic did not contain expected string
panic message: `"assertion failed: `(left == right)`\n left: `0`,\n right: `9223372036854775808`"`,
expected substring: `"capacity overflow"`
```
That was a result of `len()` using a mask `& (size - 1)` with the
improper length. Now we do get a "capacity overflow" panic as soon as
that `VecDeque::from(vec)` is attempted.
Fixes#80167.
Add `as_str` method for split whitespace str iterators
This PR adds `as_str` methods to `SplitWhitespace` and `SplitAsciiWhitespace`
str iterators. The methods return the remainder, similar to `as_str` methods on
`Chars` and other split iterators. This PR is a continuation of https://github.com/rust-lang/rust/pull/75265, which added `as_str` for all other str split iterators.
The feature gate for new methods is `#![feature(str_split_whitespace_as_str)]`.
`SplitWhitespace` and `SplitAsciiWhitespace` use iterators under the hood, so to implement `as_str` it's required to either
1. Make fields of some iterators `pub(crate)`
2. Add getter methods (like `into_inner`, `inner`, `inner_mut`...) to some (all) iterators
3. Completely rewrite `SplitWhitespace` and `SplitAsciiWhitespace`
This PR uses the 1. approach since it's easier to implement and requires fewer changes (and no changes to the public API). If you think that's not the right way, please, tell me.
r? `@m-ou-se`
Only build help popup when it's really needed
When working on https://github.com/rust-lang/rust/pull/79985, I realized that the help popup was built even when it wasn't needed. This PR only makes the help popup to be built when required.
r? `@jyn514`
Replace closures_captures and upvar_capture with closure_min_captures
Removed all uses of closures_captures and upvar_capture and refactored code to work with closure_min_captures. This also involved removing functions that were no longer needed like the bridge.
Closes https://github.com/rust-lang/project-rfc-2229/issues/18
r? `@nikomatsakis`