Port #[automatically_derived] to the new attribute parsing infrastructure

Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
This commit is contained in:
Jonathan Brouwer
2025-07-11 12:01:11 +02:00
parent 915e535244
commit ef82007ed7
13 changed files with 48 additions and 13 deletions

View File

@@ -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))`.