Rollup of 11 pull requests
Successful merges:
- #60802 (upgrade rustdoc's `pulldown-cmark` to 0.5.2)
- #60839 (Fix ICE with struct ctors and const generics.)
- #60850 (Stabilize RefCell::try_borrow_unguarded)
- #61231 (Fix linkage diagnostic so it doesn't ICE for external crates)
- #61244 (Box::into_vec: use Box::into_raw instead of mem::forget)
- #61279 (implicit `Option`-returning doctests)
- #61280 (Revert "Disable solaris target since toolchain no longer builds")
- #61284 (Update all s3 URLs used on CI with subdomains)
- #61321 (libsyntax: introduce 'fn is_keyword_ahead(dist, keywords)'.)
- #61322 (ci: display more debug information in the init_repo script)
- #61333 (Fix ICE with APIT in a function with a const parameter)
Failed merges:
- #61304 (Speed up Azure CI installing Windows dependencies)
r? @ghost
* rename AllocKind -> GlobalAlloc. This stores the allocation itself, not just its kind.
* rename the methods that allocate stuff to have consistent names.
libsyntax: introduce 'fn is_keyword_ahead(dist, keywords)'.
Introduces:
```rust
/// Returns whether any of the given keywords are `dist` tokens ahead of the current one.
fn is_keyword_ahead(&self, dist: usize, kws: &[Symbol]) -> bool {
self.look_ahead(dist, |t| kws.iter().any(|&kw| t.is_keyword(kw)))
}
```
r? @oli-obk
Update all s3 URLs used on CI with subdomains
Ensure that they're all forwards-compatible with AWS updates happening
next year by ensuring the bucket name shows up in the domain name.
Closes#61168
implicit `Option`-returning doctests
This distinguishes `Option` and `Result`-returning doctests with implicit `main` method, where the former tests must end with `Some(())`.
Open question: Does this need a feature gate?
r? @GuillaumeGomez
Box::into_vec: use Box::into_raw instead of mem::forget
`Box::into_raw` does, in one step, turn the `Box` into a raw ptr and avoid deallocation. Seems cleaner than separating the two.
Also, `mem::forget` gets the `Box` with a `noalias` argument, but it is not actually correct that this is an exclusive pointer. So a stricter version of Stacked Borrows would complain here. (I can't actually make Stacked Borrows that strict yet though due to other issues.)
Fix linkage diagnostic so it doesn't ICE for external crates
Fix linkage diagnostic so it doesn't ICE for external crates
(As a drive-by improvement, improved the diagnostic to indicate *why* `*const T` or `*mut T` is required.)
Fix#59548Fix#61232
Emit error when trying to use PGO in conjunction with unwinding on Windows.
This PR makes `rustc` emit an error when trying use PGO in conjunction with `-Cpanic=unwind` on Windows, isn't supported by LLVM yet. The error messages points to https://github.com/rust-lang/rust/issues/61002, which documents this known limitation.
ci: Attempt to skip a full rustc compile on dist*
Currently when we're preparing cross-compiled compilers it can take
quite some time because we have to build the compiler itself three
different times. The first is the normal bootstrap, the second is a
second build for the build platform, and the third is the actual target
architecture compiler. The second compiler was historically built
exclusively for procedural macros, and long ago we didn't actually need
it.
This commit tries out avoiding that second compiled compiler, meaning we
only compile rustc for the build platform only once. Some local testing
shows that this is promising, but bors is of course the ultimate test!
It's a hot function that returns a 2-tuple, but the hottest call site
(`hygienic_eq`) discards the second element.
This commit renames `adjust_ident` as `adjust_ident_and_get_scope`, and
then introduces a new `adjust_ident` that only computes the first
element. This change also avoids the need to pass in an unused
`DUMMY_HIR_ID` argument in a couple of places, which is nice.
The name `swap_default` was suggested but rejected. @SimonSapin observed
that this operation isn't really a `swap` in the same sense as
`mem::swap`; it is a `replace`. Since `replace_default` is a bit
misleading, the "correct" name would be `replace_with_default`, which is
quite verbose.
@czipperz observed that we have precedence for using `take` to refer to
methods that replace with `Default` in `Cell::take` and `Option::take`,
so this reverts commit 99c00591c29b472c8a87c4a9342d0e0c508647a3 to
return to the original `take` method name.
The name `replace_with_default` was suggested, but was deemed too
verbose, especially given that we use `take` for methods that replace
with `Default` elsewhere.
Warn on bare_trait_objects by default
The `bare_trait_objects` lint is set to `warn` by default.
Most ui tests have been updated to use `dyn` to avoid creating noise in stderr files.
r? @Centril
cc #54910
strip synstructure consts from compiler docs
Fixes#60150.
Unfortunately this PR depends on the use of the deprecated `--passes` flag in bootstrap to keep the `--strip-hidden` pass while still documenting private items. I've opened #60884 to track stabilization of a new flag that encapsulates this behavior.
r? @QuietMisdreavus
do not print panic message on doctest failures
This PR cleans up rustdoc test output by silently unwinding on failure instead of using `panic!`. It also improves the clarity and consistency of the output on test failure, and adds test cases for failure modes that were previously untested.
This commit fixes a ICE where struct constructors were resulting in an
ICE with const generics. Previously, a `match` in `type_of` did not have
an arm for the `DefKind::Ctor` resolutions and therefore would assume
that the type did not have generics.
Remove LLVM instruction stats and other (obsolete) codegen stats.
Both `-Z count_llvm_insns` and `-Z codegen-stats` are removed, as (AFAIK) they have been of little use in the last few years, especially after the transition to MIR->LLVM codegen.
Other than for the LLVM instruction counts, `-Z codegen-stats` has long been obsoleted anyway.
r? @nagisa cc @rust-lang/compiler