Handle projection predicates in the param env for auto-trait docs
Fixes#72213
Any predicates in the param env are guaranteed to hold, so we don't need
to do any additional processing of them if we come across them as
sub-obligations of a different predicate. This allows us to avoid adding
the same predicate to the computed ParamEnv multiple times (but with
different regions each time), which causes an ambiguity error during
fulfillment.
Rollup of 9 pull requests
Successful merges:
- #74521 (older toolchains not valid anymore)
- #74960 (Fix regionck failure when converting Index to IndexMut)
- #75234 (Update asm! documentation in unstable book)
- #75368 (Move to doc links inside the prelude)
- #75371 (Move to doc links inside std/time.rs)
- #75394 (Add a function to `TyCtxt` for computing an `Allocation` for a `static` item's initializer)
- #75395 (Switch to intra-doc links in library/std/src/os/*/fs.rs)
- #75422 (Accept more safety comments)
- #75424 (fix wrong word in documentation)
Failed merges:
r? @ghost
fix wrong word in documentation
Change "two" to "three", since there are three significantly different things printed below that sentence:
---
While these:
```rust
println!("{}, `{name:.*}` has 3 fractional digits", "Hello", 3, name=1234.56);
println!("{}, `{name:.*}` has 3 characters", "Hello", 3, name="1234.56");
println!("{}, `{name:>8.*}` has 3 right-aligned characters", "Hello", 3, name="1234.56");
```
print two significantly different things:
``` rust
Hello, `1234.560` has 3 fractional digits
Hello, `123` has 3 characters
Hello, ` 123` has 3 right-aligned characters
```
---
[`https://doc.rust-lang.org/std/fmt/#precision`](https://doc.rust-lang.org/std/fmt/#precision)
Accept more safety comments
This accepts more `// SAFETY:` comments from `tidy`.
This is done after the current behaviour of requiring text one the same line (because spaces are stripped so the last space never pass if there is no text on the same line) bit me once more in #75066
This could potentially accept empty `// SAFETY:` comments but `tidy` is an internal tool used only here so my reasoning is reviews will catch those.
Fix regionck failure when converting Index to IndexMut
Fixes#74933
Consider an overloaded index expression `base[index]`. Without knowing whether it will be mutated, this will initially be desugared into `<U as Index<T>>::index(&base, index)` for some `U` and `T`. Let `V` be the `expr_ty_adjusted` of `index`.
If this expression ends up being used in any mutable context (or used in a function call with `&mut self` receiver before #72280), we will need to fix it up. The current code will rewrite it to `<U as IndexMut<V>>::index_mut(&mut base, index)`. In most cases this is fine as `V` will be equal to `T`, however this is not always true when `V/T` are references, as they may have different region.
This issue is quite subtle before #72280 as this code path is only used to fixup function receivers, but after #72280 we've made this a common path.
The solution is basically just rewrite it to `<U as IndexMut<T>>::index_mut(&mut base, index)`. `T` can retrieved in the fixup path using `node_substs`.
older toolchains not valid anymore
with the change to llvm 10 the parameter
LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN do not do anything as min and soft error is the same.
see 86b120e6f3/llvm/cmake/modules/CheckCompilerVersion.cmake
A few updates:
- Some minor wording and formatting changes.
- Remove the `cargo` column.
- Explain the columns up-front.
- Add no-wrap on the target-triple, which looks better to me.
- Minor mention on how to install support for a built-in target via rustup.
Reland #74069
Investigation in #74716 has concluded that this PR is indeed not a regression (and in fact the rollup itself is not either).
This reverts the revert in #74611.
r? @nnethercote cc @eddyb