From b873c9e75f8add85acc8c68a12f5af9844007db6 Mon Sep 17 00:00:00 2001 From: Ty Overby Date: Sat, 3 Jan 2015 15:06:23 -0800 Subject: [PATCH] added old_orphan_check feature to tests and examples --- README.md | 6 ++++-- examples/basic.rs | 6 ++++-- src/lib.rs | 1 + src/test.rs | 12 ++++++------ 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a53946b..f9b2ba8 100644 --- a/README.md +++ b/README.md @@ -17,16 +17,18 @@ library. ## Example ```rust +#![feature(old_orphan_check)] + extern crate bincode; extern crate "rustc-serialize" as rustc_serialize; -#[deriving(RustcEncodable, RustcDecodable, PartialEq)] +#[derive(RustcEncodable, RustcDecodable, PartialEq)] struct Entity { x: f32, y: f32, } -#[deriving(RustcEncodable, RustcDecodable, PartialEq)] +#[derive(RustcEncodable, RustcDecodable, PartialEq)] struct World { entities: Vec } diff --git a/examples/basic.rs b/examples/basic.rs index 0eaf978..d9ef5d1 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -1,13 +1,15 @@ +#![feature(old_orphan_check)] + extern crate bincode; extern crate "rustc-serialize" as rustc_serialize; -#[deriving(RustcEncodable, RustcDecodable, PartialEq)] +#[derive(RustcEncodable, RustcDecodable, PartialEq)] struct Entity { x: f32, y: f32, } -#[deriving(RustcEncodable, RustcDecodable, PartialEq)] +#[derive(RustcEncodable, RustcDecodable, PartialEq)] struct World { entities: Vec } diff --git a/src/lib.rs b/src/lib.rs index 82baa19..d6d298d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,7 @@ #![crate_name = "bincode"] #![crate_type = "rlib"] #![crate_type = "dylib"] +#![feature(old_orphan_check)] extern crate "rustc-serialize" as rustc_serialize; diff --git a/src/test.rs b/src/test.rs index 3485a34..1ec6d73 100644 --- a/src/test.rs +++ b/src/test.rs @@ -65,7 +65,7 @@ fn test_tuple() { #[test] fn test_basic_struct() { - #[deriving(RustcEncodable, RustcDecodable, PartialEq, Show)] + #[derive(RustcEncodable, RustcDecodable, PartialEq, Show)] struct Easy { x: int, s: String, @@ -76,13 +76,13 @@ fn test_basic_struct() { #[test] fn test_nested_struct() { - #[deriving(RustcEncodable, RustcDecodable, PartialEq, Show)] + #[derive(RustcEncodable, RustcDecodable, PartialEq, Show)] struct Easy { x: int, s: String, y: uint } - #[deriving(RustcEncodable, RustcDecodable, PartialEq, Show)] + #[derive(RustcEncodable, RustcDecodable, PartialEq, Show)] struct Nest { f: Easy, b: uint, @@ -98,7 +98,7 @@ fn test_nested_struct() { #[test] fn test_struct_tuple() { - #[deriving(RustcEncodable, RustcDecodable, PartialEq, Show)] + #[derive(RustcEncodable, RustcDecodable, PartialEq, Show)] struct TubStr(uint, String, f32); the_same(TubStr(5, "hello".to_string(), 3.2)); @@ -113,7 +113,7 @@ fn option() { #[test] fn enm() { - #[deriving(RustcEncodable, RustcDecodable, PartialEq, Show)] + #[derive(RustcEncodable, RustcDecodable, PartialEq, Show)] enum TestEnum { NoArg, OneArg(uint), @@ -127,7 +127,7 @@ fn enm() { #[test] fn struct_enum() { - #[deriving(RustcEncodable, RustcDecodable, PartialEq, Show)] + #[derive(RustcEncodable, RustcDecodable, PartialEq, Show)] enum TestEnum { NoArg, OneArg(uint),