Rollup of 7 pull requests
Successful merges:
- #106200 (Suggest `impl Fn*` and `impl Future` in `-> _` return suggestions)
- #106274 (Add JSON output to -Zdump-mono-stats)
- #106292 (Add codegen test for `Box::new(uninit)` of big arrays)
- #106327 (Add tidy check for dbg)
- #106361 (Note maximum integer literal for `IntLiteralTooLarge`)
- #106396 (Allow passing a specific date to `bump-stage0`)
- #106436 (Enable doctests for rustc_query_impl)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Allow passing a specific date to `bump-stage0`
This allows regenerating `src/stage0.json` on changes to the tool, without needing to hard-code the date in the source. It was useful for https://github.com/rust-lang/rust/pull/106394, which added clippy to the list of required components.
r? `@pietroalbini`
Suggest `impl Fn*` and `impl Future` in `-> _` return suggestions
Follow-up to #106172, only the last commit is relevant. Can rebase once that PR is landed for easier review.
Suggests `impl Future` and `impl Fn{,Mut,Once}` in `-> _` return suggestions.
r? `@estebank`
layout_of: `T: Thin` implies `sizeof(&T) == sizeof(usize)`
Use the `<T as Pointee>::Metadata` associated type to calculate the layout of a pointee's metadata, instead of hard-coding rules about certain types.
Maybe this approach is overkill -- we could instead hard-code this approach as a fallback, with the matching on `Slice`/`Dynamic`/etc. happening first
Fixes this issue here https://github.com/rust-lang/rust/pull/104338#issuecomment-1312595844 .. But is also useful with transmutes, for example, given the UI test I added below.
rustdoc: remove legacy font-feature-settings CSS
According to [caniuse], these vendor prefixes aren't needed in any supported web browsers as defined in [RFC 1985].
* The last version of Chrome that required a vendor prefix was version 47. The current version is 108.
* Firefox 33 is the last version that required a vendor prefix. The [current Firefox ESR] is version 102.
* The last version of Safari that required a vendor prefix was version 9.1. The current version is 16.
* The last version of Safari/iOS that required a vendor prefix was version 9.3. The current version is 16.
* Edge never required vendor prefixes.
* UCAndroid never required vendor prefixes.
[caniuse]: https://caniuse.com/?search=font-feature-settings
[RFC 1985]: https://rust-lang.github.io/rfcs/1985-tiered-browser-support.html
[current Firefox ESR]: https://wiki.mozilla.org/Releases
Jsondoclint: Add `--verbose` and `--json-output` options
There quite helpful for manually using jsondoclint as a debugging tool, especially on large files (these were written to look into core.json).
r? rustdoc
default OOM handler: use non-unwinding panic, to match std handler
The OOM handler in std will by default abort. This adjusts the default in liballoc to do the same, using the `can_unwind` flag on the panic info to indicate a non-unwinding panic.
In practice this probably makes little difference since the liballoc default will only come into play in no-std situations where people write a custom panic handler, which most likely will not implement unwinding. But still, this seems more consistent.
Cc `@rust-lang/wg-allocators,` https://github.com/rust-lang/rust/issues/66741
Simplify some iterator combinators
Saw a `flat_map().next()` instead of a `find_map()` in some method probe code, so did a quick search for some similar usages.
Ensure `lld` is supported with `download-ci-llvm`
This PR:
- ensures LLD's step in bootstrap's dist, but it's not strictly necessary since dist will already package it when it's present.
- makes bootstrap's `native::LLD` step support using the packaged `ci-llvm/bin/lld`, instead of building it from source (which would most likely not be available today, nor in the future where `download-ci-llvm = if-available` is the default).
If I understand correctly, `--enable-full-tools` will also enable `rust.lld`, and this is why LLD is already packaged today in the `rust-dev` component on the main targets (and why `-Zgcc-ld=lld` does work there).
That means it's likely that this PR will not be able to land before I've reworked and landed #101792: if LLD is available in `download-ci-llvm`, the `needs-rust-lld` tests should start being executed on the x64 macOS test builders, and CI would fail today.
I've tested locally that building with `download-ci-llvm = true` and `lld = true` with the LLVM submodule unregistered was successful, and that `rust-lld` and the various `lld-wrapper`s are present and `-Zgcc-ld=lld` works as well, on a few different platforms:
- `x86_64-unknown-linux-gnu`
- `aarch64-apple-darwin`
- `x86_64-pc-windows-msvc` (with `-Clinker=rust-lld` rather than `-Zgcc-ld=lld`)
- `x86_64-apple-darwin`, with the `MACOSX_DEPLOYMENT_TARGET` workaround for #101653
I don't think we really need to bump the `download-ci-llvm-stamp` in this case, since `./build/$triple/ci-llvm/bin/lld` is present on all the above targets already, but have added it mechanically, and it should probably be removed to avoid unnecessary downloads/churn.
Fixes#98340
Supersedes #100010
Previously it was not clear why this errored or if it was even supported, as there was no
diagnostic that suggested wrapping it in braces.
Thus, add a simple diagnostic that suggests wrapping enum variants in braces.
Refactoring report_method_error
While working on #105732, I found it's hard to follow this long function,
so I tried to make it shorter.
It's not easy for code reviewing, since so many lines of code changes,
but only the positions are changed.
Generally, I extract two sub-methods from `report_method_error`:
397b66e77b/compiler/rustc_hir_typeck/src/method/suggest.rs (L117)
to `note_candidates_on_method_error`
And this long block:
397b66e77b/compiler/rustc_hir_typeck/src/method/suggest.rs (L263)
to `report_no_match_method_error`.
r? `@compiler-errors`
- Remove unnecessary references and dereferences
- Use `.contains` instead of `a <= x && x <= b`
- Use `mem::take` instead of `mem::replace` where possible
According to [caniuse], these vendor prefixes aren't needed in any supported
web browsers as defined in [RFC 1985].
* The last version of Chrome that required a vendor prefix was version 47.
The current version is 108.
* Firefox 33 is the last version that required a vendor prefix. The
[current Firefox ESR] is version 102.
* The last version of Safari that required a vendor prefix was version 9.1.
The current version is 16.
* The last version of Safari/iOS that required a vendor prefix was version
9.3. The current version is 16.
* Edge never required vendor prefixes.
* UCAndroid never required vendor prefixes.
[caniuse]: https://caniuse.com/?search=font-feature-settings
[RFC 1985]: https://rust-lang.github.io/rfcs/1985-tiered-browser-support.html
[current Firefox ESR]: https://wiki.mozilla.org/Releases