about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-06-21 04:01:25 +0000
committerbors <bors@rust-lang.org>2014-06-21 04:01:25 +0000
commit0ae4b97c09a5b5c230f5dee9bdcef85951b6e00d (patch)
tree0ff1ebbd45cf4c7f9dd211ac5fed80928bb8d3f0 /src/libsyntax
parentb1646cbfd908dc948b251e362669af421100647a (diff)
parent6008f2c98276be3b880a5a75a0ac234cd866800e (diff)
downloadrust-0ae4b97c09a5b5c230f5dee9bdcef85951b6e00d.tar.gz
rust-0ae4b97c09a5b5c230f5dee9bdcef85951b6e00d.zip
auto merge of #15029 : aturon/rust/stability-index, r=brson
This commit makes several changes to the stability index infrastructure:

* Stability levels are now inherited lexically, i.e., each item's
  stability level becomes the default for any nested items.

* The computed stability level for an item is stored as part of the
  metadata. When using an item from an external crate, this data is
  looked up and cached.

* The stability lint works from the computed stability level, rather
  than manual stability attribute annotations. However, the lint still
  checks only a limited set of item uses (e.g., it does not check every
  component of a path on import). This will be addressed in a later PR,
  as part of issue #8962.

* The stability lint only applies to items originating from external
  crates, since the stability index is intended as a promise to
  downstream crates.

* The "experimental" lint is now _allow_ by default. This is because
  almost all existing crates have been marked "experimental", pending
  library stabilization. With inheritance in place, this would generate
  a massive explosion of warnings for every Rust program.

  The lint should be changed back to deny-by-default after library
  stabilization is complete.

* The "deprecated" lint still warns by default.

The net result: we can begin tracking stability index for the standard
libraries as we stabilize, without impacting most clients.

Closes #13540.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/attr.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs
index 18a91fe465e..a037c0ac07e 100644
--- a/src/libsyntax/attr.rs
+++ b/src/libsyntax/attr.rs
@@ -361,13 +361,14 @@ pub fn test_cfg<AM: AttrMetaMethods, It: Iterator<AM>>
 }
 
 /// Represents the #[deprecated="foo"] and friends attributes.
+#[deriving(Encodable,Decodable,Clone,Show)]
 pub struct Stability {
     pub level: StabilityLevel,
     pub text: Option<InternedString>
 }
 
 /// The available stability levels.
-#[deriving(PartialEq,PartialOrd,Clone,Show)]
+#[deriving(Encodable,Decodable,PartialEq,PartialOrd,Clone,Show)]
 pub enum StabilityLevel {
     Deprecated,
     Experimental,