Catch panics/unwinding in destruction of TLS values
`destroy_value` is/can be called from C code (libc). Unwinding from Rust to C code is undefined behavior, which is why unwinding is caught here.
This problem caused an infinite loop inside the unwinding code when running `src/test/ui/threads-sendsync/issue-24313.rs` on a tier 3 target (QNX/Neutrino) on aarch64.
See also https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Infinite.20unwinding.20bug.
Add regression test for #105501
The test was minified from the published crate `msf-ice:0.2.1` which failed in a crater run.
A faulty compiler was triggering a `higher-ranked lifetime error`:
> could not prove `[async block@...]: Send`
The testcase has some complexity, as it has a simplified subset of `futures::StreamExt` in it, but the error is only being triggered by a few layers of nesting. For example removing the noop `then` call would have been enough to make the error go away.
The test was minified from the published `msf-ice:0.2.1` crate which failed in a crater run.
A faulty compiler was triggering a `higher-ranked lifetime error`:
> could not prove `[async block@...]: Send`
Migrate more scraped examples CSS rules to CSS variables
It's based on https://github.com/rust-lang/rust/pull/106218 so it will need to wait for it to be merged first.
r? `@notriddle`
Respect --set=target.platform when building rustbuild itself
`--set=target.platform.cc` and `--set=target.platform.cxx` are ignored if target is quoted.
`--set=target.platform.linker` is ignored if RUSTFLAGS is not set.
Undo parts of
d1291dc8b4 and
1532fd8cd0
Rollup of 9 pull requests
Successful merges:
- #104531 (Provide a better error and a suggestion for `Fn` traits with lifetime params)
- #105899 (`./x doc library --open` opens `std`)
- #106190 (Account for multiple multiline spans with empty padding)
- #106202 (Trim more paths in obligation types)
- #106234 (rustdoc: simplify settings, help, and copy button CSS by not reusing)
- #106236 (docs/test: add docs and a UI test for `E0514` and `E0519`)
- #106259 (Update Clippy)
- #106260 (Fix index out of bounds issues in rustdoc)
- #106263 (Formatter should not try to format non-Rust files)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Avoid quoting targets that do not contain a period.
See 1532fd8cd0
`--set=target.platform.linker` is ignored if RUSTFLAGS is not set.
Undo parts of d1291dc8b4
docs/test: add docs and a UI test for `E0514` and `E0519`
No UI test on `E0514`, it would need to compile with a different `rustc` version.
r? `@GuillaumeGomez`
rustdoc: simplify settings, help, and copy button CSS by not reusing
Since there remains only one common CSS rule shared between them, there's no point to it: the block and selector costs more than the single `width` rule saves.
Provide a better error and a suggestion for `Fn` traits with lifetime params
Given `Fn`-family traits with lifetime params in trait bounds like `fn f(_: impl Fn<'a>(&'a str) -> bool)`, we currently produce many unhelpful errors.
This PR allows these situations to suggest simply using Higher-Rank Trait Bounds like `for<'a> Fn(&'a str) -> bool`.
Fixes https://github.com/rust-lang/rust/issues/103490.
Bump rust-installer
`--without=component-a,component-b` now requires full component names. This fixesrust-lang/rust#105755 (rust-lang/rust-installer#119).
dev-static build succeeded, and installer script seems to work (see comment in thread).
Powershell: Use `WaitForExit` instead of `-Wait`
Using the method `WaitForExit` instead of the parameter `-Wait` results in a notable speed up of the `x.ps1` script (~350ms, fairly consistently).
Results:
```
milliseconds before: 1127.7576
milliseconds after: 779.0467
```
I think there are opportunities for further speed up by calling `Get-Command` only once with the pattern `py*` then filtering the returned list.
But I'll leave that for another time (or someone else).
r? ``@jyn514``
Make trait/impl `where` clause mismatch on region error a bit more actionable
Improve `where` clause suggestions for GATs/methods that have incompatible region predicates in their `where` clauses.
Also addresses this diagnostic that went away https://github.com/rust-lang/rust/pull/106129#discussion_r1056875772
Improve heuristics whether `format_args` string is a source literal
Previously, it only checked whether there was _a_ literal at the span of the first argument, not whether the literal actually matched up. This caused issues when a proc macro was generating a different literal with the same span.
This requires an annoying special case for literals ending in `\n` because otherwise `println` wouldn't give detailed diagnostics anymore which would be bad.
Fixes#106191
Currently, given `Fn`-family traits with lifetime params like
`Fn<'a>(&'a str) -> bool`, many unhelpful errors show up. These are a
bit confusing.
This commit allows these situations to suggest simply using
higher-ranked trait bounds like `for<'a> Fn(&'a str) -> bool`.
kmc-solid: Fix memory ordering in thread operations
Fixes two memory ordering issues in the thread state machine (`ThreadInner::lifecycle`) of the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets.
1. When detaching a thread that is still running (i.e., the owner updates `lifecycle` first, and the child updates it next), the first update did not synchronize-with the second update, resulting in a data race between the first update and the deallocation of `ThreadInner` by the child thread.
2. When joining on a thread, the joiner has to pass its own task ID to the joinee in order to be woken up later, but in doing so, it did not synchronize-with the read operation, creating possible sequences of execution where the joinee wakes up an incorrect or non-existent task.
Both issue are theoretical and most likely have never manifested in practice because of the stronger guarantees provided by the Arm memory model (particularly due to its barrier-based definition). Compiler optimizations could have subverted this, but the inspection of compiled code did not reveal such optimizations taking place.