Skip to content

Commit 53ab137

Browse files
committed
Comment methods in CfgFolder
1 parent 6b3edc2 commit 53ab137

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libsyntax/config.rs

+7
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,16 @@ use ptr::P;
1919
use util::small_vector::SmallVector;
2020

2121
pub trait CfgFolder: fold::Folder {
22+
// Check if a node with the given attributes is in this configuration.
2223
fn in_cfg(&mut self, attrs: &[ast::Attribute]) -> bool;
24+
25+
// Update a node before checking if it is in this configuration (used to implement `cfg_attr`).
2326
fn process_attrs<T: HasAttrs>(&mut self, node: T) -> T { node }
27+
28+
// Visit attributes on expression and statements (but not attributes on items in blocks).
2429
fn visit_stmt_or_expr_attrs(&mut self, _attrs: &[ast::Attribute]) {}
30+
31+
// Visit unremovable (non-optional) expressions -- c.f. `fold_expr` vs `fold_opt_expr`.
2532
fn visit_unremovable_expr(&mut self, _expr: &ast::Expr) {}
2633

2734
fn configure<T: HasAttrs>(&mut self, node: T) -> Option<T> {

0 commit comments

Comments
 (0)