diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2016-10-12 10:15:26 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2016-10-12 14:07:55 -0700 |
| commit | 9d70ff384f4a87e2cfe3d5e90b27637632bb373a (patch) | |
| tree | ef14774ca0dfd2daabeee9dad6da56be1b36106d /src/libsyntax | |
| parent | d13b102c5463d4258482815d04b93f360418245f (diff) | |
| parent | 79b5177378097ee39e595517ca76132b3a3dc0eb (diff) | |
| download | rust-9d70ff384f4a87e2cfe3d5e90b27637632bb373a.tar.gz rust-9d70ff384f4a87e2cfe3d5e90b27637632bb373a.zip | |
Rollup merge of #36995 - nrc:stable, r=@nikomatsakis
stabilise ?, attributes on stmts, deprecate Reflect r? @nikomatsakis
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/config.rs | 5 | ||||
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/lib.rs | 2 |
3 files changed, 5 insertions, 10 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) } } diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 9eed1d61244..62b88888fc8 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -253,9 +253,6 @@ declare_features! ( // a...b and ...b (active, inclusive_range_syntax, "1.7.0", Some(28237)), - // `expr?` - (active, question_mark, "1.9.0", Some(31436)), - // impl specialization (RFC 1210) (active, specialization, "1.7.0", Some(31844)), @@ -348,6 +345,8 @@ declare_features! ( (accepted, while_let, "1.0.0", None), // Allows `#[deprecated]` attribute (accepted, deprecated, "1.9.0", Some(29935)), + // `expr?` + (accepted, question_mark, "1.14.0", Some(31436)), ); // (changing above list without updating src/doc/reference.md makes @cmr sad) @@ -1072,9 +1071,6 @@ impl<'a> Visitor for PostExpansionVisitor<'a> { e.span, "inclusive range syntax is experimental"); } - ast::ExprKind::Try(..) => { - gate_feature_post!(&self, question_mark, e.span, "the `?` operator is not stable"); - } ast::ExprKind::InPlace(..) => { gate_feature_post!(&self, placement_in_syntax, e.span, EXPLAIN_PLACEMENT_IN); } diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 118ceb17ab4..6e671c9efdc 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -31,7 +31,7 @@ #![feature(staged_api)] #![feature(str_escape)] #![feature(unicode)] -#![feature(question_mark)] +#![cfg_attr(stage0, feature(question_mark))] #![feature(rustc_diagnostic_macros)] #![feature(specialization)] |
