Skip to content

Rollup of 9 pull requests#158909

Closed
JonathanBrouwer wants to merge 19 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-EcDI9rQ
Closed

Rollup of 9 pull requests#158909
JonathanBrouwer wants to merge 19 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-EcDI9rQ

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

Dnreikronos and others added 19 commits June 25, 2026 09:58
…stics

Point users at `#![feature(generic_const_args)]` and `type const` items
when they hit the "generic parameters may not be used in const operations"
error, not just `generic_const_exprs`.
Starting with FreeBSD 16.0, powerpc64le switches to IEEE long double.
128 bit arithmetics are implemented in LLVM's compiler_rt, which is
FreeBSD's libgcc. Link with it so that building on FreeBSD 16.0
succeeds - noop for earlier releases.
…r generation for memcpy.

This moves a TA failure in the testcase from memcpy to a later location.
`body_id` is often used to mean "ID of a body-owning node", which is
confusing since the obvious reading of "body ID" is wrong.

`body_def_id` is easier to read as "body-owning definition ID".
In LLVM 22 the x64 MSVC ABI wasn't matched and f128 was being directly
returned in %xmm0, but now it correctly returns the value via a pointer.
* Support mapping of all arguments with Self type
* Address some review comments
* Review: use #[cfg(debug_assertions)] on the whole module
* Review: emit error when trying to map non-receiver argument when block contains definitions
* Use `cfg_select`
* Fix tidy
* Unify mapping with `should_generate_block`
* Better naming and message for error
* loop -> `extend`
…gnostic-156729, r=petrochenkov

diagnostics: suggest generic_const_args for const ops

fixes rust-lang#156729

when const ops hit generic params, like `[u8; size_of::<self>()]`, the diagnostic only points at `generic_const_exprs`. imo that's a stale nudge now that `generic_const_args` and `type const` items are the path we want people trying.

add help for `generic_const_args` and `type const` items in the resolve and hir_ty_lowering paths. also skip the old gce suggestion once `min_generic_const_args` is enabled, and emit both suggestions for the `self` alias path so the "alternatively" wording doesn't hang there by itself. includes the regression test from the issue. lgtm.
…uments-wrapping, r=petrochenkov

delegation: support mapping of all arguments with `Self` type

This PR supports applying target expression to arguments of `Self` type.
That the first part of this feature which touches AST -> HIR lowering only and allows lowering of delegation's block several times when there are no definitions inside.
The second part will adjust typeck so we can apply adjustments to all mapped arguments as to the first argument of delegation. This should also eventually weak the condition of argument mapping allowing `Box<Self>`, `Arc<Self>`, etc.

Part of rust-lang#118212.
r? @petrochenkov
Rename some `body_id` to `body_def_id`

Since body IDs and item IDs are distinct things, try to use names that do not conflate them. `body_def_id` is a little easier to read as "body-owning definition ID" whereas `body_id` is hard not to just read as "body ID".

Related: rust-lang#158611 - I noticed this afterwards. I suspect that `FnCtxt` ought to keep `body_def_id` but maybe add `body_id: BodyId` in addition.
…i-obk

Fix typetree generation for differentiated functions

Further improvements after rust-lang#158278
This fixes a test failure on main (encountered while working on the PR above) in `tests/codegen-llvm/autodiff/autodiffv2.rs`.

Further improvements are split out into rust-lang#158440, with high-level docs available in rust-lang/rustc-dev-guide#2911
Also noticed that I can (probably?) remove the llvm_enzyme cfg at this point, rust-lang#158460
powerpc64le_unknown_freebsd.rs: link with -lgcc

Starting with FreeBSD 16.0, powerpc64le switches to IEEE long double. 128 bit arithmetics are implemented in LLVM's compiler_rt, which is FreeBSD's libgcc. Link with it so that building on FreeBSD 16.0 succeeds - noop for earlier releases.
…d-braces-macro, r=folkertdev

Avoid unused braces lint for macro generated arguments

Fixes rust-lang#158747

This changes the `unused_braces` lint to avoid suggesting brace removal for macro arguments when those braces may affect `macro_rules!`.

But the fragment kind matters:

- `$e:expr` matches an expression. Both `1` and `{ 1 }` are expressions, so removing braces can still leave the macro matching the same kind of input.
- `$b:block` only matches a block expression written with braces. `{ 1 }` matches, but `1` does not.

