about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-11-30 02:40:28 +0100
committerMazdak Farrokhzad <twingoow@gmail.com>2019-11-30 02:40:45 +0100
commitdb89679ebce6ed3b9bcb3f5cea430084b40a3a1f (patch)
tree417632d66b2a4679e91490c457320cec880e072d /src
parent70234f16dfbd22a7315401d46f5f7da2729463b5 (diff)
downloadrust-db89679ebce6ed3b9bcb3f5cea430084b40a3a1f.tar.gz
rust-db89679ebce6ed3b9bcb3f5cea430084b40a3a1f.zip
inline two explanation constants
Diffstat (limited to 'src')
-rw-r--r--src/librustc_parse/config.rs9
-rw-r--r--src/librustc_typeck/check/coercion.rs12
-rw-r--r--src/libsyntax/feature_gate/check.rs6
-rw-r--r--src/libsyntax/lib.rs1
4 files changed, 9 insertions, 19 deletions
diff --git a/src/librustc_parse/config.rs b/src/librustc_parse/config.rs
index 9c309f60515..dde320aed21 100644
--- a/src/librustc_parse/config.rs
+++ b/src/librustc_parse/config.rs
@@ -11,12 +11,7 @@
 use crate::validate_attr;
 use rustc_feature::Features;
 use syntax::attr::HasAttrs;
-use syntax::feature_gate::{
-    feature_err,
-    EXPLAIN_STMT_ATTR_SYNTAX,
-    get_features,
-    GateIssue,
-};
+use syntax::feature_gate::{feature_err, get_features, GateIssue};
 use syntax::attr;
 use syntax::ast;
 use syntax::edition::Edition;
@@ -218,7 +213,7 @@ impl<'a> StripUnconfigured<'a> {
                                       sym::stmt_expr_attributes,
                                       attr.span,
                                       GateIssue::Language,
-                                      EXPLAIN_STMT_ATTR_SYNTAX);
+                                      "attributes on expressions are experimental");
 
             if attr.is_doc_comment() {
                 err.help("`///` is for documentation comments. For a plain comment, use `//`.");
diff --git a/src/librustc_typeck/check/coercion.rs b/src/librustc_typeck/check/coercion.rs
index 871acb2726a..593f8e74ba9 100644
--- a/src/librustc_typeck/check/coercion.rs
+++ b/src/librustc_typeck/check/coercion.rs
@@ -644,11 +644,13 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
         }
 
         if has_unsized_tuple_coercion && !self.tcx.features().unsized_tuple_coercion {
-            feature_gate::emit_feature_err(&self.tcx.sess.parse_sess,
-                                           sym::unsized_tuple_coercion,
-                                           self.cause.span,
-                                           feature_gate::GateIssue::Language,
-                                           feature_gate::EXPLAIN_UNSIZED_TUPLE_COERCION);
+            feature_gate::emit_feature_err(
+                &self.tcx.sess.parse_sess,
+                sym::unsized_tuple_coercion,
+                self.cause.span,
+                feature_gate::GateIssue::Language,
+                "unsized tuple coercion is not stable enough for use and is subject to change",
+            );
         }
 
         Ok(coercion)
diff --git a/src/libsyntax/feature_gate/check.rs b/src/libsyntax/feature_gate/check.rs
index b5dc7d4db2b..c53f5f41e32 100644
--- a/src/libsyntax/feature_gate/check.rs
+++ b/src/libsyntax/feature_gate/check.rs
@@ -150,12 +150,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";
 
-pub const EXPLAIN_STMT_ATTR_SYNTAX: &str =
-    "attributes on expressions are experimental";
-
-pub const EXPLAIN_UNSIZED_TUPLE_COERCION: &str =
-    "unsized tuple coercion is not stable enough for use and is subject to change";
-
 struct PostExpansionVisitor<'a> {
     parse_sess: &'a ParseSess,
     features: &'a Features,
diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs
index 9db2007ea9c..fda95374f64 100644
--- a/src/libsyntax/lib.rs
+++ b/src/libsyntax/lib.rs
@@ -97,7 +97,6 @@ pub mod feature_gate {
     pub use check::{
         check_crate, check_attribute, get_features, feature_err, emit_feature_err,
         GateIssue, UnstableFeatures,
-        EXPLAIN_STMT_ATTR_SYNTAX, EXPLAIN_UNSIZED_TUPLE_COERCION,
     };
 }
 pub mod mut_visit;