]> git.lizzy.rs Git - rust.git/commitdiff
check.rs: inline a constant
authorMazdak Farrokhzad <twingoow@gmail.com>
Sat, 30 Nov 2019 02:30:49 +0000 (03:30 +0100)
committerMazdak Farrokhzad <twingoow@gmail.com>
Sat, 30 Nov 2019 02:30:49 +0000 (03:30 +0100)
src/libsyntax/feature_gate/check.rs

index 141b324baa8eae3f3eaed99f69011846c6670b80..ea0eff1eed9f86fe441df3bede0ade7b42091173 100644 (file)
@@ -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,
@@ -507,7 +504,10 @@ fn visit_ty(&mut self, ty: &'a ast::Ty) {
     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