Skip to content

Rollup of 8 pull requests#158906

Closed
m-ou-se wants to merge 17 commits into
rust-lang:mainfrom
m-ou-se:rollup-3mLH5iB
Closed

Rollup of 8 pull requests#158906
m-ou-se wants to merge 17 commits into
rust-lang:mainfrom
m-ou-se:rollup-3mLH5iB

Conversation

@m-ou-se

@m-ou-se m-ou-se commented Jul 7, 2026

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

Dnreikronos and others added 17 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".
* 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.
allow mGCA const arguments to fall back to anon consts

makes good progress on rust-lang/project-const-generics#108

`min_generic_const_args` (mGCA) is all about "is this const lowered to a const item with a body, or, is it "directly" represented and visible in the type system?"

Here's various answers to the question of "can we represent this const arg directly?" - if we answer "no", then we fall back to an anon const (or error, sometimes, depending on context)

on **stable**, the full list of things can be directly represented is (... it's just the one thing)

- paths to generic const parameters

on `main`, under mGCA, **before** this PR:

- absolutely everything, if something cannot be represented directly, compiler error
- `const { }` gives you an escape hatch to go back to being an anon const

on macro**ful** gca, the directly represented things will be:

- paths to const parameters
- `direct_const_arg!` macro

on macro**less** gca, the directly represented things will be:

- paths to const parameters
- `direct_const_arg!` macro (not *particularly* useful under macro**less** gca)
- struct expressions, arrays, blah blah
- currently, paths to *anything*, even if that produces a compiler error later down the line (potential followup work here...)

this PR implements macro**less** gca, with the intent of a quick follow-up introducing a "macroless gca" feature and transitioning `#[feature(min_generic_const_args)]` to be macro**ful** gca

Also of note is that this PR removes the logic to skip generating "fake" DefIds for directly represented AnonConsts under mGCA, we now always generate a DefId when encountering an AnonConst. This lines up with stable, which has a fake AnonConst DefId for a directly represented plain path generic parameter (i.e. the bullet point under the "stable" entry above).

r? @BoxyUwU
…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.
…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
…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-clippy Relevant to the Clippy team. 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt 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
@m-ou-se

m-ou-se commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@bors r+ rollup=never p=5

@rust-bors

rust-bors Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 973614a has been approved by m-ou-se

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 8 pull requests

Successful merges:

 - #156968 (diagnostics: suggest generic_const_args for const ops)
 - #158617 (allow mGCA const arguments to fall back to anon consts)
 - #158690 (delegation: support mapping of all arguments with `Self` type)
 - #158696 (Rename some `body_id` to `body_def_id`)
 - #158333 (Fix typetree generation for differentiated functions)
 - #158646 (powerpc64le_unknown_freebsd.rs: link with -lgcc)
 - #158802 (Use `ci-mirrors` in `armhf-gnu` for {busybox, ubuntu rootfs} artifacts)
 - #158905 (delegation: add constraints to new generic args)
@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)
To only update this specific test, also pass `--test-args const-generics/mgca/direct-const-arg-feature-gate.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/direct-const-arg-feature-gate.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/direct-const-arg-feature-gate" "-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[E0658]: use of unstable library feature `min_generic_const_args`
##[error]  --> /checkout/tests/ui/const-generics/mgca/direct-const-arg-feature-gate.rs:1:32
   |
LL | fn foo<const N: usize>(_: [(); core::direct_const_arg!(N)]) {}
   |                                ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information
   = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error: generic parameters may not be used in const operations
##[error]  --> /checkout/tests/ui/const-generics/mgca/direct-const-arg-feature-gate.rs:1:56
   |
LL | fn foo<const N: usize>(_: [(); core::direct_const_arg!(N)]) {}
   |                                                        ^ cannot perform const operation using `N`
   |
   = help: const parameters may only be used as standalone arguments here, i.e. `N`
   = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
   = help: alternatively, you can use `#![feature(generic_const_args)]` and extract the expression into a `type const` item

error: expected expression, found `direct_const_arg!()` constant
##[error]  --> /checkout/tests/ui/const-generics/mgca/direct-const-arg-feature-gate.rs:1:32
   |
LL | fn foo<const N: usize>(_: [(); core::direct_const_arg!(N)]) {}
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0658`.
---
To only update this specific test, also pass `--test-args const-generics/mgca/double-wrapped-path-not-accidentally-stabilized.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-wrapped-path-not-accidentally-stabilized.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-wrapped-path-not-accidentally-stabilized" "-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 parameters may not be used in const operations
##[error]  --> /checkout/tests/ui/const-generics/mgca/double-wrapped-path-not-accidentally-stabilized.rs:11:13
   |
LL |     f::<{ { N } }>();
   |             ^ cannot perform const operation using `N`
   |
   = help: const parameters may only be used as standalone arguments here, i.e. `N`
   = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
   = help: alternatively, you can use `#![feature(generic_const_args)]` and extract the expression into a `type const` item

---
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
------------------------------------------

