[stable] Fix CVE-2021-42574 and prepare Rust 1.56.1
This PR implements new lints to mitigate the impact of [CVE-2021-42574], caused by the presence of bidirectional-override Unicode codepoints in the compiled source code. [See the advisory][advisory] for more information about the vulnerability.
The changes in this PR will be released later today as part of Rust 1.56.1.
[CVE-2021-42574]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-42574
[advisory]: https://blog.rust-lang.org/2021/11/01/cve-2021-42574.html
Rust 1.56.0 stable release
This PR bumps 1.56.0 to the stable channel. This also includes a backport for:
* Latest changes to the release notes
* #89867
r? `@ghost`
cc `@rust-lang/release`
This can append if within the same module a `#[macro_export] macro_rules!`
is declared but also a reexport of itself producing two export of the same
macro in the same module. In that case we only want to document it once.
Only use `clone3` when needed for pidfd
In #89522 we learned that `clone3` is interacting poorly with Gentoo's
`sandbox` tool. We only need that for the unstable pidfd extensions, so
otherwise avoid that and use a normal `fork`.
r? `@Mark-Simulacrum`
In #89522 we learned that `clone3` is interacting poorly with Gentoo's
`sandbox` tool. We only need that for the unstable pidfd extensions, so
otherwise avoid that and use a normal `fork`.
[beta] backports
- 2229: Consume IfLet expr #89282
- Wrapper for -Z gcc-ld=lld to invoke rust-lld with the correct flavor #89288
- Fix unsound optimization with explicit variant discriminants #89489
- Fix stabilization version for bindings_after_at #89605
- Turn vtable_allocation() into a query #89619
- Revert "Stabilize Iterator::intersperse()" #89638
- Ignore type of projections for upvar capturing #89648
- ~~Add Poll::ready and~~ revert stabilization of task::ready! #89651
- CI: Use mirror for libisl downloads for more docker dist builds #89661
- Use correct edition for panic in [debug_]assert!(). #89622
- Switch to our own mirror of libisl plus ct-ng oldconfig fixes#89599
- Emit item no type error even if type inference fails #89585
- Revert enum discriminants #89884
The wrapper is installed as `ld` and `ld64` in the `lib\rustlib\<host_target>\bin\gcc-ld`
directory and its sole purpose is to invoke `rust-lld` in the parent directory with
the correct flavor.
(cherry picked from commit 6162fc0c80)
[beta] Beta rollup
* Fix WinUWP std compilation errors due to I/O safety #88587
* Disable RemoveZsts in generators to avoid query cycles #88979
* Disable the evaluation cache when in intercrate mode #88994
* Fix linting when trailing macro expands to a trailing semi #88996
* Don't use projection cache or candidate cache in intercrate mode #89125
* 2229: Mark insignificant dtor in stdlib #89144
* Temporarily rename int_roundings functions to avoid conflicts #89184
* [rfc 2229] Drop fully captured upvars in the same order as the regular drop code #89208
* Use the correct edition for syntax highlighting doctests #89277
* Don't normalize opaque types with escaping late-bound regions #89285
* Update Let's Encrypt ROOT CA certificate in dist-(i686|x86_64)-linux docker images #89486
Cargo update:
* - [beta] 1.56 backports (rust-lang/cargo#9958)
* - [beta] Revert "When a dependency does not have a version, git or path… (rust-lang/cargo#9912)
* - [beta] Fix rustc --profile=dev unstable check. (rust-lang/cargo#9901)
Fix Windows LLVM issue.
GitHub image 20210928.2 added LLVM 12.0.1 to the stock image. However, the `lldb` executable doesn't work, it fails with:
> C:/Program Files/LLVM/bin/lldb.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
We probably don't want to start testing LLDB on windows anyways (at least not without intent).
The hacky solution for now is to just delete the system LLVM.
The backport of #89277 needed adjustment due to another
PR (#87915 - Use smaller spans for some structured suggestions)
causing the test to have a slightly different span.
Update Let's Encrypt ROOT CA certificate in dist-(i686|x86_64)-linux docker images
The DST Root CA X3 used by Let's Encrypt has expired ([Let's Encrypt announcement](https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/)). This patch installs the new root certificate (ISRG Root X1) and disables the old one. Disabling the old one is necessary because otherwise curl still fails to download from servers with Let's Encrypt certs even though they are cross-signed.
Fixes#89484.
Don't normalize opaque types with escaping late-bound regions
Fixes#88862
Turns out, this has some really bad perf implications in large types (issue #88862). While we technically can handle them fine, it doesn't change test output either way. For now, revert with an added benchmark. Future attempts to change this back will have to consider perf.
Needs a perf run once https://github.com/rust-lang/rustc-perf/pull/1033 is merged
r? `@nikomatsakis`
Use the correct edition for syntax highlighting doctests
Previously it would unconditionally use edition 2015, which was incorrect.
Helps with https://github.com/rust-lang/rust/issues/89135 in that you can now override the doctest to be 2018 edition instead of being forced to fix the error. This doesn't resolve any of the deeper problems that rustdoc disagrees with most rust users on what a code block is.
cc `@Mark-Simulacrum`
[rfc 2229] Drop fully captured upvars in the same order as the regular drop code
Currently, with the new 2021 edition, if a closure captures all of the
fields of an upvar, we'll drop those fields in the order they are used
within the closure instead of the normal drop order (the definition
order of the fields in the type).
This changes that so we sort the captured fields by the definition order
which causes them to drop in that same order as well.
Fixesrust-lang/project-rfc-2229#42
r? `@nikomatsakis`
Temporarily rename int_roundings functions to avoid conflicts
These functions are unstable, but because they're inherent they still
introduce conflicts with stable trait functions in crates. Temporarily
rename them to fix these conflicts, until we can resolve those conflicts
in a better way.