Prepare for LLVM 10 upgrade
This is #67759 minus the submodule update.
* Fix two compatibility issues in the rustllvm wrapper.
* Update data layout strings in tests.
* Fix LLVM version comparison (this become a problem because the major version has two digits now).
r? @cuviper
Rollup of 8 pull requests
Successful merges:
- #68884 (Make the `type_of` return a generic type for generators)
- #69788 (Fix sequence of Type and Trait in optin-builtin-traits in Unstable Book)
- #70074 (Expand: nix all fatal errors)
- #70077 (Store idents for `DefPathData` into crate metadata)
- #70213 (traits/fulfill: allow `stalled_on` to track `ty::Const::Infer(_)` (unused yet).)
- #70259 (Use Reveal::All in MIR optimizations)
- #70284 (correctly handle const params in type_of)
- #70289 (Refactor `codegen`)
Failed merges:
r? @ghost
Refactor `codegen`
`codegen` in `src/librustc_codegen_llvm/back/write.rs` is long and has complex control flow. These commits refactor it and make it easier to understand.
traits/fulfill: allow `stalled_on` to track `ty::Const::Infer(_)` (unused yet).
This PR addresses the representation side of #70180, but only *actually collects* `ty::Infer`s via `Ty::walk` into `stalled_on` (collecting `ty::ConstKind::Infer`s requires #70164).
However, it should be enough to handle #70107's needs (WF obligations are stalled only on the outermost type/const being an inference variable, no `walk`-ing is involved).
This is my second attempt, see #70181 for the previous one, which unacceptably regressed perf.
r? @nikomatsakis cc @nnethercote
Store idents for `DefPathData` into crate metadata
Previously, we threw away the `Span` associated with a definition's
identifier when we encoded crate metadata, causing us to lose location
and hygiene information.
We now store the identifier's `Span` in a side table, which gets encoded
into the crate metadata. When we decode items from the metadata, we
combine the name and span back into an `Ident`.
This improves the output of several tests, which previously had messages
suppressed due to dummy spans.
This is a prerequisite for #68686, since throwing away a `Span` means
that we lose hygiene information.
Expand: nix all fatal errors
Basically, we go after all `.span_fatal` / `FatalError.raise()` and similar things and remove them one by one until there are no fatal errors left.
r? @petrochenkov
Fix sequence of Type and Trait in optin-builtin-traits in Unstable Book
A simple fix in docs - the sequence of words in basic example of negative trait implementation was reversed.
Explicitly requests the "-Z unstable-options" flag if someone attempts to use
a cargo option gated by it. This enhances discoverability, particularly in the
instance where the user is on the nightly compiler but isn't using the flag.
`-C incremental` was introduced over two years ago. `-Z incremental` was
kept for transitioning, but it's been long enough now that it should be
ok to remove it.
Because it uses `parse_bool` and defaults to true, it is actually
impossible to set it to false. Inverting its sense to `-Z
no-generate-arange-section` makes it usable.