Skip to content

refactor(ast): #[content_eq(skip)] attr#8875

Merged
graphite-app[bot] merged 1 commit intomainfrom
02-03-refactor_ast_content_eq_skip_attr
Feb 4, 2025
Merged

refactor(ast): #[content_eq(skip)] attr#8875
graphite-app[bot] merged 1 commit intomainfrom
02-03-refactor_ast_content_eq_skip_attr

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Feb 3, 2025

Introduce custom attribute #[content_eq(skip)] to guide code generation for ContentEq trait. Instead of a hard-coded list of types to skip in codegen, use this attribute on types to control the behavior.

Copy link
Member Author

overlookmotel commented Feb 3, 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.

@overlookmotel overlookmotel marked this pull request as ready for review February 3, 2025 19:04
@github-actions github-actions bot added A-ast-tools Area - AST tools C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Feb 3, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 3, 2025

CodSpeed Performance Report

Merging #8875 will not alter performance

Comparing 02-03-refactor_ast_content_eq_skip_attr (caa651c) with main (4b4d543)

Summary

✅ 33 untouched benchmarks

@overlookmotel overlookmotel force-pushed the 02-03-feat_ast_tools_allow_attrs_on_types_which_do_not_derive_the_trait branch from c4e297d to 7a74484 Compare February 3, 2025 20:22
@overlookmotel overlookmotel force-pushed the 02-03-refactor_ast_content_eq_skip_attr branch from 0d0fa2e to 480a1e4 Compare February 3, 2025 20:22
@overlookmotel overlookmotel force-pushed the 02-03-feat_ast_tools_allow_attrs_on_types_which_do_not_derive_the_trait branch from 7a74484 to dd71d68 Compare February 3, 2025 21:56
@overlookmotel overlookmotel force-pushed the 02-03-refactor_ast_content_eq_skip_attr branch from 480a1e4 to 65f004a Compare February 3, 2025 21:57
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Feb 4, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 4, 2025

Merge activity

Introduce custom attribute `#[content_eq(skip)]` to guide code generation for `ContentEq` trait. Instead of a hard-coded list of types to skip in codegen, use this attribute on types to control the behavior.
graphite-app bot pushed a commit that referenced this pull request Feb 4, 2025
…8874)

Generally, custom attributes relating to a trait e.g. `CloneIn` / `#[clone_in]` are only legal if the trait is derived on the type. Allow a `Derive` to choose to relax this restriction. This is necessary for #8875, #8876, and #8877.
@graphite-app graphite-app bot force-pushed the 02-03-feat_ast_tools_allow_attrs_on_types_which_do_not_derive_the_trait branch from dd71d68 to f40f494 Compare February 4, 2025 02:52
@graphite-app graphite-app bot force-pushed the 02-03-refactor_ast_content_eq_skip_attr branch from 65f004a to caa651c Compare February 4, 2025 02:53
graphite-app bot pushed a commit that referenced this pull request Feb 4, 2025
Generate implementations of `ContentEq` trait on literal types instead of writing them manually, using the `#[content_eq(skip)]` attribute introduced in #8875 to skip fields which shouldn't be included.
Base automatically changed from 02-03-feat_ast_tools_allow_attrs_on_types_which_do_not_derive_the_trait to main February 4, 2025 03:43
@graphite-app graphite-app bot merged commit caa651c into main Feb 4, 2025
28 checks passed
@graphite-app graphite-app bot deleted the 02-03-refactor_ast_content_eq_skip_attr branch February 4, 2025 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue 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.

1 participant