]> git.lizzy.rs Git - rust.git/commitdiff
move Stability to rustc_feature
authorMazdak Farrokhzad <twingoow@gmail.com>
Fri, 29 Nov 2019 23:39:51 +0000 (00:39 +0100)
committerMazdak Farrokhzad <twingoow@gmail.com>
Fri, 29 Nov 2019 23:39:51 +0000 (00:39 +0100)
src/librustc_feature/lib.rs
src/librustc_lint/builtin.rs
src/libsyntax/feature_gate/builtin_attrs.rs
src/libsyntax/feature_gate/check.rs
src/libsyntax/lib.rs

index c6388f47cfe30af18c9fcbef3816adf7cd7e712d..5d248f75216e23fe7f355349e83e7294d9c042e0 100644 (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};
index 3515ef13e79e12102814bf908f31b7fd99a142d7..06616d537de08a3a6fa52c77fa2060a0d73a9f1e 100644 (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};
index e6f61e8fcbe0bf5ffb46e319a736ee0d25e64056..70f923c27830e8eb15b8315777239dc6a1785037 100644 (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;
index 7d959756f23d35a24ee901834db7a0a6a0581dba..19e615f40fa9fe8fd4ff0606af46e5e33f00b2ff 100644 (file)
 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,
index f0d857673e70d2fd6c17929c26ca8516f3b86e58..e33aa8f1f2bd2bfbec1fbd0474b5f11fa2d951f9 100644 (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;