Skip to content

Rollup of 19 pull requests - #161487

Closed
JonathanBrouwer wants to merge 53 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-gQdVO93
Closed

Rollup of 19 pull requests#161487
JonathanBrouwer wants to merge 53 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-gQdVO93

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

Failed merges:

r? @ghost

Create a similar rollup

blyxyas and others added 30 commits July 14, 2026 13:47
The supposed output path was incorrect. Using `-Zdump-dep-graph` does NOT emit to
`/tmp/dep_graph.gv`, but to 2 files, one being `dep_graph.txt` and the other `dep_graph.dot` in the current directory
A braced const argument that is a call, like `Ty<{ Ty::f() }>`, is lowered
as a tuple constructor. When the callee's self type cannot host a
tuple-variant constructor (a struct, union, primitive, or foreign type),
the call is an associated function, not a constructor, and must be wrapped
in a `const { ... }` block.

Detect that from the self type's resolution before lowering it, and emit
the existing "complex const arguments must be placed inside of a `const`
block" diagnostic. A generic struct written without its arguments, as
`tracing`'s logging macros generate, would otherwise produce a spurious
E0107 "missing generics" cascade; a primitive or foreign type would
surface an opaque "invalid base path" error.

Enums, aliases, `Self`, and type parameters are left to constructor
lowering, since each may resolve to an enum.

Add UI tests for struct, union, primitive, and foreign self types, plus
the `const { ... }`-wrapped form that compiles.
This requires moving PanicPayload to alloc.
Canonical type-op queries discard NextGen constraints, so function-body
failures never reached NLL. Evaluate those ops locally under
-Zassumptions-on-binders and preserve the origin span on the resulting
outlives constraints.
Keep this branch focused on reporting solver region constraints. The type-op behavior and its borrowck coverage are handled separately.
While this won't change much for rustc and rustc-dev, it should make
codegen backends a bit smaller by omitting their crate metadata. In
addition it should reduce disk usage while compiling.
Add some documentation for `rustc_type_ir` and `SolverDelegate`.
`from_immediate` calls left over from refactor d3d3485 can create invalid LLVM IR
… use symbolic links in `copy_link_internal`
These fields served to query the bitwidth for both and whether an
integer is signed or not. The bitwith is now provided by `TypeId::bits`
while the signedness can be gotten trough the earlier introduces
`TypeId::is_signed`.
* Add Arc/Rc::strong_count_from_raw
* Drop the global allocator requirement from strong_count_from_raw

The clause came from increment_strong_count and decrement_strong_count,
where it holds because those rebuild an Arc<T, Global> through
from_raw_in and the decrement path frees through the global allocator.
Reading the strong count never builds or drops one, and the allocator
lives on the Arc rather than in the allocation, so it does not carry
over.
* std: refine docs for strong_count_from_raw
…obzol

bootstrap: (offload) be stricter about selected compiler and paths

Disclaimer: I used an llm to implement the fixes, since I had more than enough fun with cmake in the past.
I confirm that on a high-level these are the right fixes as far as I can tell, and I reviewed/refactored it.

@sgasho and @Sa4dUs can you two please confirm that it doesn't break the build for you?

Setup:
I started building rustc on a server where cc was pointing to gcc 9, which is too old to build our llvm submodule.
I managed to have gcc point to a newer gcc 13.
I had to set all the cc/cxx etc. in bootstrap.toml to the path to our gcc 13, as it would otherwise pick the gcc 9.
I also build myself clang-24 in a separate folder.

There are unfortunately enough servers out there that default to ancient gcc's, so I think it's worth handling that and make offload bootstrap a bit stricter.

Changes:
Opennmp/Offload currently requires clang since they generate bitcode during bootstrap. Any older (or newer?) clang and especially gcc are unable to do so. We'll drop the bitcode generation soon, but add libc-for-gpu in a follow-up pr, which has effectively the same requirement, so it's worth fixing. We now derive the path to clang from either the explicit clang_dir which a user can pass if they have a pre-built clang, or (preferably) our submodule clang, if we build it ourselves.

I first had an issue with bootstrap building `RustOffload-24`, since cmake found the external llvm-24 instead of our submodule with llvm-23, so that was obviously incompatible. I changed it to force the usage of our LLVM submodule.

I also added code to make clang use the same `libstdc++` which we used when building our llvm submodule (so in my case, the one from gcc-13). Without the code, it picks the `libstdc++` from the (much older) system cc (9.4), which is incompatible and runs into glibcxx_assert.

