Skip to content

Commit 2ae0765

Browse files
committed
Add comments about attribute tokens.
This clarifies something that has puzzled me for some time.
1 parent 78e7c7b commit 2ae0765

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/rustc_ast/src/ast.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2786,6 +2786,7 @@ pub enum AttrKind {
27862786
#[derive(Clone, Encodable, Decodable, Debug)]
27872787
pub struct NormalAttr {
27882788
pub item: AttrItem,
2789+
// Tokens for the full attribute, e.g. `#[foo]`, `#![bar]`.
27892790
pub tokens: Option<LazyAttrTokenStream>,
27902791
}
27912792

@@ -2802,6 +2803,7 @@ impl NormalAttr {
28022803
pub struct AttrItem {
28032804
pub path: Path,
28042805
pub args: AttrArgs,
2806+
// Tokens for the meta item, e.g. just the `foo` within `#[foo]` or `#![foo]`.
28052807
pub tokens: Option<LazyAttrTokenStream>,
28062808
}
28072809

0 commit comments

Comments
 (0)