about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-06-18 21:32:50 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-06-19 18:53:24 +1000
commit219389360c0b20cd6b980072e08723b91fea2c9b (patch)
tree770413a4f8857c97c75ca5e7847bc3f453b1e500
parent55cac26a9ef17da1c9c77c0816e88e178b7cc5dd (diff)
downloadrust-219389360c0b20cd6b980072e08723b91fea2c9b.tar.gz
rust-219389360c0b20cd6b980072e08723b91fea2c9b.zip
Add a comment.
Something that was non-obvious to me.
-rw-r--r--compiler/rustc_ast/src/ast.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs
index 9cb193b4a67..ca7f0363fa7 100644
--- a/compiler/rustc_ast/src/ast.rs
+++ b/compiler/rustc_ast/src/ast.rs
@@ -972,7 +972,9 @@ impl UnOp {
     }
 }
 
-/// A statement
+/// A statement. No `attrs` or `tokens` fields because each `StmtKind` variant
+/// contains an AST node with those fields. (Except for `StmtKind::Empty`,
+/// which never has attrs or tokens)
 #[derive(Clone, Encodable, Decodable, Debug)]
 pub struct Stmt {
     pub id: NodeId,