diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-04-25 10:14:17 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-04-25 10:14:17 +1000 |
| commit | 2ae0765ffb743de9845ee953bb6020db866e5b63 (patch) | |
| tree | 81112009fb370e7eb55610e73501dc4ad622289c | |
| parent | 78e7c7b9f9f6a671255ff0fb88b5a6fd6dbc7a58 (diff) | |
| download | rust-2ae0765ffb743de9845ee953bb6020db866e5b63.tar.gz rust-2ae0765ffb743de9845ee953bb6020db866e5b63.zip | |
Add comments about attribute tokens.
This clarifies something that has puzzled me for some time.
| -rw-r--r-- | compiler/rustc_ast/src/ast.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index bddb50568d4..dc3377f6bad 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -2786,6 +2786,7 @@ pub enum AttrKind { #[derive(Clone, Encodable, Decodable, Debug)] pub struct NormalAttr { pub item: AttrItem, + // Tokens for the full attribute, e.g. `#[foo]`, `#![bar]`. pub tokens: Option<LazyAttrTokenStream>, } @@ -2802,6 +2803,7 @@ impl NormalAttr { pub struct AttrItem { pub path: Path, pub args: AttrArgs, + // Tokens for the meta item, e.g. just the `foo` within `#[foo]` or `#![foo]`. pub tokens: Option<LazyAttrTokenStream>, } |
