Increase `Span` from 4 bytes to 8 bytes.
This increases the size of some important types, such as `ast::Expr` and
`mir::Statement`. However, it drastically reduces how much the interner
is used, and the fields are more natural sizes that don't require bit
operations to extract.
As a result, instruction counts drop across a range of workloads, by as
much as 10% for `script-servo` incremental builds.
Peak memory usage goes up a little for some cases, but down by more for
some other cases -- as much as 18% for non-incremental builds of
`packed-simd`.
The commit also:
- removes the `repr(packed)`, because it has negligible effect, but can
cause undefined behaviour;
- replaces explicit impls of common traits (`Copy`, `PartialEq`, etc.)
with derived ones.
r? @petrochenkov
Revert "compile crates under test w/ -Zemit-stack-sizes"
Revert PR #59401 to fix issue #59652 (a stable-to-beta regression).
This is result of squashing two revert commits:
Revert "compile all crates under test w/ -Zemit-stack-sizes"
This reverts commit 7d365cf27f.
Revert "bootstrap: build compiler-builtins with -Z emit-stack-sizes"
This reverts commit 8b8488ce8f.
----
(My intention is that someone can re-add this code again later, either after the `ld.gold` issue itself is fixed, or with safe-guards to check whether `ld.gold` is in use and then issuing warnings about the problems here when they arise.)
Clean up handling of `-Z pgo-gen` commandline option.
This PR adapts the `-Z pgo-gen` flag to how Clang and GCC handle the corresponding `-fprofile-generate` flag. In particular, the flag now optionally takes a directory to place the profiling data in and allows to omit the argument (instead of having to pass an empty string).
Exclude profiler-generated symbols from MSVC __imp_-symbol workaround.
LLVM's profiling instrumentation adds a few symbols that are used by the profiler runtime. Since these show up as globals in the LLVM IR, the compiler generates `dllimport`-related `__imp_` stubs for them. This can lead to linker errors because the instrumentation symbols have weak linkage or are in a comdat section, but the `__imp_` stubs aren't.
Instead of trying to replicate the linkage/comdat setup for the stubs, this PR just excludes the profiler-related symbols from stub-generation since they aren't supposed to be referenced via `__declspec(dllimport)` anywhere anyway.
r? @alexcrichton
EDIT: I considered making this more general, i.e. inferring from the symbol name if it is a Rust symbol or not. But then I figured out that that would yield false negatives for `#[no_mangle]` et al, so I went with a blacklist approach.
Exclude some copies of old book editions from search engines
These are only stubs that confuse search engine users. There's no useful content in these locations.
std: Add `{read,write}_vectored` for more types
This commit implements the `{read,write}_vectored` methods on more types
in the standard library, namely:
* `std::fs::File`
* `std::process::ChildStd{in,out,err}`
* `std::io::Std{in,out,err}`
* `std::io::Std{in,out,err}Lock`
* `std::io::Std{in,out,err}Raw`
Where supported the OS implementations hook up to native support,
otherwise it falls back to the already-defaulted implementation.
Use normal newtype_index macro for MIR dataflows
* Makes the definition of these structs contain `struct IndexName`
* Avoids having an offset by removing high values, rather than 0
* Implements some traits for us.
Use measureme in self profiler
r? @michaelwoerister
~Changes are still very rough.~
~I'm not sure what the right way to add the `measureme` dependency is. Currently it's just added with a relative path which Works On My Machine ™️.~
I'm also not sure what to do with the category data.
Rollup of 8 pull requests
Successful merges:
- #59781 (Remove check_match from const_eval)
- #59820 (proc_macro: stop using LEB128 for RPC.)
- #59846 (clarify what the item is in "not a module" error)
- #59847 (Error when using `catch` after `try`)
- #59859 (Suggest removing `?` to resolve type errors.)
- #59862 (Tweak unstable diagnostic output)
- #59866 (Recover from missing semicolon based on the found token)
- #59892 (Impl RawFd conversion traits for WASI TcpListener, TcpStream and UdpSocket)
Failed merges:
r? @ghost
Recover from missing semicolon based on the found token
When encountering one of a few keywords when a semicolon was
expected, suggest the semicolon and recover:
```
error: expected one of `.`, `;`, `?`, or an operator, found `let`
--> $DIR/recover-missing-semi.rs:4:5
|
LL | let _: usize = ()
| - help: missing semicolon here
LL |
LL | let _ = 3;
| ^^^
error[E0308]: mismatched types
--> $DIR/recover-missing-semi.rs:2:20
|
LL | let _: usize = ()
| ^^ expected usize, found ()
|
= note: expected type `usize`
found type `()`
```