diff options
| author | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-07-11 12:01:11 +0200 |
|---|---|---|
| committer | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-07-12 17:48:50 +0200 |
| commit | ef82007ed7b7833e3efdec0d80712849048c5c1f (patch) | |
| tree | 76a8c855164384dd5daa3c36a99fff02aacc00c3 /compiler/rustc_ast | |
| parent | 915e5352448afb3c24f89117468935283bc7d2cf (diff) | |
| download | rust-ef82007ed7b7833e3efdec0d80712849048c5c1f.tar.gz rust-ef82007ed7b7833e3efdec0d80712849048c5c1f.zip | |
Port `#[automatically_derived]` to the new attribute parsing infrastructure
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Diffstat (limited to 'compiler/rustc_ast')
| -rw-r--r-- | compiler/rustc_ast/src/attr/mod.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_ast/src/attr/mod.rs b/compiler/rustc_ast/src/attr/mod.rs index 44865c493b3..4348a4bb120 100644 --- a/compiler/rustc_ast/src/attr/mod.rs +++ b/compiler/rustc_ast/src/attr/mod.rs @@ -217,6 +217,10 @@ impl AttributeExt for Attribute { _ => None, } } + + fn is_automatically_derived_attr(&self) -> bool { + self.has_name(sym::automatically_derived) + } } impl Attribute { @@ -810,6 +814,7 @@ pub trait AttributeExt: Debug { .iter() .any(|kind| self.has_name(*kind)) } + fn is_automatically_derived_attr(&self) -> bool; /// Returns the documentation and its kind if this is a doc comment or a sugared doc comment. /// * `///doc` returns `Some(("doc", CommentKind::Line))`. |
