Optimize integral pattern matching
Various improvements to integral pattern matching. Together they reduce instruction counts for `unicode_normalization-check-clean` by about 16%.
r? @Mark-Simulacrum
Make re-export collection deterministic
Fixes https://github.com/rust-lang/rust/issues/65036
Previously, we were using an `FxHashMap` to collect module re-exports.
However, re-exports end up getting serialized into crate metadata, which
means that metadata generation was non-deterministic. This resulted in
spurious error messages changes (e.g. PR #64906) due to pretty-printing
implicitly depending on the order of re-exports when computing the
proper path to show to the user.
See #65042 for a long-term strategy to detect this kind of issue
Rollup of 18 pull requests
This contains changes from all the successful runs that bors marked as timed out, plus a revert of #63649 which appears to be the immediate cause of the timeouts.
Successful merges:
- #64708 (Stabilize `Option::as_deref` and `Option::as_deref_mut`)
- #64728 (Stabilize UdpSocket::peer_addr)
- #64765 (std: Reduce checks for `feature = "backtrace"`)
- #64909 (When encountering chained operators use heuristics to recover from bad turbofish)
- #65011 (Do not ICE when dereferencing non-Copy raw pointer)
- #65064 (permit asyncawait-ondeck to be added by anyone)
- #65066 ([const-prop] Fix ICE when trying to eval polymorphic promoted MIR)
- #65100 (Replace GeneratorSubsts with SubstsRef)
- #65105 (Split out some passes from librustc)
- #65106 (Allow unused attributes to avoid incremental bug)
- #65113 (Fix lonely backtick)
- #65116 (Remove unneeded visit_statement definition)
- #65118 (Update the documented default of -Z mutable-noalias)
- #65123 (Account for macro invocation in `let mut $pat` diagnostic.)
- #65124 (Replace some instances of `as *[const | mut] _` with `.cast()`)
- #65126 (Fix typo on `now()` comments)
- #65130 (lint: extern non-exhaustive types are improper)
- #65151 (Revert #63649 - "Upgrade Emscripten targets to use upstream LLVM backend")
Failed merges:
r? @ghost
Revert #63649 - "Upgrade Emscripten targets to use upstream LLVM backend"
This change caused the runtime of the linux-asmjs builder to nearly double from 2+ hours to about 4 hours, which happens to be the bors timeout. (It made it in barely under 4 hours when it was merged.) This is causing timeouts on all new changes.
This reverts commit 7870050796e5904a0fc85ecbe6fa6dde1cfe0c91, reversing
changes made to 2e7244807a7878f6eca3eb7d97ae9b413aa49014.
lint: extern non-exhaustive types are improper
This PR makes the `improper_ctype` lint trigger for non-exhaustive types when those types aren't defined in the current crate, as per [this comment](https://github.com/rust-lang/rust/issues/44109#issuecomment-537583344).
cc @Centril
Fix typo on `now()` comments
Fix typo, update words, and remove some redundant word.
Also rustfmt on the rest of the file (hope this is okay :)
revival of #61433
r? @kennytm
Split out some passes from librustc
This is just moving them out to librustc_passes -- I've not measured compile time or run time. I don't expect any significant impact, but this seems prudent regardless.
std: Reduce checks for `feature = "backtrace"`
This is a stylistic change to libstd to reduce the number of checks of
`feature = "backtrace"` now that we unconditionally depend on the
`backtrace` crate and rely on it having an empty implementation.
otherwise.
Stabilize `Option::as_deref` and `Option::as_deref_mut`
The tracking issue https://github.com/rust-lang/rust/issues/50264 still has unresolved question for the corresponding `Result` methods.
Previously, we were using an `FxHashMap` to collect module re-exports.
However, re-exports end up getting serialized into crate metadata, which
means that metadata generation was non-deterministic. This resulted in
spurious error messages changes (e.g. PR #64906) due to pretty-printing
implicitly depending on the order of re-exports when computing the
proper path to show to the user.
See #65042 for a long-term strategy to detect this kind of issue
This commit makes the `improper_ctype` lint trigger for non-exhaustive
types when those types aren't defined in the current crate.
Signed-off-by: David Wood <david@davidtw.co>
Upgrade Emscripten targets to use upstream LLVM backend
- Refactors the Emscripten target spec to share code with other wasm
targets.
- Replaces the incorrect wasm32 C call ABI with the old asmjs
version, which is correct for both wasm32 and JS.
- Updates the varargs ABI used by Emscripten and deletes the old one.
- Removes the obsolete wasm32-experimental-emscripten target.
- Temporarily makes Emscripten targets use panic=abort by default
because supporting unwinding will require an LLVM patch.
Fix rustdoc display with js disabled
Fixes#64988.
Currently, all sections are collapsed when the page is loading, and then is displayed once done. However, if js is disabled, they never get expanded. Therefore, they need to be shown by default.
r? @Mark-Simulacrum