about summary refs log tree commit diff
path: root/src/libtime
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-12-18 22:52:48 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-12-22 00:14:56 -0800
commita76a80276852f05f30adaa4d2a8a2729b5fc0bfa (patch)
tree118a535c640013b22519f38dfa9af893dc5986a4 /src/libtime
parent34d680009205de2302b902d8f9f5f7ae7a042f1a (diff)
downloadrust-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/libtime')
-rw-r--r--src/libtime/lib.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libtime/lib.rs b/src/libtime/lib.rs
index dfa9b924274..e58a0229d69 100644
--- a/src/libtime/lib.rs
+++ b/src/libtime/lib.rs
@@ -24,7 +24,9 @@
 
 #[cfg(test)] #[phase(plugin, link)] extern crate log;
 
+#[cfg(stage0)]
 extern crate serialize;
+extern crate "serialize" as rustc_serialize;
 extern crate libc;
 
 pub use self::ParseError::*;
@@ -76,7 +78,8 @@ mod imp {
 }
 
 /// A record specifying a time value in seconds and nanoseconds.
-#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable, Show)]
+#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord, RustcEncodable,
+           RustcDecodable, Show, Copy)]
 pub struct Timespec {
     pub sec: i64,
     pub nsec: i32,