Skip to content

Change mod -> self in use items and deriving -> derive #20365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 2, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use derive rather than deriving in tests
  • Loading branch information
nrc committed Jan 2, 2015
commit 30e149231c627e61524d1b5bd6357886befae9e6
2 changes: 1 addition & 1 deletion src/test/auxiliary/trait_inheritance_overloading_xc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::cmp::PartialEq;
pub trait MyNum : Add<Self,Self> + Sub<Self,Self> + Mul<Self,Self> + PartialEq + Clone {
}

#[deriving(Clone, Show)]
#[derive(Clone, Show)]
pub struct MyInt {
pub val: int
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/bench/shootout-k-nucleotide.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static OCCURRENCES: [&'static str;5] = [

// Code implementation

#[deriving(PartialEq, PartialOrd, Ord, Eq)]
#[derive(PartialEq, PartialOrd, Ord, Eq)]
struct Code(u64);

impl Copy for Code {}
Expand Down
2 changes: 1 addition & 1 deletion src/test/bench/task-perf-alloc-unwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::os;
use std::task;
use std::time::Duration;

#[deriving(Clone)]
#[derive(Clone)]
enum List<T> {
Nil, Cons(T, Box<List<T>>)
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/attr-before-eof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[deriving(Show)] //~ERROR expected item after attributes
#[derive(Show)] //~ERROR expected item after attributes
2 changes: 1 addition & 1 deletion src/test/compile-fail/borrowck-init-in-fru.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[deriving(Clone)]
#[derive(Clone)]
struct point {
x: int,
y: int,
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/borrowck-loan-in-overloaded-op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.


#[deriving(Clone)]
#[derive(Clone)]
struct foo(Box<uint>);

impl Add<foo, foo> for foo {
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[deriving(Copy)]
#[derive(Copy)]
struct Point {
x: int,
y: int,
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/borrowck-move-out-of-vec-tail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// Test that we do not permit moves from &[] matched by a vec pattern.

#[deriving(Clone, Show)]
#[derive(Clone, Show)]
struct Foo {
string: String
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl<T> MyTrait<T> for T { //~ ERROR E0119
}
}

#[deriving(Clone)]
#[derive(Clone)]
struct MyType {
dummy: uint
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/copy-a-resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[deriving(Show)]
#[derive(Show)]
struct foo {
i: int,
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/deriving-bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[deriving(Copy(Bad))]
#[derive(Copy(Bad))]
//~^ ERROR unexpected value in deriving, expected a trait
struct Test;

#[deriving(Sync)]
#[derive(Sync)]
//~^ ERROR Sync is an unsafe trait and it should be implemented explicitly
struct Test1;

Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/deriving-meta-unknown-trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[deriving(Eqr)] //~ ERROR unknown `deriving` trait: `Eqr`
#[derive(Eqr)] //~ ERROR unknown `derive` trait: `Eqr`
struct Foo;

pub fn main() {}
4 changes: 2 additions & 2 deletions src/test/compile-fail/deriving-no-inner-impl-error-message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

struct NoCloneOrEq;

#[deriving(PartialEq)]
#[derive(PartialEq)]
struct E {
x: NoCloneOrEq //~ ERROR binary operation `==` cannot be applied to type `NoCloneOrEq`
//~^ ERROR binary operation `!=` cannot be applied to type `NoCloneOrEq`
}
#[deriving(Clone)]
#[derive(Clone)]
struct C {
x: NoCloneOrEq
//~^ ERROR the trait `core::clone::Clone` is not implemented for the type `NoCloneOrEq`
Expand Down
18 changes: 9 additions & 9 deletions src/test/compile-fail/deriving-non-type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@

struct S;

#[deriving(PartialEq)] //~ ERROR: `deriving` may only be applied to structs and enums
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
trait T { }

#[deriving(PartialEq)] //~ ERROR: `deriving` may only be applied to structs and enums
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
impl S { }

#[deriving(PartialEq)] //~ ERROR: `deriving` may only be applied to structs and enums
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
impl T for S { }

#[deriving(PartialEq)] //~ ERROR: `deriving` may only be applied to structs and enums
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
static s: uint = 0u;

#[deriving(PartialEq)] //~ ERROR: `deriving` may only be applied to structs and enums
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
const c: uint = 0u;

#[deriving(PartialEq)] //~ ERROR: `deriving` may only be applied to structs and enums
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
mod m { }

#[deriving(PartialEq)] //~ ERROR: `deriving` may only be applied to structs and enums
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
extern "C" { }

#[deriving(PartialEq)] //~ ERROR: `deriving` may only be applied to structs and enums
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
type A = uint;

#[deriving(PartialEq)] //~ ERROR: `deriving` may only be applied to structs and enums
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
fn main() { }
8 changes: 4 additions & 4 deletions src/test/compile-fail/deriving-primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
use std::num::FromPrimitive;
use std::int;

#[deriving(FromPrimitive)]
#[derive(FromPrimitive)]
struct A { x: int }
//~^^ ERROR `FromPrimitive` cannot be derived for structs
//~^^^ ERROR `FromPrimitive` cannot be derived for structs

#[deriving(FromPrimitive)]
#[derive(FromPrimitive)]
struct B(int);
//~^^ ERROR `FromPrimitive` cannot be derived for structs
//~^^^ ERROR `FromPrimitive` cannot be derived for structs

#[deriving(FromPrimitive)]
#[derive(FromPrimitive)]
enum C { Foo(int), Bar(uint) }
//~^^ ERROR `FromPrimitive` cannot be derived for enum variants with arguments
//~^^^ ERROR `FromPrimitive` cannot be derived for enum variants with arguments

#[deriving(FromPrimitive)]
#[derive(FromPrimitive)]
enum D { Baz { x: int } }
//~^^ ERROR `FromPrimitive` cannot be derived for enums with struct variants
//~^^^ ERROR `FromPrimitive` cannot be derived for enums with struct variants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(Clone)]
#[derive(Clone)]
enum Enum {
A {
x: Error //~ ERROR
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/deriving-span-Clone-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(Clone)]
#[derive(Clone)]
enum Enum {
A(
Error //~ ERROR
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/deriving-span-Clone-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(Clone)]
#[derive(Clone)]
struct Struct {
x: Error //~ ERROR
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/deriving-span-Clone-tuple-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(Clone)]
#[derive(Clone)]
struct Struct(
Error //~ ERROR
);
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/deriving-span-Default-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(Default)]
#[derive(Default)]
struct Struct {
x: Error //~ ERROR `core::default::Default` is not implemented
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(Default)]
#[derive(Default)]
struct Struct(
Error //~ ERROR
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(Hash)]
#[derive(Hash)]
enum Enum {
A {
x: Error //~ ERROR
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/deriving-span-Hash-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(Hash)]
#[derive(Hash)]
enum Enum {
A(
Error //~ ERROR
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/deriving-span-Hash-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(Hash)]
#[derive(Hash)]
struct Struct {
x: Error //~ ERROR
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/deriving-span-Hash-tuple-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(Hash)]
#[derive(Hash)]
struct Struct(
Error //~ ERROR
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(PartialEq)]
#[derive(PartialEq)]
enum Enum {
A {
x: Error //~ ERROR
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/deriving-span-PartialEq-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(PartialEq)]
#[derive(PartialEq)]
enum Enum {
A(
Error //~ ERROR
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/deriving-span-PartialEq-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(PartialEq)]
#[derive(PartialEq)]
struct Struct {
x: Error //~ ERROR
//~^ ERROR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(PartialEq)]
#[derive(PartialEq)]
struct Struct(
Error //~ ERROR
//~^ ERROR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

extern crate rand;

#[deriving(PartialEq)]
#[derive(PartialEq)]
struct Error;

#[deriving(PartialOrd,PartialEq)]
#[derive(PartialOrd,PartialEq)]
enum Enum {
A {
x: Error //~ ERROR
Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/deriving-span-PartialOrd-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

extern crate rand;

#[deriving(PartialEq)]
#[derive(PartialEq)]
struct Error;

#[deriving(PartialOrd,PartialEq)]
#[derive(PartialOrd,PartialEq)]
enum Enum {
A(
Error //~ ERROR
Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/deriving-span-PartialOrd-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

extern crate rand;

#[deriving(PartialEq)]
#[derive(PartialEq)]
struct Error;

#[deriving(PartialOrd,PartialEq)]
#[derive(PartialOrd,PartialEq)]
struct Struct {
x: Error //~ ERROR
//~^ ERROR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

extern crate rand;

#[deriving(PartialEq)]
#[derive(PartialEq)]
struct Error;

#[deriving(PartialOrd,PartialEq)]
#[derive(PartialOrd,PartialEq)]
struct Struct(
Error //~ ERROR
//~^ ERROR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(Rand)]
#[derive(Rand)]
enum Enum {
A {
x: Error //~ ERROR
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/deriving-span-Rand-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(Rand)]
#[derive(Rand)]
enum Enum {
A(
Error //~ ERROR
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/deriving-span-Rand-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate rand;

struct Error;

#[deriving(Rand)]
#[derive(Rand)]
struct Struct {
x: Error //~ ERROR
}
Expand Down
Loading