summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-11-23 20:08:49 +0000
committerbors <bors@rust-lang.org>2015-11-23 20:08:49 +0000
commit040a77f772d7693598499a161f53ed230fb61c52 (patch)
tree71f1f369c9175a3655dff16f98465da8f2bce375 /src/libsyntax
parent8e9a97529d9fd112f338501e68e33bac1c41d1a4 (diff)
parenta613059e3fcfb751f7664f67a4a6c99faf436483 (diff)
downloadrust-040a77f772d7693598499a161f53ed230fb61c52.tar.gz
rust-040a77f772d7693598499a161f53ed230fb61c52.zip
Auto merge of #29952 - petrochenkov:depr, r=brson
Part of https://github.com/rust-lang/rust/issues/29935

The deprecation lint is still called "deprecated", so people can continue using `#[allow(deprecated)]` and similar things.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/attr.rs10
-rw-r--r--src/libsyntax/ext/base.rs2
-rw-r--r--src/libsyntax/feature_gate.rs2
-rw-r--r--src/libsyntax/lib.rs2
-rw-r--r--src/libsyntax/util/small_vector.rs2
5 files changed, 10 insertions, 8 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs
index 571f9506437..153a81e6c54 100644
--- a/src/libsyntax/attr.rs
+++ b/src/libsyntax/attr.rs
@@ -381,7 +381,7 @@ pub fn cfg_matches(diagnostic: &SpanHandler, cfgs: &[P<MetaItem>], cfg: &ast::Me
     }
 }
 
-/// Represents the #[stable], #[unstable] and #[deprecated] attributes.
+/// Represents the #[stable], #[unstable] and #[rustc_deprecated] attributes.
 #[derive(RustcEncodable, RustcDecodable, Clone, Debug, PartialEq, Eq, Hash)]
 pub struct Stability {
     pub level: StabilityLevel,
@@ -420,7 +420,7 @@ fn find_stability_generic<'a, I>(diagnostic: &SpanHandler,
     'outer: for attr in attrs_iter {
         let tag = attr.name();
         let tag = &*tag;
-        if tag != "deprecated" && tag != "unstable" && tag != "stable" {
+        if tag != "rustc_deprecated" && tag != "unstable" && tag != "stable" {
             continue // not a stability level
         }
 
@@ -443,9 +443,9 @@ fn find_stability_generic<'a, I>(diagnostic: &SpanHandler,
             };
 
             match tag {
-                "deprecated" => {
+                "rustc_deprecated" => {
                     if depr.is_some() {
-                        diagnostic.span_err(item_sp, "multiple deprecated attributes");
+                        diagnostic.span_err(item_sp, "multiple rustc_deprecated attributes");
                         break
                     }
 
@@ -586,7 +586,7 @@ fn find_stability_generic<'a, I>(diagnostic: &SpanHandler,
             }
             stab.depr = Some(depr);
         } else {
-            diagnostic.span_err(item_sp, "deprecated attribute must be paired with \
+            diagnostic.span_err(item_sp, "rustc_deprecated attribute must be paired with \
                                           either stable or unstable attribute");
         }
     }
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index 0dba15760cd..c8db3853cc2 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -600,7 +600,7 @@ impl<'a> ExtCtxt<'a> {
     }
 
     #[unstable(feature = "rustc_private", issue = "0")]
-    #[deprecated(since = "1.0.0",
+    #[rustc_deprecated(since = "1.0.0",
                  reason = "Replaced with `expander().fold_expr()`")]
     pub fn expand_expr(&mut self, e: P<ast::Expr>) -> P<ast::Expr> {
         self.expander().fold_expr(e)
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index ca232963e65..1663bdca51f 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -370,7 +370,7 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeGat
 
     // FIXME: #14407 these are only looked at on-demand so we can't
     // guarantee they'll have already been checked
-    ("deprecated", Whitelisted, Ungated),
+    ("rustc_deprecated", Whitelisted, Ungated),
     ("must_use", Whitelisted, Ungated),
     ("stable", Whitelisted, Ungated),
     ("unstable", Whitelisted, Ungated),
diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs
index 0cd27d1b0cc..59cc380b0ec 100644
--- a/src/libsyntax/lib.rs
+++ b/src/libsyntax/lib.rs
@@ -26,6 +26,8 @@
        html_root_url = "https://doc.rust-lang.org/nightly/",
        test(attr(deny(warnings))))]
 
+#![cfg_attr(stage0, feature(rustc_attrs))]
+#![cfg_attr(stage0, allow(unused_attributes))]
 #![feature(associated_consts)]
 #![feature(drain)]
 #![feature(filling_drop)]
diff --git a/src/libsyntax/util/small_vector.rs b/src/libsyntax/util/small_vector.rs
index 9d53cb96926..dac3b054165 100644
--- a/src/libsyntax/util/small_vector.rs
+++ b/src/libsyntax/util/small_vector.rs
@@ -129,7 +129,7 @@ impl<T> SmallVector<T> {
 
     /// Deprecated: use `into_iter`.
     #[unstable(feature = "rustc_private", issue = "0")]
-    #[deprecated(since = "1.0.0", reason = "use into_iter")]
+    #[rustc_deprecated(since = "1.0.0", reason = "use into_iter")]
     pub fn move_iter(self) -> IntoIter<T> {
         self.into_iter()
     }