Rollup of 6 pull requests
Successful merges:
- #65949 (Move promotion into its own pass)
- #65994 (Point at where clauses where the associated item was restricted)
- #66050 (Fix C aggregate-passing ABI on powerpc)
- #66134 (Point at formatting descriptor string when it is invalid)
- #66172 (Stabilize @file command line arguments)
- #66226 (add link to unstable book for asm! macro)
Failed merges:
r? @ghost
Point at formatting descriptor string when it is invalid
When a formatting string contains an invalid descriptor, point at it
instead of the argument:
```
error: unknown format trait `foo`
--> $DIR/ifmt-bad-arg.rs:86:17
|
LL | println!("{:foo}", 1);
| ^^^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
```
Fix C aggregate-passing ABI on powerpc
The existing code (which looks like it was copied from MIPS) passes
aggregates by value in registers. This is wrong. According to the SVR4
powerpc psABI, all aggregates are passed indirectly.
See #64259 for more discussion, which addresses the ABI for the special
case of ZSTs (empty structs).
Move promotion into its own pass
**edited**
This adds a `PromoteTemps` pass, which runs after the old `QualifyAndPromoteConsts` pass, that *only* does promotion (no const-checking). Everything related to promotion has been removed from `QualifyAndPromoteConstants`: it no longer even visits the body of a non-const `fn`.
As a result we no longer need to keep the `BitSet` of promotable locals that was returned by `mir_const_qualif`. Rvalue-static promotion in a `const` is now done in `promote_consts`, and it operates on a set of `Candidate`s instead. This will allow me–in a later PR–to create promoted MIR fragments for `const`s when necessary, which could resolve some shortcomings of the current approach (removing `StorageDead`).
r? @eddyb
Update Clang & build MSVC LLVM with it
This is a general update of our builders to Clang 9, and then it also attempts to tackle a bit of #66192 by building LLVM for rustc with Clang, not with the system `cl.exe` on MSVC.
We bailed out of `QualifyAndPromoteConsts` immediately if the
`min_const_fn` checks failed, which sometimes resulted in additional,
spurious errors since promotion was skipped.
We now do promotion in a completely separate pass, so this is no longer
an issue.
One of the links in the docs was being rendered as a literal
open-bracket followed by a single quote, instead of being transformed
into a link. Fix it to match the link earlier in the same paragraph.
Rollup of 5 pull requests
Successful merges:
- #65785 (Transition future compat lints to {ERROR, DENY} - Take 2)
- #66007 (Remove "here" from "expected one of X here")
- #66043 (rename Memory::get methods to get_raw to indicate their unchecked nature)
- #66154 (miri: Rename to_{u,i}size to to_machine_{u,i}size)
- #66188 (`MethodSig` -> `FnSig` & Use it in `ItemKind::Fn`)
Failed merges:
r? @ghost
`MethodSig` -> `FnSig` & Use it in `ItemKind::Fn`
In both AST & HIR, rename `MethodSig` to `FnSig` and then proceed to use it in `ItemKind::Fn` so that the overall structure is more regular.
r? @davidtwco
miri: Rename to_{u,i}size to to_machine_{u,i}size
Having a function `to_usize` that does not return a (host) usize is somewhat confusing, so let's rename it.
r? @oli-obk
rename Memory::get methods to get_raw to indicate their unchecked nature
Some recent Miri PRs started using these methods when they should not; this should discourage their use.
In fact we could make these methods private to the `interp` module as far as Miri is concerned -- with the exception of the `uninit` intrinsic which will hopefully go away soon. @bjorn3 @oli-obk does priroda need these methods? It would be great to be able to seal them away.
Remove promotion candidate gathering and checking from `qualify_consts.rs`
This makes promotion candidate gathering and checking the exclusive domain of `promote_consts`, but the `QualifyAndPromoteConsts` pass is still responsible for both const-checking and creating promoted MIR fragments.
This should not be merged until the beta branches on Nov. 5.
r? @eddyb
Rollup of 8 pull requests
Successful merges:
- #65554 (Enhance the documentation of BufReader for potential data loss)
- #65580 (Add `MaybeUninit` methods `uninit_array`, `slice_get_ref`, `slice_get_mut`)
- #66049 (consistent handling of missing sysroot spans)
- #66056 (rustc_metadata: Some reorganization of the module structure)
- #66123 (No more hidden elements)
- #66157 (Improve math log documentation examples)
- #66165 (Ignore these tests ,since the called commands doesn't exist in VxWorks)
- #66190 (rustc_target: inline abi::FloatTy into abi::Primitive.)
Failed merges:
- #66188 (`MethodSig` -> `FnSig` & Use it in `ItemKind::Fn`)
r? @ghost
rustc_target: inline abi::FloatTy into abi::Primitive.
This effectively undoes a small part of @oli-obk's #50967, now that the rest of the compiler doesn't use the `FloatTy` definition from `rustc_target`, post-#65884.
Improve math log documentation examples
using 2.0.log(2.0) in examples does not make it clear which is the base and number. This example makes it clear for programmers who take a glance at the example by following the calculation. It is more intuitive, and eliminates the need for executing the example in the playground.