Skip to content

Turn gca into a macro 2.0 that expands to k#gca(..) - #166390

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
fmease:gca-to-int-syn
Nov 23, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
fmease:gca-to-int-syn

Conversation

@fmease

@fmease fmease commented Nov 23, 2026

Copy link
Copy Markdown
Member

Part of MCP-approved #110680.

CC Pinging author of gca macro @khyperia (RUST-158617, RUST-163198) for visibility.

(No LLM was or will be used by me during the entire creation process of this PR)

@rustbot

rustbot commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

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

cc @rust-lang/rustfmt

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

cc @rust-lang/clippy

@rustbot rustbot added 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-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. labels Nov 23, 2026
@rustbot

rustbot commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

r? @nnethercote

rustbot has assigned @nnethercote.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 79 candidates
  • Random selection from 20 candidates

@khyperia

Copy link
Copy Markdown
Member

neat!

@bors r+

@rust-bors

rust-bors Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

📌 Commit a93371a has been tentatively approved by khyperia

It will be put into the queue for this repository once PR CI succeeds.

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

Rollup of 6 pull requests

Successful merges:

 - #164918 (Move lint validation to attribute parsing)
 - #166381 (`rust-analyzer` subtree update)
 - #166191 (Enable static-pie on all Musl targets)
 - #166390 (Turn `gca` into a macro 2.0 that expands to `k#gca(..)`)
 - #165764 (view-types: handle field accesses)
 - #166250 (Add a reason suggestion for malformed lint attributes)

Failed merges:

 - #166374 (Undo accidental duplication checking for attributes on macro calls)
--> $DIR/gca-macro-multiple-exprs.rs:4:51
|
LL | fn foo<const N: usize, const M: usize>(_: S<gca!(N, M)>) {}
| ^ expected one of 7 possible tokens

@bit-aloo bit-aloo Nov 23, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this diagnostic ok?

View changes since the review

@fmease fmease Nov 23, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a diagnostic regression (D-verbose) but it's acceptable. It's now a normal parse error w/o the special-casing of rustc_builtin_macros. If there's desire this can be improved in the future but I've heard the gca macro is temporary.

Re. the extra diagnostic, that is indeed kinda icky, maybe an easy fix can be applied in the macro expander in a separate PR.

I wouldn't want to investigate that myself since if it were me, I would actually just jettison the wrapper macro, remove the fake TyKind::Gca altogether (only having ExprKind::Gca), allow k#gca to begin const args and thus force users to write X<k#gca(0)> (here, the parser actually sees that this is a const arg contrary to X<gca!(0)> which is parsed as a type arg!))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, we will yeet gca soon! If someone asks for better diagnostic, we can improve it then. For now, its cool!! Thanks

@rust-bors
rust-bors Bot merged commit a494fe8 into rust-lang:main Nov 23, 2026
14 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 23, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 23, 2026
Rollup merge of #166390 - fmease:gca-to-int-syn, r=khyperia

Turn `gca` into a macro 2.0 that expands to `k#gca(..)`

Part of MCP-approved #110680.

CC Pinging author of `gca` macro @khyperia (RUST-158617, RUST-163198) for visibility.

<sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
@fmease
fmease deleted the gca-to-int-syn branch November 23, 2026 19:08
@rust-timer

Copy link
Copy Markdown

Note

This PR was benchmarked as part of triage of its containing rollup: triage URL.

Finished benchmarking commit (04a9ff0): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were not yet notified of this PR).

@rustbot label: +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.5% [0.5%, 0.5%] 1
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.9% [-1.2%, -0.1%] 8
All ❌✅ (primary) 0.5% [0.5%, 0.5%] 1

Max RSS (memory usage)

This perf run didn't have relevant results for this metric.

Cycles

Results (secondary 2.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.8% [2.4%, 9.1%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.1% [-4.6%, -3.6%] 2
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Artifact size: 406.40 MiB -> 405.74 MiB (-0.16%)

@rustbot rustbot added the perf-regression Performance regression. label Nov 24, 2026
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Nov 26, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#164918 (Move lint validation to attribute parsing)
 - rust-lang/rust#166381 (`rust-analyzer` subtree update)
 - rust-lang/rust#166191 (Enable static-pie on all Musl targets)
 - rust-lang/rust#166390 (Turn `gca` into a macro 2.0 that expands to `k#gca(..)`)
 - rust-lang/rust#165764 (view-types: handle field accesses)
 - rust-lang/rust#166250 (Add a reason suggestion for malformed lint attributes)

Failed merges:

 - rust-lang/rust#166374 (Undo accidental duplication checking for attributes on macro calls)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. 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-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants