Skip to content

Commit 048201f

Browse files
committed
move Stability to rustc_feature
1 parent 3d080a4 commit 048201f

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

src/librustc_feature/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ impl Feature {
5656
}
5757
}
5858

59+
#[derive(Copy, Clone, Debug)]
60+
pub enum Stability {
61+
Unstable,
62+
// First argument is tracking issue link; second argument is an optional
63+
// help message, which defaults to "remove this attribute".
64+
Deprecated(&'static str, Option<&'static str>),
65+
}
66+
5967
pub use accepted::ACCEPTED_FEATURES;
6068
pub use active::{ACTIVE_FEATURES, Features, INCOMPLETE_FEATURES};
6169
pub use removed::{REMOVED_FEATURES, STABLE_REMOVED_FEATURES};

src/librustc_lint/builtin.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use lint::{LateContext, LintContext, LintArray};
3434
use lint::{LintPass, LateLintPass, EarlyLintPass, EarlyContext};
3535

3636
use rustc::util::nodemap::FxHashSet;
37+
use rustc_feature::Stability;
3738

3839
use syntax::tokenstream::{TokenTree, TokenStream};
3940
use syntax::ast::{self, Expr};
@@ -42,7 +43,7 @@ use syntax::attr::{self, HasAttrs, AttributeTemplate};
4243
use syntax::source_map::Spanned;
4344
use syntax::edition::Edition;
4445
use syntax::feature_gate::{AttributeGate, AttributeType};
45-
use syntax::feature_gate::{Stability, deprecated_attributes};
46+
use syntax::feature_gate::deprecated_attributes;
4647
use syntax_pos::{BytePos, Span};
4748
use syntax::symbol::{Symbol, kw, sym};
4849
use syntax::errors::{Applicability, DiagnosticBuilder};

src/libsyntax/feature_gate/builtin_attrs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use AttributeType::*;
44
use AttributeGate::*;
55

66
use super::check::{emit_feature_err, GateIssue};
7-
use super::check::{Stability, EXPLAIN_ALLOW_INTERNAL_UNSAFE, EXPLAIN_ALLOW_INTERNAL_UNSTABLE};
8-
use rustc_feature::Features;
7+
use super::check::{EXPLAIN_ALLOW_INTERNAL_UNSAFE, EXPLAIN_ALLOW_INTERNAL_UNSTABLE};
8+
use rustc_feature::{Features, Stability};
99

1010
use crate::ast;
1111
use crate::attr::AttributeTemplate;

src/libsyntax/feature_gate/check.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ use rustc_error_codes::*;
2222
use std::env;
2323
use std::num::NonZeroU32;
2424

25-
#[derive(Copy, Clone, Debug)]
26-
pub enum Stability {
27-
Unstable,
28-
// First argument is tracking issue link; second argument is an optional
29-
// help message, which defaults to "remove this attribute"
30-
Deprecated(&'static str, Option<&'static str>),
31-
}
32-
3325
macro_rules! gate_feature_fn {
3426
($cx: expr, $has_feature: expr, $span: expr, $name: expr, $explain: expr, $level: expr) => {{
3527
let (cx, has_feature, span,

src/libsyntax/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub mod feature_gate {
9696
mod check;
9797
pub use check::{
9898
check_crate, check_attribute, get_features, feature_err, emit_feature_err,
99-
Stability, GateIssue, UnstableFeatures,
99+
GateIssue, UnstableFeatures,
100100
EXPLAIN_STMT_ATTR_SYNTAX, EXPLAIN_UNSIZED_TUPLE_COERCION,
101101
};
102102
mod builtin_attrs;

0 commit comments

Comments
 (0)