Skip to content

Commit

Permalink
inline two explanation constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Nov 30, 2019
1 parent 70234f1 commit db89679
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
9 changes: 2 additions & 7 deletions src/librustc_parse/config.rs
Expand Up @@ -11,12 +11,7 @@
use crate::validate_attr; use crate::validate_attr;
use rustc_feature::Features; use rustc_feature::Features;
use syntax::attr::HasAttrs; use syntax::attr::HasAttrs;
use syntax::feature_gate::{ use syntax::feature_gate::{feature_err, get_features, GateIssue};
feature_err,
EXPLAIN_STMT_ATTR_SYNTAX,
get_features,
GateIssue,
};
use syntax::attr; use syntax::attr;
use syntax::ast; use syntax::ast;
use syntax::edition::Edition; use syntax::edition::Edition;
Expand Down Expand Up @@ -218,7 +213,7 @@ impl<'a> StripUnconfigured<'a> {
sym::stmt_expr_attributes, sym::stmt_expr_attributes,
attr.span, attr.span,
GateIssue::Language, GateIssue::Language,
EXPLAIN_STMT_ATTR_SYNTAX); "attributes on expressions are experimental");


if attr.is_doc_comment() { if attr.is_doc_comment() {
err.help("`///` is for documentation comments. For a plain comment, use `//`."); err.help("`///` is for documentation comments. For a plain comment, use `//`.");
Expand Down
12 changes: 7 additions & 5 deletions src/librustc_typeck/check/coercion.rs
Expand Up @@ -644,11 +644,13 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
} }


if has_unsized_tuple_coercion && !self.tcx.features().unsized_tuple_coercion { if has_unsized_tuple_coercion && !self.tcx.features().unsized_tuple_coercion {
feature_gate::emit_feature_err(&self.tcx.sess.parse_sess, feature_gate::emit_feature_err(
sym::unsized_tuple_coercion, &self.tcx.sess.parse_sess,
self.cause.span, sym::unsized_tuple_coercion,
feature_gate::GateIssue::Language, self.cause.span,
feature_gate::EXPLAIN_UNSIZED_TUPLE_COERCION); feature_gate::GateIssue::Language,
"unsized tuple coercion is not stable enough for use and is subject to change",
);
} }


Ok(coercion) Ok(coercion)
Expand Down
6 changes: 0 additions & 6 deletions src/libsyntax/feature_gate/check.rs
Expand Up @@ -150,12 +150,6 @@ fn leveled_feature_err<'a, S: Into<MultiSpan>>(
const EXPLAIN_BOX_SYNTAX: &str = const EXPLAIN_BOX_SYNTAX: &str =
"box expression syntax is experimental; you can call `Box::new` instead"; "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> { struct PostExpansionVisitor<'a> {
parse_sess: &'a ParseSess, parse_sess: &'a ParseSess,
features: &'a Features, features: &'a Features,
Expand Down
1 change: 0 additions & 1 deletion src/libsyntax/lib.rs
Expand Up @@ -97,7 +97,6 @@ pub mod feature_gate {
pub use check::{ pub use check::{
check_crate, check_attribute, get_features, feature_err, emit_feature_err, check_crate, check_attribute, get_features, feature_err, emit_feature_err,
GateIssue, UnstableFeatures, GateIssue, UnstableFeatures,
EXPLAIN_STMT_ATTR_SYNTAX, EXPLAIN_UNSIZED_TUPLE_COERCION,
}; };
} }
pub mod mut_visit; pub mod mut_visit;
Expand Down

0 comments on commit db89679

Please sign in to comment.