Skip to content

Commit

Permalink
check.rs: inline a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Nov 30, 2019
1 parent b45f21d commit 9626181
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libsyntax/feature_gate/check.rs
Expand Up @@ -145,9 +145,6 @@ fn leveled_feature_err<'a, S: Into<MultiSpan>>(

}

const EXPLAIN_BOX_SYNTAX: &str =
"box expression syntax is experimental; you can call `Box::new` instead";

struct PostExpansionVisitor<'a> {
parse_sess: &'a ParseSess,
features: &'a Features,
Expand Down Expand Up @@ -507,7 +504,10 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
fn visit_expr(&mut self, e: &'a ast::Expr) {
match e.kind {
ast::ExprKind::Box(_) => {
gate_feature_post!(&self, box_syntax, e.span, EXPLAIN_BOX_SYNTAX);
gate_feature_post!(
&self, box_syntax, e.span,
"box expression syntax is experimental; you can call `Box::new` instead"
);
}
ast::ExprKind::Type(..) => {
// To avoid noise about type ascription in common syntax errors, only emit if it
Expand Down

0 comments on commit 9626181

Please sign in to comment.