---- [ui] tests/ui/const-generics/mgca/double-inline-const.rs stdout end ----
---- [ui] tests/ui/const-generics/mgca/mixed-direct-anon-expression-diagnostics.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/const-generics/mgca/mixed-direct-anon-expression-diagnostics/mixed-direct-anon-expression-diagnostics.stderr`
diff of stderr:

10 LL |     f::<{ (N, 1 + 1) }>();
11    |            ^
12    |
-    = 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
14 
---
To only update this specific test, also pass `--test-args const-generics/mgca/mixed-direct-anon-expression-diagnostics.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/mixed-direct-anon-expression-diagnostics.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/mixed-direct-anon-expression-diagnostics" "-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: complex const arguments must be placed inside of a `const` block
##[error]  --> /checkout/tests/ui/const-generics/mgca/mixed-direct-anon-expression-diagnostics.rs:13:39
   |
LL |     f::<{ core::direct_const_arg!((N, 1 + 1)) }>();
   |                                       ^^^^^

error: generic parameters may not be used in const operations
##[error]  --> /checkout/tests/ui/const-generics/mgca/mixed-direct-anon-expression-diagnostics.rs:11:12
   |
LL |     f::<{ (N, 1 + 1) }>();
   |            ^
   |
   = help: add `#![feature(generic_const_args)]` and extract the expression into a `type const` item

error: aborting due to 2 previous errors

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
To only update this specific test, also pass `--test-args const-generics/mgca/direct-const-arg-feature-gate.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/direct-const-arg-feature-gate.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/direct-const-arg-feature-gate" "-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[E0658]: use of unstable library feature `min_generic_const_args`
##[error]  --> /checkout/tests/ui/const-generics/mgca/direct-const-arg-feature-gate.rs:1:32
   |
LL | fn foo<const N: usize>(_: [(); core::direct_const_arg!(N)]) {}
   |                                ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information
   = help: add `#![feature(min_generic_const_args)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error: generic parameters may not be used in const operations
##[error]  --> /checkout/tests/ui/const-generics/mgca/direct-const-arg-feature-gate.rs:1:56
   |
LL | fn foo<const N: usize>(_: [(); core::direct_const_arg!(N)]) {}
   |                                                        ^ cannot perform const operation using `N`
   |
   = help: const parameters may only be used as standalone arguments here, i.e. `N`
   = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
   = help: alternatively, you can use `#![feature(generic_const_args)]` and extract the expression into a `type const` item

error: expected expression, found `direct_const_arg!()` constant
##[error]  --> /checkout/tests/ui/const-generics/mgca/direct-const-arg-feature-gate.rs:1:32
   |
LL | fn foo<const N: usize>(_: [(); core::direct_const_arg!(N)]) {}
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0658`.
---
To only update this specific test, also pass `--test-args const-generics/mgca/double-wrapped-path-not-accidentally-stabilized.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-wrapped-path-not-accidentally-stabilized.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-wrapped-path-not-accidentally-stabilized" "-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 parameters may not be used in const operations
##[error]  --> /checkout/tests/ui/const-generics/mgca/double-wrapped-path-not-accidentally-stabilized.rs:11:13
   |
LL |     f::<{ { N } }>();
   |             ^ cannot perform const operation using `N`
   |
   = help: const parameters may only be used as standalone arguments here, i.e. `N`
   = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
   = help: alternatively, you can use `#![feature(generic_const_args)]` and extract the expression into a `type const` item

---
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
------------------------------------------

---- [ui] tests/ui/const-generics/mgca/double-inline-const.rs stdout end ----
---- [ui] tests/ui/const-generics/mgca/mixed-direct-anon-expression-diagnostics.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/mgca/mixed-direct-anon-expression-diagnostics/mixed-direct-anon-expression-diagnostics.stderr`
diff of stderr:

10 LL |     f::<{ (N, 1 + 1) }>();
11    |            ^
12    |
-    = 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
14 
---
To only update this specific test, also pass `--test-args const-generics/mgca/mixed-direct-anon-expression-diagnostics.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/mixed-direct-anon-expression-diagnostics.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/mixed-direct-anon-expression-diagnostics" "-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: complex const arguments must be placed inside of a `const` block
##[error]  --> /checkout/tests/ui/const-generics/mgca/mixed-direct-anon-expression-diagnostics.rs:13:39
   |
LL |     f::<{ core::direct_const_arg!((N, 1 + 1)) }>();
   |                                       ^^^^^

error: generic parameters may not be used in const operations
##[error]  --> /checkout/tests/ui/const-generics/mgca/mixed-direct-anon-expression-diagnostics.rs:11:12
   |
LL |     f::<{ (N, 1 + 1) }>();
   |            ^
   |
   = help: add `#![feature(generic_const_args)]` and extract the expression into a `type const` item

error: aborting due to 2 previous errors

@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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

💔 Test for 69e9856 failed: CI. Failed job:

@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-review Status: Awaiting review from the assignee but also interested parties. labels Jul 7, 2026
@rust-bors

rust-bors Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

PR #158617, which is a member of this rollup, was 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
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 T-clippy Relevant to the Clippy team. 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt 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.