move Stability to rustc_feature

This commit is contained in:
Mazdak Farrokhzad
2019-11-30 00:39:51 +01:00
parent 3d080a4a77
commit 048201fa7a
5 changed files with 13 additions and 12 deletions
+8
View File
@@ -56,6 +56,14 @@ pub fn issue(&self) -> Option<NonZeroU32> {
}
}
#[derive(Copy, Clone, Debug)]
pub enum Stability {
Unstable,
// First argument is tracking issue link; second argument is an optional
// help message, which defaults to "remove this attribute".
Deprecated(&'static str, Option<&'static str>),
}
pub use accepted::ACCEPTED_FEATURES;
pub use active::{ACTIVE_FEATURES, Features, INCOMPLETE_FEATURES};
pub use removed::{REMOVED_FEATURES, STABLE_REMOVED_FEATURES};
+2 -1
View File
@@ -34,6 +34,7 @@
use lint::{LintPass, LateLintPass, EarlyLintPass, EarlyContext};
use rustc::util::nodemap::FxHashSet;
use rustc_feature::Stability;
use syntax::tokenstream::{TokenTree, TokenStream};
use syntax::ast::{self, Expr};
@@ -42,7 +43,7 @@
use syntax::source_map::Spanned;
use syntax::edition::Edition;
use syntax::feature_gate::{AttributeGate, AttributeType};
use syntax::feature_gate::{Stability, deprecated_attributes};
use syntax::feature_gate::deprecated_attributes;
use syntax_pos::{BytePos, Span};
use syntax::symbol::{Symbol, kw, sym};
use syntax::errors::{Applicability, DiagnosticBuilder};
+2 -2
View File
@@ -4,8 +4,8 @@
use AttributeGate::*;
use super::check::{emit_feature_err, GateIssue};
use super::check::{Stability, EXPLAIN_ALLOW_INTERNAL_UNSAFE, EXPLAIN_ALLOW_INTERNAL_UNSTABLE};
use rustc_feature::Features;
use super::check::{EXPLAIN_ALLOW_INTERNAL_UNSAFE, EXPLAIN_ALLOW_INTERNAL_UNSTABLE};
use rustc_feature::{Features, Stability};
use crate::ast;
use crate::attr::AttributeTemplate;
-8
View File
@@ -22,14 +22,6 @@
use std::env;
use std::num::NonZeroU32;
#[derive(Copy, Clone, Debug)]
pub enum Stability {
Unstable,
// First argument is tracking issue link; second argument is an optional
// help message, which defaults to "remove this attribute"
Deprecated(&'static str, Option<&'static str>),
}
macro_rules! gate_feature_fn {
($cx: expr, $has_feature: expr, $span: expr, $name: expr, $explain: expr, $level: expr) => {{
let (cx, has_feature, span,
+1 -1
View File
@@ -96,7 +96,7 @@ pub mod feature_gate {
mod check;
pub use check::{
check_crate, check_attribute, get_features, feature_err, emit_feature_err,
Stability, GateIssue, UnstableFeatures,
GateIssue, UnstableFeatures,
EXPLAIN_STMT_ATTR_SYNTAX, EXPLAIN_UNSIZED_TUPLE_COERCION,
};
mod builtin_attrs;