Revert "pre-expansion gate box_syntax"
This reverts commit e4ed8865786a787a7b0c045f7674569b6be0e9bc.
This commit is contained in:
parent
4c947a26f2
commit
20bfff66a9
@ -153,6 +153,9 @@ fn leveled_feature_err<'a, S: Into<MultiSpan>>(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const EXPLAIN_BOX_SYNTAX: &str =
|
||||||
|
"box expression syntax is experimental; you can call `Box::new` instead";
|
||||||
|
|
||||||
pub const EXPLAIN_STMT_ATTR_SYNTAX: &str =
|
pub const EXPLAIN_STMT_ATTR_SYNTAX: &str =
|
||||||
"attributes on expressions are experimental";
|
"attributes on expressions are experimental";
|
||||||
|
|
||||||
@ -504,6 +507,9 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
|
|||||||
|
|
||||||
fn visit_expr(&mut self, e: &'a ast::Expr) {
|
fn visit_expr(&mut self, e: &'a ast::Expr) {
|
||||||
match e.kind {
|
match e.kind {
|
||||||
|
ast::ExprKind::Box(_) => {
|
||||||
|
gate_feature_post!(&self, box_syntax, e.span, EXPLAIN_BOX_SYNTAX);
|
||||||
|
}
|
||||||
ast::ExprKind::Type(..) => {
|
ast::ExprKind::Type(..) => {
|
||||||
// To avoid noise about type ascription in common syntax errors, only emit if it
|
// To avoid noise about type ascription in common syntax errors, only emit if it
|
||||||
// is the *only* error.
|
// is the *only* error.
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
// Test that the use of the box syntax is gated by `box_syntax` feature gate.
|
// Test that the use of the box syntax is gated by `box_syntax` feature gate.
|
||||||
|
|
||||||
#[cfg(FALSE)]
|
fn main() {
|
||||||
fn foo() {
|
|
||||||
let x = box 3;
|
let x = box 3;
|
||||||
//~^ ERROR box expression syntax is experimental; you can call `Box::new` instead
|
//~^ ERROR box expression syntax is experimental; you can call `Box::new` instead
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
error[E0658]: box expression syntax is experimental; you can call `Box::new` instead
|
error[E0658]: box expression syntax is experimental; you can call `Box::new` instead
|
||||||
--> $DIR/feature-gate-box_syntax.rs:5:13
|
--> $DIR/feature-gate-box_syntax.rs:4:13
|
||||||
|
|
|
|
||||||
LL | let x = box 3;
|
LL | let x = box 3;
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
Loading…
x
Reference in New Issue
Block a user