diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-11-30 03:30:49 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-11-30 03:30:49 +0100 |
| commit | 96261814948099370141413446c3b34a1354548a (patch) | |
| tree | 262afd26d34f97f86d873324c579487bebd61bfd | |
| parent | b45f21d38e7e127d257c6299b9da00fdc57476b9 (diff) | |
| download | rust-96261814948099370141413446c3b34a1354548a.tar.gz rust-96261814948099370141413446c3b34a1354548a.zip | |
check.rs: inline a constant
| -rw-r--r-- | src/libsyntax/feature_gate/check.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/feature_gate/check.rs b/src/libsyntax/feature_gate/check.rs index 141b324baa8..ea0eff1eed9 100644 --- a/src/libsyntax/feature_gate/check.rs +++ b/src/libsyntax/feature_gate/check.rs @@ -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 @@ 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 |
