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/parse/token.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/parse/token.rs')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index dad369792d7..87d65e258de 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -28,7 +28,7 @@ use std::path::BytesContainer; use std::rc::Rc; #[allow(non_camel_case_types)] -#[deriving(Clone, Copy, Encodable, Decodable, PartialEq, Eq, Hash, Show)] +#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] pub enum BinOpToken { Plus, Minus, @@ -43,7 +43,7 @@ pub enum BinOpToken { } /// A delimeter token -#[deriving(Clone, Copy, Encodable, Decodable, PartialEq, Eq, Hash, Show)] +#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] pub enum DelimToken { /// A round parenthesis: `(` or `)` Paren, @@ -53,14 +53,14 @@ pub enum DelimToken { Brace, } -#[deriving(Clone, Copy, Encodable, Decodable, PartialEq, Eq, Hash, Show)] +#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] pub enum IdentStyle { /// `::` follows the identifier with no whitespace in-between. ModName, Plain, } -#[deriving(Clone, Copy, Encodable, Decodable, PartialEq, Eq, Hash, Show)] +#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] pub enum Lit { Byte(ast::Name), Char(ast::Name), @@ -86,7 +86,7 @@ impl Lit { } #[allow(non_camel_case_types)] -#[deriving(Clone, Encodable, Decodable, PartialEq, Eq, Hash, Show)] +#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show)] pub enum Token { /* Expression-operator symbols. */ Eq, @@ -334,7 +334,7 @@ impl Token { } } -#[deriving(Clone, Encodable, Decodable, PartialEq, Eq, Hash)] +#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash)] /// For interpolation during macro expansion. pub enum Nonterminal { NtItem(P<ast::Item>), |
