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.
Rollup of 11 pull requests
Successful merges:
- #67761 (Move the dep_graph construction to a dedicated crate.)
- #69740 (Replace some desc logic in librustc_lint with article_and_desc)
- #69981 (Evaluate repeat expression lengths as late as possible)
- #70087 (Remove const eval loop detector)
- #70242 (Improve E0308 error message wording)
- #70264 (Fix invalid suggestion on `&mut` iterators yielding `&` references)
- #70267 (get rid of ConstPropUnsupported; use ZST marker structs instead)
- #70277 (Remove `ReClosureBound`)
- #70283 (Add regression test for #70155.)
- #70294 (Account for bad placeholder types in where clauses)
- #70309 (Clean up E0452 explanation)
Failed merges:
r? @ghost