Skip to content

Port #[automatically_derived] to the new attribute parsing infrastructure #143779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JonathanBrouwer
Copy link
Contributor

Ports #[automatically_derived] to the new attribute parsing infrastructure for #131229 (comment)

r? @oli-obk
cc @jdonszelmann

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 11, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 11, 2025

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in compiler/rustc_attr_data_structures

cc @jdonszelmann

Some changes occurred in match checking

cc @Nadrieril

@@ -1304,6 +1304,7 @@ impl AttributeExt for Attribute {
Attribute::Parsed(AttributeKind::DocComment { span, .. }) => *span,
Attribute::Parsed(AttributeKind::MayDangle(span)) => *span,
Attribute::Parsed(AttributeKind::Ignore { span, .. }) => *span,
Attribute::Parsed(AttributeKind::AutomaticallyDerived(span)) => *span,
Copy link
Contributor Author

@JonathanBrouwer JonathanBrouwer Jul 11, 2025

Choose a reason for hiding this comment

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

This change is needed to fix #143780 for automatically_derived. automatically_derived is part of a test case so this is necessary to add now. @jdonszelmann and I are discussing a general solution to this problem.

@rust-log-analyzer

This comment has been minimized.

Signed-off-by: Jonathan Brouwer <[email protected]>
Signed-off-by: Jonathan Brouwer <[email protected]>
@JonathanBrouwer JonathanBrouwer force-pushed the automatically_derived_parser branch from 8ffd1bf to 499af0e Compare July 11, 2025 11:32
@Kobzol
Copy link
Member

Kobzol commented Jul 11, 2025

There are lots of these attributes produced by built-in derives, let's do a perf. run once this is ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants