From 219389360c0b20cd6b980072e08723b91fea2c9b Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 18 Jun 2024 21:32:50 +1000 Subject: [PATCH] Add a comment. Something that was non-obvious to me. --- compiler/rustc_ast/src/ast.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 @@ pub fn is_by_value(self) -> bool { } } -/// 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,