diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2016-10-06 16:44:59 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2016-10-12 08:40:22 +1300 |
| commit | a94f5934cd6d2a1fe88b06f2ae7e90b5367fc560 (patch) | |
| tree | 8941049fdc476a0de38a82f294eccf16c7a02b3a /src/libsyntax | |
| parent | 9bc6d2609233cece91803a8163dc3ba5579dfde8 (diff) | |
| download | rust-a94f5934cd6d2a1fe88b06f2ae7e90b5367fc560.tar.gz rust-a94f5934cd6d2a1fe88b06f2ae7e90b5367fc560.zip | |
Stabilise attributes on statements.
Note that attributes on expressions are still unstable and are behind the `stmt_expr_attributes` flag. cc [Tracking issue](https://github.com/rust-lang/rust/issues/15701)
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/config.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libsyntax/config.rs b/src/libsyntax/config.rs index 94a7f6030b9..3b81ea4917f 100644 --- a/src/libsyntax/config.rs +++ b/src/libsyntax/config.rs @@ -153,7 +153,7 @@ impl<'a> StripUnconfigured<'a> { } // Visit attributes on expression and statements (but not attributes on items in blocks). - fn visit_stmt_or_expr_attrs(&mut self, attrs: &[ast::Attribute]) { + fn visit_expr_attrs(&mut self, attrs: &[ast::Attribute]) { // flag the offending attributes for attr in attrs.iter() { if !self.features.map(|features| features.stmt_expr_attributes).unwrap_or(true) { @@ -227,7 +227,7 @@ impl<'a> StripUnconfigured<'a> { } pub fn configure_expr(&mut self, expr: P<ast::Expr>) -> P<ast::Expr> { - self.visit_stmt_or_expr_attrs(expr.attrs()); + self.visit_expr_attrs(expr.attrs()); // If an expr is valid to cfg away it will have been removed by the // outer stmt or expression folder before descending in here. @@ -245,7 +245,6 @@ impl<'a> StripUnconfigured<'a> { } pub fn configure_stmt(&mut self, stmt: ast::Stmt) -> Option<ast::Stmt> { - self.visit_stmt_or_expr_attrs(stmt.attrs()); self.configure(stmt) } } |