So `call_expr!({ 1 })` can usually be simplified to `call_expr!(1)`, while `call_block!({ 1 })` cannot.

It seems a more concrect report need a full `macro_rules!` matcher analysis, that seems too heavy for `unused` lint.
…ror, r=marcoieni

Use `ci-mirrors` in `armhf-gnu` for {busybox, ubuntu rootfs} artifacts


## Summary

Use our `ci-mirrors` for busybox and ubuntu rootfs artifacts instead of relying on external network sources.

Context: [#t-infra > kernel.org is borked @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/kernel.2Eorg.20is.20borked/near/608261860)

---

try-job: armhf-gnu
…lkertdev

tests: catch up with LLVM returning f128 on the stack

In LLVM 22 the x64 MSVC ABI wasn't matched and f128 was being directly returned in %xmm0, but now it correctly returns the value via a pointer.
…straints, r=petrochenkov

delegation: add constraints to new generic args

Constraints were not added to new generic args which caused them to be missing from HIR and this produced ICE.

Fixes rust-lang#158812. Part of rust-lang#118212.
r? @petrochenkov
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jul 7, 2026
@rustbot rustbot added A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc F-autodiff `#![feature(autodiff)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jul 7, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never 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,x86_64-mingw-1,i686-msvc-2

@rust-bors

rust-bors Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 75c6569 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 Jul 7, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 7, 2026
Rollup of 9 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
try-job: x86_64-mingw-1
try-job: i686-msvc-2
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
Saved the actual stderr to `/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/mgca/double-inline-const/double-inline-const.stderr`
diff of stderr:

9    |
10 LL | impl<const N: usize> S<N> {
11    |                      ^^^^
-    = help: add `#![feature(generic_const_args)]` to allow generic expressions as the RHS of const items
+    = help: add `#![feature(generic_const_args)]` and extract the expression into a `type const` item
13 
14 error: aborting due to 1 previous error
---
To only update this specific test, also pass `--test-args const-generics/mgca/double-inline-const.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/checkout/tests/ui/const-generics/mgca/double-inline-const.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/mgca/double-inline-const" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: generic `Self` types are currently not permitted in anonymous constants
##[error]  --> /checkout/tests/ui/const-generics/mgca/double-inline-const.rs:7:35
   |
LL |     fn foo(_: S<{ const { const { Self::Q } } }>) {}
   |                                   ^^^^
   |
note: not a concrete type
  --> /checkout/tests/ui/const-generics/mgca/double-inline-const.rs:5:22
   |
LL | impl<const N: usize> S<N> {
   |                      ^^^^
   = help: add `#![feature(generic_const_args)]` and extract the expression into a `type const` item

error: aborting due to 1 previous error
------------------------------------------

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/const-generics/mgca/double-inline-const/double-inline-const.stderr`
diff of stderr:

9    |
10 LL | impl<const N: usize> S<N> {
11    |                      ^^^^
-    = help: add `#![feature(generic_const_args)]` to allow generic expressions as the RHS of const items
+    = help: add `#![feature(generic_const_args)]` and extract the expression into a `type const` item
13 
14 error: aborting due to 1 previous error
---
To only update this specific test, also pass `--test-args const-generics/mgca/double-inline-const.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/const-generics/mgca/double-inline-const.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/const-generics/mgca/double-inline-const" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: generic `Self` types are currently not permitted in anonymous constants
##[error]  --> /checkout/tests/ui/const-generics/mgca/double-inline-const.rs:7:35
   |
LL |     fn foo(_: S<{ const { const { Self::Q } } }>) {}
   |                                   ^^^^
   |
note: not a concrete type
  --> /checkout/tests/ui/const-generics/mgca/double-inline-const.rs:5:22
   |
LL | impl<const N: usize> S<N> {
   |                      ^^^^
   = help: add `#![feature(generic_const_args)]` and extract the expression into a `type const` item

error: aborting due to 1 previous error
------------------------------------------

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 7, 2026
@rust-bors

rust-bors Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

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

This rollup was thus unapproved.

@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 Jul 7, 2026
@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 Jul 7, 2026
@rust-bors

rust-bors Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

💔 Test for feb4c26 failed: CI. Failed jobs:

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

Labels

A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc F-autodiff `#![feature(autodiff)]` rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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.