Skip to content

rename direct_const_arg! to gca! - #163198

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
khyperia:rename-gca
Sep 23, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
khyperia:rename-gca

Conversation

@khyperia

Copy link
Copy Markdown
Member

Also re-export it from std, and make most tests use std::gca; rather than writing out core:: every time the macro is called.

Part of the design rework discussed in Zulip #project-const-generics > talkies at last @ 💬

r? @BoxyUwU

@rustbot

rustbot commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

clippy is developed in its own repository. If possible, consider making this change to rust-lang/rust-clippy instead.

cc @rust-lang/clippy

rustfmt is developed in its own repository. If possible, consider making this change to rust-lang/rustfmt instead.

cc @rust-lang/rustfmt

HIR ty lowering was modified

cc @fmease

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

This PR changes a file inside tests/crashes. If a crash was fixed, please move into the corresponding ui subdir and add 'Fixes #' to the PR description to autoclose the issue upon merge.

Some changes occurred in tests/ui/sanitizer

cc @rcvalle

@rustbot

rustbot commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

BoxyUwU is currently at their maximum review capacity.
They may take a while to respond.

@rustbot rustbot added PG-exploit-mitigations Project group: Exploit mitigations 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-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. 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 Sep 23, 2026
@rust-log-analyzer

This comment has been minimized.

Comment thread src/tools/rustfmt/tests/source/gca.rs Outdated
@BoxyUwU

BoxyUwU commented Sep 23, 2026

Copy link
Copy Markdown
Member

@bors squash msg="rename direct_const_arg! to gca!"

@rust-bors

This comment has been minimized.

Co-authored-by: Boxy <rust@boxyuwu.dev>
@rust-bors

rust-bors Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

🔨 2 commits were squashed into 4dcd02e.

@BoxyUwU

BoxyUwU commented Sep 23, 2026

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 4dcd02e has been approved by BoxyUwU

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 Sep 23, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 23, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #162177 (Properly implement the gpu-kernel ABI for amdgpu)
 - #163168 (std: Update `wasip3` crate dependency)
 - #163179 (Cleanup offload build steps)
 - #163194 (Remove unused `StashKey::UnderscoreForArrayLengths`)
 - #163198 (rename direct_const_arg! to gca!)
 - #163205 (Remove `suggestion_for_allocator_api`)
 - #162497 (document `#[rustc_dyn_incompatible_trait]`)
 - #162702 (regression test for unconstrained const args)
 - #163191 (Enhance mutable closure suggestions with as_mut() support)
 - #163192 (Fix Typo in `std::sys::process::unix::unsupported::wait_status` Docs)
 - #163196 (Remove `DiagInner::sort_span`)
 - #163197 (Fix flt2dec build on 16-bit targets)
@rust-bors
rust-bors Bot merged commit c55353d into rust-lang:main Sep 23, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 23, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 23, 2026
Rollup merge of #163198 - khyperia:rename-gca, r=BoxyUwU

rename direct_const_arg! to gca!

Also re-export it from `std`, and make most tests `use std::gca;` rather than writing out `core::` every time the macro is called.

Part of the design rework discussed in Zulip [#project-const-generics > talkies at last @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/260443-project-const-generics/topic/talkies.20at.20last/near/620368825)

r? @BoxyUwU
@JonathanBrouwer

Copy link
Copy Markdown
Member

This caused a tiny perf regression
#163208 (comment)

It's so tiny that rust timer thinks it's noise, so feel free to ignore it :)

@JonathanBrouwer

Copy link
Copy Markdown
Member

Hmmm this pr is only a rename so maybe it is in fact noise?

@khyperia
khyperia deleted the rename-gca branch September 24, 2026 05:44
@khyperia

Copy link
Copy Markdown
Member Author

Hmmm this pr is only a rename so maybe it is in fact noise?

Huh. Yeah. The only thing I can think of is like, this adds a single macro reexport to std, and changes symbol interning slightly (removes direct_const_arg as an interned symbol, and adds gca). Both of those probably shouldn't affect perf at all. Other than that, it's a pure rename that shouldn't affect anything.

rust-bors Bot pushed a commit that referenced this pull request Sep 25, 2026
rename GCA features

fixes rust-lang/project-const-generics#114

We would like to publish posts soon that GCE is dying and GCA is the future. As part of that, we want the feature gates/etc. to be in their final-ish shape. We discussed a lot of naming bikesheds in the zulip thread [#project-const-generics > talkies at last @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/260443-project-const-generics/topic/talkies.20at.20last/near/620368825), namely:

- `min_generic_const_args` -> `gca_min_const_items`
- `generic_const_args` -> `gca_const_items`
- `macroless_generic_const_args` -> `gca_macroless_args`
- `macroless_const_item_generic_const_args` -> `gca_macroless_items`

things that were discussed in that Zulip thread, but are not part of this PR:

- `gca_adts` and/or `gca_arrays` (the feature is not created yet)
  - the `DirectConstArgContext` enum is in a vaguely awkwardly named spot after this PR. I intend to clean it up as part of creating the `gca_adts` feature (perhaps turning it into a bitflags for allowed syntax, or something)
- renaming the `direct_const_arg!` macro to `gca!` - this was done in #163198
- deleting `type const`, introducing `#[always_gca]` - this was done in #162517

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

Labels

PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. 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.

5 participants