summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2016-10-18 18:04:28 +1300
committerNick Cameron <ncameron@mozilla.com>2016-10-27 14:44:05 +1300
commit8c4a39cd951347b3060b07d2eb6a4ce225c44a8d (patch)
tree5fad4c63f9e2ac98b111ac5126664d32c2f43e98 /src/libsyntax
parent9322332140fe934ece4476ade531009b2f71f033 (diff)
downloadrust-8c4a39cd951347b3060b07d2eb6a4ce225c44a8d.tar.gz
rust-8c4a39cd951347b3060b07d2eb6a4ce225c44a8d.zip
review changes
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/feature_gate.rs31
-rw-r--r--src/libsyntax/lib.rs1
2 files changed, 24 insertions, 8 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 2e15a454df1..f2cbafe32df 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -377,17 +377,28 @@ pub enum AttributeGate {
     Ungated,
 }
 
-#[derive(Copy, Clone, PartialEq, Eq)]
+impl AttributeGate {
+    fn is_deprecated(&self) -> bool {
+        match *self {
+            Gated(Stability::Deprecated(_), ..) => true,
+            _ => false,
+        }
+    }
+}
+
+#[derive(Copy, Clone, PartialEq, Eq, Debug)]
 pub enum Stability {
     Unstable,
-    Deprecated,
+    // Argument is tracking issue link.
+    Deprecated(&'static str),
 }
 
 // fn() is not Debug
 impl ::std::fmt::Debug for AttributeGate {
     fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
         match *self {
-            Gated(_, ref name, ref expl, _) => write!(fmt, "Gated({}, {})", name, expl),
+            Gated(ref stab, ref name, ref expl, _) =>
+                write!(fmt, "Gated({:?}, {}, {})", stab, name, expl),
             Ungated => write!(fmt, "Ungated")
         }
     }
@@ -402,6 +413,10 @@ macro_rules! cfg_fn {
     }}
 }
 
+pub fn deprecated_attributes() -> Vec<&'static (&'static str, AttributeType, AttributeGate)> {
+    KNOWN_ATTRIBUTES.iter().filter(|a| a.2.is_deprecated()).collect()
+}
+
 // Attributes that have a special meaning to rustc or rustdoc
 pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeGate)] = &[
     // Normal attributes
@@ -643,11 +658,11 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeGat
     ("link_section", Whitelisted, Ungated),
     ("no_builtins", Whitelisted, Ungated),
     ("no_mangle", Whitelisted, Ungated),
-    ("no_debug", Whitelisted, Gated(Stability::Deprecated,
-                                    "no_debug",
-                                    "the `#[no_debug]` attribute \
-                                     is an experimental feature",
-                                    cfg_fn!(no_debug))),
+    ("no_debug", Whitelisted, Gated(
+        Stability::Deprecated("https://github.com/rust-lang/rust/issues/29721"),
+        "no_debug",
+        "the `#[no_debug]` attribute is an experimental feature",
+        cfg_fn!(no_debug))),
     ("omit_gdb_pretty_printer_section", Whitelisted, Gated(Stability::Unstable,
                                                        "omit_gdb_pretty_printer_section",
                                                        "the `#[omit_gdb_pretty_printer_section]` \
diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs
index 6e671c9efdc..b2f27878993 100644
--- a/src/libsyntax/lib.rs
+++ b/src/libsyntax/lib.rs
@@ -34,6 +34,7 @@
 #![cfg_attr(stage0, feature(question_mark))]
 #![feature(rustc_diagnostic_macros)]
 #![feature(specialization)]
+#![feature(dotdot_in_tuple_patterns)]
 
 extern crate serialize;
 extern crate term;