GitHub Actions: preparations, part 1
This PR adds the first batch of commits in preparation for GitHub Actions:
* Added GitHub Actions support in `src/ci/shared.sh` and bootstrap.
* Addded a `setup-environment.sh` script which guesses and sets the `DEPLOY`, `DEPLOY_ALT` and `IMAGE` environment variables automatically, to reduce the verbosity of the CI configuration.
This PR does **not** yet add any builders on GitHub Actions.
r? @alexcrichton
Add unix::process::CommandExt::arg0
This allows argv[0] to be overridden on the executable's command-line. This also makes the program
executed independent of argv[0].
Does Fuchsia have the same semantics? I'm assuming so.
Addresses: #66510
Preserve whitespace inside one-backtick codeblocks
Previously this was only done inside short docblocks (e.g., summary
lines), but we should also do so in general.
Fixes#65555
Use proc-macro to derive HashStable everywhere
Hello,
A second proc-macro is added to derive HashStable for crates librustc depends on.
This proc-macro `HashStable_Generic` (to bikeshed) allows to decouple code and strip much of librustc's boilerplate.
Still, two implementations `Span` and `TokenKind` require to be placed in librustc.
The latter only depends on the `bug` macro. Advise welcome on how to sever that link.
A trait `StableHasingContextLike` has been introduced at each crate root,
in order to handle those implementations which require librustc's very `StableHashingContext`.
This overall effort allowed to remove the `impl_stable_hash_for` macro.
Each commit passes the `x.py check`.
I still have to double check there was no change in the implementation.
Ast address-of
This is the parts of #64588 that don't affect MIR. If an address-of expression makes it to MIR lowering we error and lower to the best currently expressible approximation to limit further errors.
r? @Centril
Rework raw ident suggestions
Use heuristics to determine whethersuggesting raw identifiers is
appropriate.
Account for raw identifiers when printing a path in a `use` suggestion.
Fix#66126.
introduce benchmarks of HashSet operations
To avoid goofs such as corrected by #66280, I added benchmarks of binary HashSet operations.
Due to the fact x.py keeps recompiling the whole shebang (or at least a big part of it) whenever you touch the test code, and because piling up all tests in one file does not strike me as future proof, I tried moving the hash benches to the separate place they are for liballoc/collections/btree. But it turns out that, in a cleaned checkout, x.py still recompiles the whole shebang whenever you touch the test code (PS or when you add or delete any irrelevant file). So I'm not going to add more tests, and I doubt others will, and these tests have proven their point already, so this PR is kind of pointless
Fix cycle when debug-printing opaque types
Fixes#61577
When printing an opaque type in non-verbose mode, we use the
`tcx.predicates_of` query to retrieve the opaque type's bounds for
pretty-printing. However, the pervasiveness of logging within librustc
means that we may already be executing `tcx.predicates_of` for the
opaque type we're trying to print, leading to a cycle error.
This commit adds a new 'no queries' thread-local flag to the pretty
printer. This flag is enabled during the computation of `predicates_of`
for opaque types, and causes us to print the opaque type in 'verbose'
mode (which does not require computing any additinal queries). This
should only affect debug logging for highly nested log messages, not any
user-visible output.
Scope format! temporaries
This places the temporaries that `format!` generates to refer to its arguments (through `&dyn Trait`) in a short-lived scope surrounding just the invocation of `format!`. This enables `format!` to be used in generators without the temporaries preventing the generator from being `Send` (due to `dyn Trait` not being `Sync`).
See rust-lang/rust#64477 for details.
Rollup of 5 pull requests
Successful merges:
- #61351 (Stabilize cfg(doc))
- #66539 (Point at type in `let` assignment on type errors)
- #66655 (rustdoc: Mark `--extern-private` as unstable)
- #66657 (rustdoc: Don't panic when failing to write .lock file)
- #66673 (Move def collector from `rustc` to `rustc_resolve`)
Failed merges:
r? @ghost
Move def collector from `rustc` to `rustc_resolve`
It's used only from `rustc_resolve`, so we can move it there, thus reducing the size of `rustc` (https://github.com/rust-lang/rust/issues/65031).
It's quite possible that we can merge the def collector pass into the "build reduced graph" pass (they are always run together and do similar things), but it's some larger work.
r? @eddyb
rustdoc: Don't panic when failing to write .lock file
It can be treated like any other unexpected IO error.
I couldn't think of a good way to add a test for this unfortunately.
r? @GuillaumeGomez
debuginfo: Support for std::collections::Hash* in windows debuggers.
Okay, I finally needed to debug code involving a HashMap! Added support for HashSet s as well.
r? @michaelwoerister
### Local Testing
Verified these are passing locally:
```cmd
:: cmd.exe
python x.py test --stage 1 --build x86_64-pc-windows-msvc src/test/debuginfo
python x.py test --stage 1 --build i686-pc-windows-msvc src/test/debuginfo
python x.py test --stage 1 src/tools/tidy
:: MinGW MSYS2
./x.py test --stage 1 --build x86_64-pc-windows-gnu src/test/debuginfo
```
### Related Issues
* https://github.com/rust-lang/rust/issues/36503
* https://github.com/rust-lang/rust/issues/40460
* https://github.com/rust-gamedev/wg/issues/20