-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Rollup of 10 pull requests #151125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 10 pull requests #151125
Conversation
... in macro invocations. Issue: <rust-lang#149692>.
There's no sensible recovery scheme here, giving up the recovery is the right thing to do.
Previously, these failed to resolve, despite them working for struct fields or enum variants that were behind aliases. However, there is now an inconsistency where enum variant fields behind an alias resolve to the entry on the alias's page, while enum variants and struct fields resolve to the page of the backing ADT.
The old name and API were confusing. In my opinion, looking up the type at the call site is clearer.
All the other parts of this function return the Res for the containing page, but for some reason, this returns the associated item itself. It doesn't seem to affect the behavior of rustdoc because e.g. the href functions use the parent if the DefId is for an assoc item. But it's clearer and simpler to be consistent.
Otherwise eiis defined by std will produce large amounts of `missing stability attribute` errors.
target_arch for powerpc64le- targets is "powerpc64".
Recent changes made WASI targets use the Unix threading implementation, but WASI does not support threading. When the Unix code tries to call pthread_create, it fails with EAGAIN, causing libraries like rayon to panic when trying to initialize their global thread pool. This fix adds an early return in Thread::new() that checks for WASI and returns UNSUPPORTED_PLATFORM. This approach: - Continues using most of the unix.rs code path (less invasive) - Only requires a small cfg check at the start of Thread::new() - Can be easily removed once wasi-sdk is updated with the proper fix The real fix is being tracked in `WebAssembly/wasi-libc#716` which will change the error code returned by pthread_create to properly indicate unsupported operations. Once that propagates to wasi-sdk, this workaround can be removed. Fixes the regression where rayon-based code (e.g., lopdf in PDF handling) panicked on WASI after nightly-2025-12-10. Before fix: pthread_create returns EAGAIN (error code 6) ThreadPoolBuildError { kind: IOError(Os { code: 6, kind: WouldBlock, message: "Resource temporarily unavailable" }) } After fix: Thread::new returns Err(io::Error::UNSUPPORTED_PLATFORM) Libraries can gracefully handle the lack of threading support
Add a context-consistency check before emitting redundant generic-argument suggestions Fixes rust-lang#149559 Add a context-consistency check before emitting redundant generic-argument suggestions. If the redundant argument spans come from mixed hygiene contexts (e.g., macro definition + macro callsite), we skip the suggestion to avoid malformed `shrink_to_hi().to(...)` spans and potential ICEs.
…Gomez rustdoc: Fix intra-doc link bugs involving type aliases and associated items This PR: - Add support for linking to fields of variants behind a type alias. - Correctly resolve links to fields and variants behind a type alias to the alias's version of the docs. - Refactor some intra-doc links code to make it simpler. - Add tests for the status quo of linking to associated items behind aliases. Future steps: - Nail down the rules of when inherent and trait impls are inlined into an alias's docs, and when impls on the alias appear for the aliased type. - Adjust the resolutions of intra-doc links, through aliases, to associated items based on these rules. r? @GuillaumeGomez
Don't try to recover keyword as non-keyword identifier Fixes rust-lang#149692. On beta after rust-lang#146978, we ICE on ```rs macro_rules! m { ($id:item()) => {} } m!(Self()); ``` where `Self` in the macro invocation is a keyword not a "normal" identifier, while attempting to recover an missing keyword before an identifier. Except, `Self` *is* a keyword, so trying to parse that as a non-reserved identifier expectedly fails. I suspect rust-lang#146978 merely unmasked a possible code path to hit this case; this logic has been so for a good while. Previously, on stable, the error message looks something like ```rs error: expected identifier, found keyword `Self` --> src/lib.rs:5:4 | 5 | m!(Self()); | ^^^^ expected identifier, found keyword error: missing `fn` or `struct` for function or struct definition --> src/lib.rs:5:4 | 2 | ($id:item()) => {} | -------- while parsing argument for this `item` macro fragment ... 5 | m!(Self()); | ^^^^ | help: if you meant to call a macro, try | 5 | m!(Self!()); | + ``` I considered restoring this diagnostic, but I'm not super convinced it's worth the complexity (and to me, it's not super clear what the user actually intended here).
… r=lcnr cleanup: remove borrowck handling for inline const patterns rust-lang#120390 added borrow-checking for inline const patterns; a type annotation was added to inline const patterns in the THIR to remember the `DefId` and args of the constants so they could be checked and constraints could be propagated to their parents. As of rust-lang#138499 though, inline const patterns can't be borrow-checked due to a query cycle, and as of rust-lang#149667, the type/`DefId`/args annotations on inline const patterns have been removed, so the borrowck code for them seems unused; this PR removes it. In a hypothetical future where borrowck doesn't depend on exhaustiveness checking so `inline_const_pat` can be reinstated, I imagine we also won't be evaluating inline const patterns before borrowck. As such, we might be able to reuse the existing code for normal unevaluated inline const operands in [`TypeChecker::visit_operand`](https://github.com/rust-lang/rust/blob/32fe406b5e71afbb0d8b95280e50e67d1549224c/compiler/rustc_borrowck/src/type_check/mod.rs#L1720-L1749) (or at least we shouldn't need to encode inline const patterns' `DefId` and args in user type annotations if they appear directly in the MIR). r? lcnr
rustc_target: Remove unused Arch::PowerPC64LE This variant has been added in rust-lang#147645, but actually unused since target_arch for powerpc64le- targets is "powerpc64". (The difference between powerpc64- and powerpc64le- targets is identified by target_endian.) Note: This is an internal cleanup and does NOT remove `powerpc64le-*` targets.
…, r=wafflelapkin Disallow eii in statement position With how v2 macros resolve, and the name resolution of `super` works, I realized with @WaffleLapkin that there's actually no way to consistently expand EIIs in statement position. r? @WaffleLapkin
fix: WASI threading regression by disabling pthread usage PR rust-lang#147572 changed WASI to use the Unix threading implementation, but WASI does not support threading. When the Unix code tries to call pthread_create, it fails with EAGAIN, causing libraries like rayon to panic when trying to initialize their global thread pool. The old wasip1/wasip2 implementations: - wasip1: Threading conditionally available with atomics (experimental) - wasip2: Threading unconditionally unsupported This fix restores that behavior by disabling pthread-based threading for all WASI targets: 1. Guard the pthread-based Thread implementation with #[cfg(not(target_os = "wasi"))] 2. Provide an unsupported stub (Thread(!)) for WASI 3. Return Err(io::Error::UNSUPPORTED_PLATFORM) when Thread::new is called Fixes the regression where rayon-based code (e.g., lopdf in PDF handling) panicked on WASI after nightly-2025-12-10. Before fix: pthread_create returns EAGAIN (error code 6) ThreadPoolBuildError { kind: IOError(Os { code: 6, kind: WouldBlock, message: "Resource temporarily unavailable" }) } After fix: Thread::new returns Err(io::Error::UNSUPPORTED_PLATFORM) Libraries can gracefully handle the lack of threading support r? @alexcrichton
compiler: Make Externally Implementable Item (eii) macros "semiopaque" Otherwise eiis defined by std will produce large amounts of `missing stability attribute` errors. This problem is not eii specific, as can be seen in rust-lang#146993 and which is demonstrated in rust-lang#151022. As can be seen with ```console $ git grep rustc_macro_transparency compiler/rustc_arena/src/lib.rs:#[rustc_macro_transparency = "semiopaque"] [...] ``` it is very common for macros to use `"semiopaque"`. r? @jdonszelmann Tracking issue: rust-lang#125418 Needed for: rust-lang#150588
…enkov mir_build: Simplify length-determination and indexing for array/slice patterns The existing length-determination code in `prefix_slice_suffix` has ended up overly complicated, partly because it doesn't know in advance whether the pattern is supposed to be an array pattern or a slice pattern. Pulling most of that step out into the `PatKind::Array` arm makes the whole thing a bit nicer overall. There should (hopefully) be no change to compiler output. The biggest “functional” change is that we now discard the subpatterns of an array pattern of unknowable length, instead of treating it as a slice pattern. I'm not aware of any way for this to make an observable difference, and it can only occur when compilation is already doomed to fail.
Avoid serde dependency in build_helper when not necessary Run-make-support doesn't need the metrics code to be pulled in ever. And bootstrap only needs it in CI where build metrics support is enabled.
|
@bors r+ rollup=never p=5 |
|
|
|
Sorry for the mixup, I was thinking of #150939 which would benefit from being included. |
|
I'll make a new rollup, sure :) |
Successful merges:
r? @ghost
Create a similar rollup