Skip to content
Permalink
Browse files

move Stability to rustc_feature

  • Loading branch information
Centril committed Nov 29, 2019
1 parent 3d080a4 commit 048201fa7a69b3c3795e76186bc954d06d2ca368
@@ -56,6 +56,14 @@ impl Feature {
}
}

#[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};
@@ -34,6 +34,7 @@ use lint::{LateContext, LintContext, LintArray};
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::attr::{self, HasAttrs, AttributeTemplate};
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};
@@ -4,8 +4,8 @@ use AttributeType::*;
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;
@@ -22,14 +22,6 @@ use rustc_error_codes::*;
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,
@@ -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;

0 comments on commit 048201f

Please sign in to comment.
You can’t perform that action at this time.