Do not attempt to ascribe projections out of a ty var
If we encounter `_` ascribed to structural pattern like `(a, b)`, just skip relate_types.
Fix#55552
Bubble up an overflow error so that rustdoc can ignore it
fixes#54524
Idk how to write a test for this, other than trying to minimize the entire diesel crate. If desirable I will do that.
Note that there are many other such overflow errors hiding out there. Should we try to proactively eliminate them or do we just whack-a-mole them?
cc @GuillaumeGomez
r? @nikomatsakis
When I fixed the previous mis-optimizations, I didn't realize there were
actually two different places where we mutate `callsites` and both of
them should have the same behavior.
As a result, if a function was inlined and that function contained
virtual function calls, they were incorrectly being inlined. I also
added a test case which covers this.
Update emscripten
This updates emscripten to 1.38.15, which is based on LLVM 6.0.1 and would allow us to drop code for handling LLVM 4.
The main issue I ran into is that exporting statics through `EXPORTED_FUNCTIONS` no longer works. As far as I understand exporting non-functions doesn't really make sense under emscripten anyway, so I've modified the symbol export code to not even try.
Closes#52323.
Rollup of 17 pull requests
Successful merges:
- #55576 (Clarify error message for -C opt-level)
- #55633 (Support memcpy/memmove with differing src/dst alignment)
- #55638 (Fix ICE in msg_span_from_free_region on ReEmpty)
- #55659 (rustc: Delete grouping logic from the musl target)
- #55719 (Sidestep link error from rustfix'ed code by using a *defined* static.)
- #55736 (Elide anon lifetimes in conflicting impl note)
- #55739 (Consume optimization fuel from the MIR inliner)
- #55742 (Avoid panic when matching function call)
- #55753 (borrow_set: remove a helper function and a clone it uses)
- #55755 (Improve creation of 3 IndexVecs)
- #55758 ([regression - rust2018]: unused_mut lint false positives on nightly)
- #55760 (Remove intermediate font specs)
- #55761 (mir: remove a hacky recursive helper function)
- #55774 (wasm32-unknown-emscripten expects the rust_eh_personality symbol)
- #55777 (Use `Lit` rather than `P<Lit>` in `ast::ExprKind`.)
- #55783 (Deprecate mpsc channel selection)
- #55788 (rustc: Request ansi colors if stderr isn't a tty)
Failed merges:
r? @ghost
rustc: Request ansi colors if stderr isn't a tty
Currently Cargo will always capture the output of rustc meaning that
rustc is never hooked up to a tty. To retain colors Cargo uses the
`fwdansi` crate to ensure that ansi color codes are translated to
windows terminal methods (and ansi codes otherwise just go their natural
route on Unix).
Cargo passes `--color always` to rustc to ensure that using a pipe
doesn't trick it into not emitting colors at all. It turns out, however,
that `--color always` ends up still accidentally using the native shell
api on native windows shells.
The fix here is to instead pass `AlwaysAnsi` to `termcolor` instead of
`Always`, ensuring that when `--color always` is passed to rustc and its
output isn't a terminal, we're always generating ansi colors regardless
of the platform.
Closes#55769
wasm32-unknown-emscripten expects the rust_eh_personality symbol
The `wasm32-unknown-emscripten` expects the `rust_eh_personality` symbol to be there, but a cfg checking for `target_arch = "wasm32"` which was meant to remove the symbol from the `wasm32-unknown-unknown` target, didn't check for whether `emscripten` is targeted or not, so the symbol accidentally got filtered out there as well.
Fixes#55276
Remove intermediate font specs
This is a (much) more constrained version of #54772 that also aims at improving the situation in #34681. It removes any font specifications that are not the "official" rustdoc font, and instead relies on the browser to provide the fallback font if the official on is not available. On Linux systems, this is particularly important, as fonts like Helvetica, Arial, and Times often look pretty bad since they're pulled from extracted MS fonts. A specification like `serif` or `sans-serif` lets the browser instead choose a good font.
[regression - rust2018]: unused_mut lint false positives on nightly
Fixes#55344.
This commit filters out locals that have never been initialized for
consideration in the `unused_mut` lint.
This is intended to detect when the statement that would have
initialized the local was removed as unreachable code. In these cases,
we would not want to lint. This is the same behaviour as the AST borrow
checker.
This is achieved by taking advantage of an existing pass over the MIR
for the `unused_mut` lint and creating a set of those locals that were
never initialized.
r? @pnkfelix
Avoid panic when matching function call
Fix#55718
This bug is introduced by #53751. The original code checked `Def::AssociatedConst(..) | Def::Method(..)` before `pat_ty.no_bound_vars().expect("expected fn type")`. But somehow I exchanged the sequence carelessly. Sorry about that.
r? @petrochenkov
Consume optimization fuel from the MIR inliner
This makes it easier to debug mis-optimizations that occur during
inlining. Thanks to @nikomatsakis for the suggestion!