diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-12-18 22:52:48 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-12-22 00:14:56 -0800 |
| commit | a76a80276852f05f30adaa4d2a8a2729b5fc0bfa (patch) | |
| tree | 118a535c640013b22519f38dfa9af893dc5986a4 /src/libsyntax/attr.rs | |
| parent | 34d680009205de2302b902d8f9f5f7ae7a042f1a (diff) | |
| download | rust-a76a80276852f05f30adaa4d2a8a2729b5fc0bfa.tar.gz rust-a76a80276852f05f30adaa4d2a8a2729b5fc0bfa.zip | |
serialize: Fully deprecate the library
This commit completes the deprecation story for the in-tree serialization
library. The compiler will now emit a warning whenever it encounters
`deriving(Encodable)` or `deriving(Decodable)`, and the library itself is now
marked `#[unstable]` for when feature staging is enabled.
All users of serialization can migrate to the `rustc-serialize` crate on
crates.io which provides the exact same interface as the libserialize library
in-tree. The new deriving modes are named `RustcEncodable` and `RustcDecodable`
and require `extern crate "rustc-serialize" as rustc_serialize` at the crate
root in order to expand correctly.
To migrate all crates, add the following to your `Cargo.toml`:
[dependencies]
rustc-serialize = "0.1.1"
And then add the following to your crate root:
extern crate "rustc-serialize" as rustc_serialize;
Finally, rename `Encodable` and `Decodable` deriving modes to `RustcEncodable`
and `RustcDecodable`.
[breaking-change]
Diffstat (limited to 'src/libsyntax/attr.rs')
| -rw-r--r-- | src/libsyntax/attr.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 127cc5ed51d..cddf1a9923a 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -340,14 +340,14 @@ pub fn cfg_matches(diagnostic: &SpanHandler, cfgs: &[P<MetaItem>], cfg: &ast::Me } /// Represents the #[deprecated="foo"] and friends attributes. -#[deriving(Encodable,Decodable,Clone,Show)] +#[deriving(RustcEncodable,RustcDecodable,Clone,Show)] pub struct Stability { pub level: StabilityLevel, pub text: Option<InternedString> } /// The available stability levels. -#[deriving(Copy,Encodable,Decodable,PartialEq,PartialOrd,Clone,Show)] +#[deriving(RustcEncodable,RustcDecodable,PartialEq,PartialOrd,Clone,Show,Copy)] pub enum StabilityLevel { Deprecated, Experimental, @@ -464,7 +464,7 @@ fn int_type_of_word(s: &str) -> Option<IntType> { } } -#[deriving(Copy, PartialEq, Show, Encodable, Decodable)] +#[deriving(PartialEq, Show, RustcEncodable, RustcDecodable, Copy)] pub enum ReprAttr { ReprAny, ReprInt(Span, IntType), @@ -483,7 +483,7 @@ impl ReprAttr { } } -#[deriving(Copy, Eq, Hash, PartialEq, Show, Encodable, Decodable)] +#[deriving(Eq, Hash, PartialEq, Show, RustcEncodable, RustcDecodable, Copy)] pub enum IntType { SignedInt(ast::IntTy), UnsignedInt(ast::UintTy) |