I _think_ this should be a strict improvement, and it fixes the 3 bugs I ran into.

r? kobzol
…ering-dtors-in-fibers, r=ChrisDenton

Avoid arming the Windows TLS destructor guard in fibers

After rust-lang#157645, we use FLS to trigger destructors for thread locals.

In bytecodealliance/wasmtime#14184, it turned out that there's an edge case we didn't cover: if `thread_local/guard/windows.rs::enable` is called from a fiber and later, in a different fiber: (1) the fiber is converted back to a thread and (2) the thread deletes the original fiber, we incorrectly triggers the FLS destructors prematurely.

The fix is simple - avoid arming the FLS slot (setting it to 1) if the calling thread is a fiber.

The issue happened on mingw because it does have target thread local. Tested locally by forcing `registered = false` and checked that the new test fails without the fix.

r? @ChrisDenton
…use-data, r=folkertdev

Use bitset for locals_with_use_data

There seems to be very little reason to use Vec of bools, the whole map allocates space for every element anyway.

Not sure how is impactful this is, I noticed it randomly in the code, but this seems like cleaner way to do it (and more common in the compiler codebase)
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Aug 21, 2026
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Aug 21, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,aarch64-apple-1,aarch64-apple-2,x86_64-mingw-1,i686-msvc-1,i686-msvc-2

@rust-bors

rust-bors Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

📌 Commit c9db83f has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 21, 2026
@rust-bors

rust-bors Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

⌛ Trying commit c9db83f with merge 70d290d

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/32530458800

rust-bors Bot pushed a commit that referenced this pull request Aug 21, 2026
Rollup of 19 pull requests


try-job: dist-various-1
try-job: test-various
try-job: x86_64-gnu-aux
try-job: x86_64-gnu-llvm-21-3
try-job: x86_64-msvc-1
try-job: aarch64-apple-1
try-job: aarch64-apple-2
try-job: x86_64-mingw-1
try-job: i686-msvc-1
try-job: i686-msvc-2
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Checking rustc_mir_transform v0.0.0 (/checkout/compiler/rustc_mir_transform)
error[E0621]: explicit lifetime required in the type of `qpath`
    --> compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs:2573:34
     |
2573 |                 if let Some(e) = self.try_recover_misrepresented_function_call(hir_self_ty, span) {
     |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'tcx` required
     |
help: add explicit lifetime `'tcx` to the type of `qpath`
     |
2556 -         qpath: hir::QPath<'_>,
2556 +         qpath: QPath<'tcx>,
     |

For more information about this error, try `rustc --explain E0621`.
[RUSTC-TIMING] rustc_hir_analysis test:false 6.026
error: could not compile `rustc_hir_analysis` (lib) due to 1 previous error

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-aux failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   Compiling rustc_ty_utils v0.0.0 (/checkout/compiler/rustc_ty_utils)
error[E0621]: explicit lifetime required in the type of `qpath`
    --> compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs:2573:34
     |
2573 |                 if let Some(e) = self.try_recover_misrepresented_function_call(hir_self_ty, span) {
     |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'tcx` required
     |
help: add explicit lifetime `'tcx` to the type of `qpath`
     |
2556 -         qpath: hir::QPath<'_>,
2556 +         qpath: QPath<'tcx>,
     |

For more information about this error, try `rustc --explain E0621`.
[RUSTC-TIMING] rustc_hir_analysis test:false 5.967
error: could not compile `rustc_hir_analysis` (lib) due to 1 previous error
---
Currently active steps:
compile::Assemble { target_compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu, forced_compiler: false } } at src/bootstrap/src/core/build_steps/tool.rs:375
compile::Rustc { target: x86_64-unknown-linux-gnu, build_compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, crates: [] } at src/bootstrap/src/core/build_steps/compile.rs:2319
Build completed unsuccessfully in 0:06:20
make: *** [Makefile:51: check-aux] Error 1
  local time: Fri Aug 21 22:01:31 UTC 2026
  network time: Fri, 21 Aug 2026 22:01:31 GMT
##[error]Process completed with exit code 2.
##[group]Run echo "disk usage:"
echo "disk usage:"

@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 21, 2026
@rust-bors

rust-bors Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

PR #157513, which is a member of this rollup, was unapproved.

This rollup was thus unapproved.

@rust-bors rust-bors Bot removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 21, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors try cancel

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 21, 2026
@rust-bors

rust-bors Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Try build cancelled. Cancelled workflows:

Hint: if you want to run another try build, you do not need to manually cancel the previous one. Just run @bors try and bors will cancel the previous build automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.