Repository navigation
Turn gca into a macro 2.0 that expands to k#gca(..) - #166390
Conversation
|
cc @rust-lang/rustfmt
cc @rust-lang/clippy |
|
r? @nnethercote rustbot has assigned @nnethercote. Use Why was this reviewer chosen?The reviewer was selected based on:
|
75d9ed8 to
9bf5219
Compare
9bf5219 to
a93371a
Compare
|
neat! @bors r+ |
…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 |
There was a problem hiding this comment.
is this diagnostic ok?
There was a problem hiding this comment.
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!))
There was a problem hiding this comment.
Ya, we will yeet gca soon! If someone asks for better diagnostic, we can improve it then. For now, its cool!! Thanks
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>
|
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. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesResults (secondary 2.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Artifact size: 406.40 MiB -> 405.74 MiB (-0.16%) |
…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)
Part of MCP-approved #110680.
CC Pinging author of
gcamacro @khyperia (RUST-158617, RUST-163198) for visibility.(No LLM was or will be used by me during the entire creation process of this PR)