Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 21, 2025

Shorten generated code for CloneIn for fieldless enums. All fieldless enums are Copy, so cloning them can just be *self, rather than a large match expression. This removes about 500 lines of code.

Add #[inline(always)] to these no-op clone_in methods.

Copy link
Member Author

overlookmotel commented Mar 21, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added A-ast Area - AST A-ast-tools Area - AST tools C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Mar 21, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 21, 2025

CodSpeed Instrumentation Performance Report

Merging #9939 will not alter performance

Comparing 03-21-refactor_ast_shorten_generated_code_for_clonein_ (d3d7d98) with main (930cc8b)

Summary

✅ 33 untouched benchmarks

@overlookmotel overlookmotel marked this pull request as ready for review March 21, 2025 05:07
@overlookmotel overlookmotel requested a review from leaysgur as a code owner March 21, 2025 05:07
@graphite-app graphite-app bot changed the base branch from 03-21-refactor_ast_tools_simplify_clonein_derive to graphite-base/9939 March 21, 2025 05:15
@graphite-app graphite-app bot force-pushed the 03-21-refactor_ast_shorten_generated_code_for_clonein_ branch from feea14a to 76484f5 Compare March 21, 2025 05:23
@graphite-app graphite-app bot force-pushed the graphite-base/9939 branch from 410e54c to 28179cd Compare March 21, 2025 05:23
@graphite-app graphite-app bot changed the base branch from graphite-base/9939 to main March 21, 2025 05:24
@graphite-app graphite-app bot force-pushed the 03-21-refactor_ast_shorten_generated_code_for_clonein_ branch from 76484f5 to b9175d8 Compare March 21, 2025 05:24
@overlookmotel overlookmotel removed the request for review from leaysgur March 21, 2025 05:26
@overlookmotel
Copy link
Member Author

I think this change is uncontroversial, so merging without review.

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Mar 21, 2025
Copy link
Member Author

overlookmotel commented Mar 21, 2025

Merge activity

  • Mar 21, 1:27 AM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 21, 1:38 AM EDT: A user added this pull request to the Graphite merge queue.
  • Mar 21, 1:47 AM EDT: A user merged this pull request with the Graphite merge queue.

Shorten generated code for `CloneIn` for fieldless enums. All fieldless enums are `Copy`, so cloning them can just be `*self`, rather than a large match expression. This removes about 500 lines of code.

Add `#[inline(always)]` to these no-op `clone_in` methods.
@graphite-app graphite-app bot force-pushed the 03-21-refactor_ast_shorten_generated_code_for_clonein_ branch from b9175d8 to d3d7d98 Compare March 21, 2025 05:39
@graphite-app graphite-app bot merged commit d3d7d98 into main Mar 21, 2025
24 checks passed
@graphite-app graphite-app bot deleted the 03-21-refactor_ast_shorten_generated_code_for_clonein_ branch March 21, 2025 05:47
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast Area - AST A-ast-tools Area - AST tools C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants