From 71193c4b675e39fb674317710c13c23006135816 Mon Sep 17 00:00:00 2001 From: Jeffrey Seyfried Date: Tue, 24 May 2016 05:15:07 +0000 Subject: [PATCH] Comment methods in `CfgFolder` --- src/libsyntax/config.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libsyntax/config.rs b/src/libsyntax/config.rs index 77f20934d805b..63785cbe0fc9e 100644 --- a/src/libsyntax/config.rs +++ b/src/libsyntax/config.rs @@ -19,9 +19,16 @@ use ptr::P; use util::small_vector::SmallVector; pub trait CfgFolder: fold::Folder { + // Check if a node with the given attributes is in this configuration. fn in_cfg(&mut self, attrs: &[ast::Attribute]) -> bool; + + // Update a node before checking if it is in this configuration (used to implement `cfg_attrs`). fn process_attrs(&mut self, node: T) -> T { node } + + // Visit attributes on expression and statements (but not attributes on items in blocks). fn visit_stmt_or_expr_attrs(&mut self, _attrs: &[ast::Attribute]) {} + + // Visit unremovable (non-optional) expressions -- c.f. `fold_expr` vs `fold_opt_expr`. fn visit_unremovable_expr(&mut self, _expr: &ast::Expr) {} fn configure(&mut self, node: T) -> Option {