Skip to content

Commit db89679

Browse files
committed
inline two explanation constants
1 parent 70234f1 commit db89679

File tree

4 files changed

+9
-19
lines changed

4 files changed

+9
-19
lines changed

src/librustc_parse/config.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@
1111
use crate::validate_attr;
1212
use rustc_feature::Features;
1313
use syntax::attr::HasAttrs;
14-
use syntax::feature_gate::{
15-
feature_err,
16-
EXPLAIN_STMT_ATTR_SYNTAX,
17-
get_features,
18-
GateIssue,
19-
};
14+
use syntax::feature_gate::{feature_err, get_features, GateIssue};
2015
use syntax::attr;
2116
use syntax::ast;
2217
use syntax::edition::Edition;
@@ -218,7 +213,7 @@ impl<'a> StripUnconfigured<'a> {
218213
sym::stmt_expr_attributes,
219214
attr.span,
220215
GateIssue::Language,
221-
EXPLAIN_STMT_ATTR_SYNTAX);
216+
"attributes on expressions are experimental");
222217

223218
if attr.is_doc_comment() {
224219
err.help("`///` is for documentation comments. For a plain comment, use `//`.");

src/librustc_typeck/check/coercion.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -644,11 +644,13 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
644644
}
645645

646646
if has_unsized_tuple_coercion && !self.tcx.features().unsized_tuple_coercion {
647-
feature_gate::emit_feature_err(&self.tcx.sess.parse_sess,
648-
sym::unsized_tuple_coercion,
649-
self.cause.span,
650-
feature_gate::GateIssue::Language,
651-
feature_gate::EXPLAIN_UNSIZED_TUPLE_COERCION);
647+
feature_gate::emit_feature_err(
648+
&self.tcx.sess.parse_sess,
649+
sym::unsized_tuple_coercion,
650+
self.cause.span,
651+
feature_gate::GateIssue::Language,
652+
"unsized tuple coercion is not stable enough for use and is subject to change",
653+
);
652654
}
653655

654656
Ok(coercion)

src/libsyntax/feature_gate/check.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,6 @@ fn leveled_feature_err<'a, S: Into<MultiSpan>>(
150150
const EXPLAIN_BOX_SYNTAX: &str =
151151
"box expression syntax is experimental; you can call `Box::new` instead";
152152

153-
pub const EXPLAIN_STMT_ATTR_SYNTAX: &str =
154-
"attributes on expressions are experimental";
155-
156-
pub const EXPLAIN_UNSIZED_TUPLE_COERCION: &str =
157-
"unsized tuple coercion is not stable enough for use and is subject to change";
158-
159153
struct PostExpansionVisitor<'a> {
160154
parse_sess: &'a ParseSess,
161155
features: &'a Features,

src/libsyntax/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ pub mod feature_gate {
9797
pub use check::{
9898
check_crate, check_attribute, get_features, feature_err, emit_feature_err,
9999
GateIssue, UnstableFeatures,
100-
EXPLAIN_STMT_ATTR_SYNTAX, EXPLAIN_UNSIZED_TUPLE_COERCION,
101100
};
102101
}
103102
pub mod mut_visit;

0 commit comments

Comments
 (0)