Use derive rather than deriving in tests

This commit is contained in:
Nick Cameron 2014-12-31 17:32:49 +13:00
parent 7506fe5269
commit 30e149231c
213 changed files with 320 additions and 320 deletions

View File

@ -13,7 +13,7 @@ use std::cmp::PartialEq;
pub trait MyNum : Add<Self,Self> + Sub<Self,Self> + Mul<Self,Self> + PartialEq + Clone { pub trait MyNum : Add<Self,Self> + Sub<Self,Self> + Mul<Self,Self> + PartialEq + Clone {
} }
#[deriving(Clone, Show)] #[derive(Clone, Show)]
pub struct MyInt { pub struct MyInt {
pub val: int pub val: int
} }

View File

@ -60,7 +60,7 @@ static OCCURRENCES: [&'static str;5] = [
// Code implementation // Code implementation
#[deriving(PartialEq, PartialOrd, Ord, Eq)] #[derive(PartialEq, PartialOrd, Ord, Eq)]
struct Code(u64); struct Code(u64);
impl Copy for Code {} impl Copy for Code {}

View File

@ -14,7 +14,7 @@ use std::os;
use std::task; use std::task;
use std::time::Duration; use std::time::Duration;
#[deriving(Clone)] #[derive(Clone)]
enum List<T> { enum List<T> {
Nil, Cons(T, Box<List<T>>) Nil, Cons(T, Box<List<T>>)
} }

View File

@ -8,4 +8,4 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Show)] //~ERROR expected item after attributes #[derive(Show)] //~ERROR expected item after attributes

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Clone)] #[derive(Clone)]
struct point { struct point {
x: int, x: int,
y: int, y: int,

View File

@ -9,7 +9,7 @@
// except according to those terms. // except according to those terms.
#[deriving(Clone)] #[derive(Clone)]
struct foo(Box<uint>); struct foo(Box<uint>);
impl Add<foo, foo> for foo { impl Add<foo, foo> for foo {

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Copy)] #[derive(Copy)]
struct Point { struct Point {
x: int, x: int,
y: int, y: int,

View File

@ -10,7 +10,7 @@
// Test that we do not permit moves from &[] matched by a vec pattern. // Test that we do not permit moves from &[] matched by a vec pattern.
#[deriving(Clone, Show)] #[derive(Clone, Show)]
struct Foo { struct Foo {
string: String string: String
} }

View File

@ -24,7 +24,7 @@ impl<T> MyTrait<T> for T { //~ ERROR E0119
} }
} }
#[deriving(Clone)] #[derive(Clone)]
struct MyType { struct MyType {
dummy: uint dummy: uint
} }

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Show)] #[derive(Show)]
struct foo { struct foo {
i: int, i: int,
} }

View File

@ -8,11 +8,11 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Copy(Bad))] #[derive(Copy(Bad))]
//~^ ERROR unexpected value in deriving, expected a trait //~^ ERROR unexpected value in deriving, expected a trait
struct Test; struct Test;
#[deriving(Sync)] #[derive(Sync)]
//~^ ERROR Sync is an unsafe trait and it should be implemented explicitly //~^ ERROR Sync is an unsafe trait and it should be implemented explicitly
struct Test1; struct Test1;

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Eqr)] //~ ERROR unknown `deriving` trait: `Eqr` #[derive(Eqr)] //~ ERROR unknown `derive` trait: `Eqr`
struct Foo; struct Foo;
pub fn main() {} pub fn main() {}

View File

@ -10,12 +10,12 @@
struct NoCloneOrEq; struct NoCloneOrEq;
#[deriving(PartialEq)] #[derive(PartialEq)]
struct E { struct E {
x: NoCloneOrEq //~ ERROR binary operation `==` cannot be applied to type `NoCloneOrEq` x: NoCloneOrEq //~ ERROR binary operation `==` cannot be applied to type `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 { struct C {
x: NoCloneOrEq x: NoCloneOrEq
//~^ ERROR the trait `core::clone::Clone` is not implemented for the type `NoCloneOrEq` //~^ ERROR the trait `core::clone::Clone` is not implemented for the type `NoCloneOrEq`

View File

@ -12,29 +12,29 @@
struct S; 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 { } 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 { } 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 { } 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; 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; 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 { } 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" { } 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; 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() { } fn main() { }

View File

@ -11,22 +11,22 @@
use std::num::FromPrimitive; use std::num::FromPrimitive;
use std::int; use std::int;
#[deriving(FromPrimitive)] #[derive(FromPrimitive)]
struct A { x: int } struct A { x: int }
//~^^ ERROR `FromPrimitive` cannot be derived for structs //~^^ ERROR `FromPrimitive` cannot be derived for structs
//~^^^ ERROR `FromPrimitive` cannot be derived for structs //~^^^ ERROR `FromPrimitive` cannot be derived for structs
#[deriving(FromPrimitive)] #[derive(FromPrimitive)]
struct B(int); struct B(int);
//~^^ ERROR `FromPrimitive` cannot be derived for structs //~^^ ERROR `FromPrimitive` cannot be derived for structs
//~^^^ ERROR `FromPrimitive` cannot be derived for structs //~^^^ ERROR `FromPrimitive` cannot be derived for structs
#[deriving(FromPrimitive)] #[derive(FromPrimitive)]
enum C { Foo(int), Bar(uint) } 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
//~^^^ 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 } } 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
//~^^^ ERROR `FromPrimitive` cannot be derived for enums with struct variants //~^^^ ERROR `FromPrimitive` cannot be derived for enums with struct variants

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Clone)] #[derive(Clone)]
enum Enum { enum Enum {
A { A {
x: Error //~ ERROR x: Error //~ ERROR

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Clone)] #[derive(Clone)]
enum Enum { enum Enum {
A( A(
Error //~ ERROR Error //~ ERROR

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Clone)] #[derive(Clone)]
struct Struct { struct Struct {
x: Error //~ ERROR x: Error //~ ERROR
} }

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Clone)] #[derive(Clone)]
struct Struct( struct Struct(
Error //~ ERROR Error //~ ERROR
); );

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Default)] #[derive(Default)]
struct Struct { struct Struct {
x: Error //~ ERROR `core::default::Default` is not implemented x: Error //~ ERROR `core::default::Default` is not implemented
} }

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Default)] #[derive(Default)]
struct Struct( struct Struct(
Error //~ ERROR Error //~ ERROR
); );

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Hash)] #[derive(Hash)]
enum Enum { enum Enum {
A { A {
x: Error //~ ERROR x: Error //~ ERROR

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Hash)] #[derive(Hash)]
enum Enum { enum Enum {
A( A(
Error //~ ERROR Error //~ ERROR

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Hash)] #[derive(Hash)]
struct Struct { struct Struct {
x: Error //~ ERROR x: Error //~ ERROR
} }

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Hash)] #[derive(Hash)]
struct Struct( struct Struct(
Error //~ ERROR Error //~ ERROR
); );

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(PartialEq)] #[derive(PartialEq)]
enum Enum { enum Enum {
A { A {
x: Error //~ ERROR x: Error //~ ERROR

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(PartialEq)] #[derive(PartialEq)]
enum Enum { enum Enum {
A( A(
Error //~ ERROR Error //~ ERROR

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(PartialEq)] #[derive(PartialEq)]
struct Struct { struct Struct {
x: Error //~ ERROR x: Error //~ ERROR
//~^ ERROR //~^ ERROR

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(PartialEq)] #[derive(PartialEq)]
struct Struct( struct Struct(
Error //~ ERROR Error //~ ERROR
//~^ ERROR //~^ ERROR

View File

@ -12,10 +12,10 @@
extern crate rand; extern crate rand;
#[deriving(PartialEq)] #[derive(PartialEq)]
struct Error; struct Error;
#[deriving(PartialOrd,PartialEq)] #[derive(PartialOrd,PartialEq)]
enum Enum { enum Enum {
A { A {
x: Error //~ ERROR x: Error //~ ERROR

View File

@ -12,10 +12,10 @@
extern crate rand; extern crate rand;
#[deriving(PartialEq)] #[derive(PartialEq)]
struct Error; struct Error;
#[deriving(PartialOrd,PartialEq)] #[derive(PartialOrd,PartialEq)]
enum Enum { enum Enum {
A( A(
Error //~ ERROR Error //~ ERROR

View File

@ -12,10 +12,10 @@
extern crate rand; extern crate rand;
#[deriving(PartialEq)] #[derive(PartialEq)]
struct Error; struct Error;
#[deriving(PartialOrd,PartialEq)] #[derive(PartialOrd,PartialEq)]
struct Struct { struct Struct {
x: Error //~ ERROR x: Error //~ ERROR
//~^ ERROR //~^ ERROR

View File

@ -12,10 +12,10 @@
extern crate rand; extern crate rand;
#[deriving(PartialEq)] #[derive(PartialEq)]
struct Error; struct Error;
#[deriving(PartialOrd,PartialEq)] #[derive(PartialOrd,PartialEq)]
struct Struct( struct Struct(
Error //~ ERROR Error //~ ERROR
//~^ ERROR //~^ ERROR

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Rand)] #[derive(Rand)]
enum Enum { enum Enum {
A { A {
x: Error //~ ERROR x: Error //~ ERROR

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Rand)] #[derive(Rand)]
enum Enum { enum Enum {
A( A(
Error //~ ERROR Error //~ ERROR

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Rand)] #[derive(Rand)]
struct Struct { struct Struct {
x: Error //~ ERROR x: Error //~ ERROR
} }

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Rand)] #[derive(Rand)]
struct Struct( struct Struct(
Error //~ ERROR Error //~ ERROR
); );

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Show)] #[derive(Show)]
enum Enum { enum Enum {
A { A {
x: Error //~ ERROR x: Error //~ ERROR

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Show)] #[derive(Show)]
enum Enum { enum Enum {
A( A(
Error //~ ERROR Error //~ ERROR

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Show)] #[derive(Show)]
struct Struct { struct Struct {
x: Error //~ ERROR x: Error //~ ERROR
} }

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Show)] #[derive(Show)]
struct Struct( struct Struct(
Error //~ ERROR Error //~ ERROR
); );

View File

@ -12,10 +12,10 @@
extern crate rand; extern crate rand;
#[deriving(PartialEq)] #[derive(PartialEq)]
struct Error; struct Error;
#[deriving(Eq,PartialEq)] #[derive(Eq,PartialEq)]
enum Enum { enum Enum {
A { A {
x: Error //~ ERROR x: Error //~ ERROR

View File

@ -12,10 +12,10 @@
extern crate rand; extern crate rand;
#[deriving(PartialEq)] #[derive(PartialEq)]
struct Error; struct Error;
#[deriving(Eq,PartialEq)] #[derive(Eq,PartialEq)]
enum Enum { enum Enum {
A( A(
Error //~ ERROR Error //~ ERROR

View File

@ -12,10 +12,10 @@
extern crate rand; extern crate rand;
#[deriving(PartialEq)] #[derive(PartialEq)]
struct Error; struct Error;
#[deriving(Eq,PartialEq)] #[derive(Eq,PartialEq)]
struct Struct { struct Struct {
x: Error //~ ERROR x: Error //~ ERROR
} }

View File

@ -12,10 +12,10 @@
extern crate rand; extern crate rand;
#[deriving(PartialEq)] #[derive(PartialEq)]
struct Error; struct Error;
#[deriving(Eq,PartialEq)] #[derive(Eq,PartialEq)]
struct Struct( struct Struct(
Error //~ ERROR Error //~ ERROR
); );

View File

@ -12,10 +12,10 @@
extern crate rand; extern crate rand;
#[deriving(Eq,PartialOrd,PartialEq)] #[derive(Eq,PartialOrd,PartialEq)]
struct Error; struct Error;
#[deriving(Ord,Eq,PartialOrd,PartialEq)] #[derive(Ord,Eq,PartialOrd,PartialEq)]
enum Enum { enum Enum {
A { A {
x: Error //~ ERROR x: Error //~ ERROR

View File

@ -12,10 +12,10 @@
extern crate rand; extern crate rand;
#[deriving(Eq,PartialOrd,PartialEq)] #[derive(Eq,PartialOrd,PartialEq)]
struct Error; struct Error;
#[deriving(Ord,Eq,PartialOrd,PartialEq)] #[derive(Ord,Eq,PartialOrd,PartialEq)]
enum Enum { enum Enum {
A( A(
Error //~ ERROR Error //~ ERROR

View File

@ -12,10 +12,10 @@
extern crate rand; extern crate rand;
#[deriving(Eq,PartialOrd,PartialEq)] #[derive(Eq,PartialOrd,PartialEq)]
struct Error; struct Error;
#[deriving(Ord,Eq,PartialOrd,PartialEq)] #[derive(Ord,Eq,PartialOrd,PartialEq)]
struct Struct { struct Struct {
x: Error //~ ERROR x: Error //~ ERROR
} }

View File

@ -12,10 +12,10 @@
extern crate rand; extern crate rand;
#[deriving(Eq,PartialOrd,PartialEq)] #[derive(Eq,PartialOrd,PartialEq)]
struct Error; struct Error;
#[deriving(Ord,Eq,PartialOrd,PartialEq)] #[derive(Ord,Eq,PartialOrd,PartialEq)]
struct Struct( struct Struct(
Error //~ ERROR Error //~ ERROR
); );

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Zero)] //~ ERROR not implemented #[derive(Zero)] //~ ERROR not implemented
struct Struct { struct Struct {
x: Error x: Error
} }

View File

@ -15,7 +15,7 @@ extern crate rand;
struct Error; struct Error;
#[deriving(Zero)] //~ ERROR not implemented #[derive(Zero)] //~ ERROR not implemented
struct Struct( struct Struct(
Error Error
); );

View File

@ -9,4 +9,4 @@
// except according to those terms. // except according to those terms.
/// hi /// hi
#[deriving(Show)] //~ERROR expected item after attributes #[derive(Show)] //~ERROR expected item after attributes

View File

@ -16,10 +16,10 @@ struct Fat<Sized? T> {
ptr: T ptr: T
} }
#[deriving(PartialEq,Eq)] #[derive(PartialEq,Eq)]
struct Bar; struct Bar;
#[deriving(PartialEq,Eq)] #[derive(PartialEq,Eq)]
struct Bar1 { struct Bar1 {
f: int f: int
} }

View File

@ -16,10 +16,10 @@ struct Fat<Sized? T> {
ptr: T ptr: T
} }
#[deriving(PartialEq,Eq)] #[derive(PartialEq,Eq)]
struct Bar; struct Bar;
#[deriving(PartialEq,Eq)] #[derive(PartialEq,Eq)]
struct Bar1 { struct Bar1 {
f: int f: int
} }

View File

@ -30,7 +30,7 @@ trait TraversesWorld {
} }
#[deriving(Show, Eq, PartialEq, Hash)] #[derive(Show, Eq, PartialEq, Hash)]
enum RoomDirection { enum RoomDirection {
West, West,
East, East,

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Show)] #[derive(Show)]
struct Pair<T, V> (T, V); struct Pair<T, V> (T, V);
impl Pair< impl Pair<

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(PartialEq)] #[derive(PartialEq)]
struct thing(uint); struct thing(uint);
impl PartialOrd for thing { //~ ERROR not all trait items implemented, missing: `partial_cmp` impl PartialOrd for thing { //~ ERROR not all trait items implemented, missing: `partial_cmp`
fn le(&self, other: &thing) -> bool { true } fn le(&self, other: &thing) -> bool { true }

View File

@ -11,7 +11,7 @@
fn main() { fn main() {
let foo = 100; let foo = 100;
#[deriving(Show)] #[derive(Show)]
enum Stuff { enum Stuff {
Bar = foo //~ ERROR attempt to use a non-constant value in a constant Bar = foo //~ ERROR attempt to use a non-constant value in a constant
} }

View File

@ -11,24 +11,24 @@
#![allow(dead_code)] #![allow(dead_code)]
#![deny(raw_pointer_deriving)] #![deny(raw_pointer_deriving)]
#[deriving(Clone)] #[derive(Clone)]
struct Foo { struct Foo {
x: *const int //~ ERROR use of `#[deriving]` with a raw pointer x: *const int //~ ERROR use of `#[derive]` with a raw pointer
} }
#[deriving(Clone)] #[derive(Clone)]
struct Bar(*mut int); //~ ERROR use of `#[deriving]` with a raw pointer struct Bar(*mut int); //~ ERROR use of `#[derive]` with a raw pointer
#[deriving(Clone)] #[derive(Clone)]
enum Baz { enum Baz {
A(*const int), //~ ERROR use of `#[deriving]` with a raw pointer A(*const int), //~ ERROR use of `#[derive]` with a raw pointer
B { x: *mut int } //~ ERROR use of `#[deriving]` with a raw pointer B { x: *mut int } //~ ERROR use of `#[derive]` with a raw pointer
} }
#[deriving(Clone)] #[derive(Clone)]
struct Buzz { struct Buzz {
x: (*const int, //~ ERROR use of `#[deriving]` with a raw pointer x: (*const int, //~ ERROR use of `#[derive]` with a raw pointer
*const uint) //~ ERROR use of `#[deriving]` with a raw pointer *const uint) //~ ERROR use of `#[derive]` with a raw pointer
} }
fn main() {} fn main() {}

View File

@ -10,7 +10,7 @@
#![deny(unused_parens)] #![deny(unused_parens)]
#[deriving(Eq, PartialEq)] #[derive(Eq, PartialEq)]
struct X { y: bool } struct X { y: bool }
impl X { impl X {
fn foo(&self) -> bool { self.y } fn foo(&self) -> bool { self.y }

View File

@ -14,7 +14,7 @@ fn send<T:Send + std::fmt::Show>(ch: _chan<T>, data: T) {
panic!(); panic!();
} }
#[deriving(Show)] #[derive(Show)]
struct _chan<T>(int); struct _chan<T>(int);
// Tests that "log(debug, message);" is flagged as using // Tests that "log(debug, message);" is flagged as using

View File

@ -14,7 +14,7 @@
#![feature(asm)] #![feature(asm)]
#![feature(trace_macros, concat_idents)] #![feature(trace_macros, concat_idents)]
#[deriving(Default, //~ ERROR #[derive(Default, //~ ERROR
Rand, //~ ERROR Rand, //~ ERROR
Zero)] //~ ERROR Zero)] //~ ERROR
enum CantDeriveThose {} enum CantDeriveThose {}

View File

@ -13,11 +13,11 @@
use std::task; use std::task;
use std::rc::Rc; use std::rc::Rc;
#[deriving(Show)] #[derive(Show)]
struct Port<T>(Rc<T>); struct Port<T>(Rc<T>);
fn main() { fn main() {
#[deriving(Show)] #[derive(Show)]
struct foo { struct foo {
_x: Port<()>, _x: Port<()>,
} }

View File

@ -11,7 +11,7 @@
// Test that a class with a non-copyable field can't be // Test that a class with a non-copyable field can't be
// copied // copied
#[deriving(Show)] #[derive(Show)]
struct bar { struct bar {
x: int, x: int,
} }
@ -26,7 +26,7 @@ fn bar(x:int) -> bar {
} }
} }
#[deriving(Show)] #[derive(Show)]
struct foo { struct foo {
i: int, i: int,
j: bar, j: bar,

View File

@ -10,7 +10,7 @@
// error-pattern:non-scalar cast // error-pattern:non-scalar cast
#[deriving(Show)] #[derive(Show)]
struct foo { struct foo {
x: int x: int
} }

View File

@ -23,7 +23,7 @@ struct Foo {
baz: uint baz: uint
} }
#[deriving(Show)] #[derive(Show)]
struct Oof { struct Oof {
rab: u8, rab: u8,
zab: uint zab: uint

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Show)] #[derive(Show)]
struct r { struct r {
b: bool, b: bool,
} }

View File

@ -12,7 +12,7 @@
use std::cell::Cell; use std::cell::Cell;
#[deriving(Show)] #[derive(Show)]
struct r<'a> { struct r<'a> {
i: &'a Cell<int>, i: &'a Cell<int>,
} }

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Show)] #[derive(Show)]
struct r { struct r {
i:int i:int
} }

View File

@ -73,13 +73,13 @@
#![omit_gdb_pretty_printer_section] #![omit_gdb_pretty_printer_section]
#[deriving(Clone)] #[derive(Clone)]
struct Struct { struct Struct {
a: int, a: int,
b: f64 b: f64
} }
#[deriving(Clone)] #[derive(Clone)]
struct StructStruct { struct StructStruct {
a: Struct, a: Struct,
b: Struct b: Struct

View File

@ -105,21 +105,21 @@ use self::AutoDiscriminant::{One, Two, Three};
use self::ManualDiscriminant::{OneHundred, OneThousand, OneMillion}; use self::ManualDiscriminant::{OneHundred, OneThousand, OneMillion};
use self::SingleVariant::TheOnlyVariant; use self::SingleVariant::TheOnlyVariant;
#[deriving(Copy)] #[derive(Copy)]
enum AutoDiscriminant { enum AutoDiscriminant {
One, One,
Two, Two,
Three Three
} }
#[deriving(Copy)] #[derive(Copy)]
enum ManualDiscriminant { enum ManualDiscriminant {
OneHundred = 100, OneHundred = 100,
OneThousand = 1000, OneThousand = 1000,
OneMillion = 1000000 OneMillion = 1000000
} }
#[deriving(Copy)] #[derive(Copy)]
enum SingleVariant { enum SingleVariant {
TheOnlyVariant TheOnlyVariant
} }

View File

@ -72,7 +72,7 @@
#![omit_gdb_pretty_printer_section] #![omit_gdb_pretty_printer_section]
#[deriving(Clone)] #[derive(Clone)]
struct Struct { struct Struct {
a: int, a: int,
b: f64 b: f64

View File

@ -9,7 +9,7 @@
// except according to those terms. // except according to those terms.
#[repr(packed)] #[repr(packed)]
#[deriving(PartialEq, Show)] #[derive(PartialEq, Show)]
struct Foo { struct Foo {
a: i8, a: i8,
b: i16, b: i16,

View File

@ -14,9 +14,9 @@
extern crate serialize; extern crate serialize;
#[deriving(Encodable)] pub struct A; #[derive(Encodable)] pub struct A;
#[deriving(Encodable)] pub struct B(int); #[derive(Encodable)] pub struct B(int);
#[deriving(Encodable)] pub struct C { x: int } #[derive(Encodable)] pub struct C { x: int }
#[deriving(Encodable)] pub enum D {} #[derive(Encodable)] pub enum D {}
#[deriving(Encodable)] pub enum E { y } #[derive(Encodable)] pub enum E { y }
#[deriving(Encodable)] pub enum F { z(int) } #[derive(Encodable)] pub enum F { z(int) }

View File

@ -10,16 +10,16 @@
#![crate_name="foo"] #![crate_name="foo"]
/// The '# ' lines should be removed from the output, but the #[deriving] should be /// The '# ' lines should be removed from the output, but the #[derive] should be
/// retained. /// retained.
/// ///
/// ```rust /// ```rust
/// mod to_make_deriving_work { // FIXME #4913 /// mod to_make_deriving_work { // FIXME #4913
/// ///
/// # #[deriving(PartialEq)] // invisible /// # #[derive(PartialEq)] // invisible
/// # struct Foo; // invisible /// # struct Foo; // invisible
/// ///
/// #[deriving(PartialEq)] // Bar /// #[derive(PartialEq)] // Bar
/// struct Bar(Foo); /// struct Bar(Foo);
/// ///
/// fn test() { /// fn test() {

View File

@ -3,6 +3,6 @@
file="$1/doc/foo/fn.foo.html" file="$1/doc/foo/fn.foo.html"
grep -v 'invisible' $file && grep -v 'invisible' $file &&
grep '#.*\[.*deriving.*(.*Eq.*).*\].*//.*Bar' $file grep '#.*\[.*derive.*(.*Eq.*).*\].*//.*Bar' $file
exit $? exit $?

View File

@ -17,7 +17,7 @@
extern crate macro_crate_test; extern crate macro_crate_test;
#[into_foo] #[into_foo]
#[deriving(PartialEq, Clone, Show)] #[derive(PartialEq, Clone, Show)]
fn foo() -> AFakeTypeThatHadBetterGoAway {} fn foo() -> AFakeTypeThatHadBetterGoAway {}
pub fn main() { pub fn main() {

View File

@ -33,7 +33,7 @@ fn syntax_extension(cx: &ExtCtxt) {
let _g: P<syntax::ast::Expr> = quote_expr!(cx, true); let _g: P<syntax::ast::Expr> = quote_expr!(cx, true);
let _h: P<syntax::ast::Expr> = quote_expr!(cx, 'a'); let _h: P<syntax::ast::Expr> = quote_expr!(cx, 'a');
let i: Option<P<syntax::ast::Item>> = quote_item!(cx, #[deriving(Eq)] struct Foo; ); let i: Option<P<syntax::ast::Item>> = quote_item!(cx, #[derive(Eq)] struct Foo; );
assert!(i.is_some()); assert!(i.is_some());
let _j: P<syntax::ast::Method> = quote_method!(cx, fn foo(&self) {}); let _j: P<syntax::ast::Method> = quote_method!(cx, fn foo(&self) {});

View File

@ -9,7 +9,7 @@
// except according to those terms. // except according to those terms.
#[deriving(PartialEq, Show)] #[derive(PartialEq, Show)]
struct Point { x : int } struct Point { x : int }
pub fn main() { pub fn main() {

View File

@ -41,7 +41,7 @@ fn test_rbml<'a, 'b, A:
assert!(*a1 == a2); assert!(*a1 == a2);
} }
#[deriving(Decodable, Encodable)] #[derive(Decodable, Encodable)]
enum Expr { enum Expr {
Val(uint), Val(uint),
Plus(@Expr, @Expr), Plus(@Expr, @Expr),
@ -108,26 +108,26 @@ impl cmp::Eq for CLike {
fn ne(&self, other: &CLike) -> bool { !self.eq(other) } fn ne(&self, other: &CLike) -> bool { !self.eq(other) }
} }
#[deriving(Decodable, Encodable, Eq)] #[derive(Decodable, Encodable, Eq)]
struct Spanned<T> { struct Spanned<T> {
lo: uint, lo: uint,
hi: uint, hi: uint,
node: T, node: T,
} }
#[deriving(Decodable, Encodable)] #[derive(Decodable, Encodable)]
struct SomeStruct { v: Vec<uint> } struct SomeStruct { v: Vec<uint> }
#[deriving(Decodable, Encodable)] #[derive(Decodable, Encodable)]
struct Point {x: uint, y: uint} struct Point {x: uint, y: uint}
#[deriving(Decodable, Encodable)] #[derive(Decodable, Encodable)]
enum Quark<T> { enum Quark<T> {
Top(T), Top(T),
Bottom(T) Bottom(T)
} }
#[deriving(Decodable, Encodable)] #[derive(Decodable, Encodable)]
enum CLike { A, B, C } enum CLike { A, B, C }
pub fn main() { pub fn main() {

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Show)] #[derive(Show)]
struct Pair<T, U> { a: T, b: U } struct Pair<T, U> { a: T, b: U }
struct Triple { x: int, y: int, z: int } struct Triple { x: int, y: int, z: int }

View File

@ -59,7 +59,7 @@ fn test_ptr() {
} }
} }
#[deriving(PartialEq, Show)] #[derive(PartialEq, Show)]
struct p { struct p {
x: int, x: int,
y: int, y: int,

View File

@ -10,7 +10,7 @@
use std::mem::swap; use std::mem::swap;
#[deriving(Show)] #[derive(Show)]
struct Ints {sum: Box<int>, values: Vec<int> } struct Ints {sum: Box<int>, values: Vec<int> }
fn add_int(x: &mut Ints, v: int) { fn add_int(x: &mut Ints, v: int) {

View File

@ -17,7 +17,7 @@
extern crate trait_superkinds_in_metadata; extern crate trait_superkinds_in_metadata;
use trait_superkinds_in_metadata::{RequiresRequiresShareAndSend, RequiresShare}; use trait_superkinds_in_metadata::{RequiresRequiresShareAndSend, RequiresShare};
#[deriving(PartialEq)] #[derive(PartialEq)]
struct X<T>(T); struct X<T>(T);
impl <T: Sync> RequiresShare for X<T> { } impl <T: Sync> RequiresShare for X<T> { }

View File

@ -47,7 +47,7 @@ fn dog() -> dog {
} }
} }
#[deriving(Clone)] #[derive(Clone)]
struct cat { struct cat {
meows: uint, meows: uint,

View File

@ -11,7 +11,7 @@
use std::cmp; use std::cmp;
#[deriving(Show)] #[derive(Show)]
enum cat_type { tuxedo, tabby, tortoiseshell } enum cat_type { tuxedo, tabby, tortoiseshell }
impl Copy for cat_type {} impl Copy for cat_type {}

View File

@ -13,7 +13,7 @@ trait noisy {
fn speak(&mut self); fn speak(&mut self);
} }
#[deriving(Clone)] #[derive(Clone)]
struct cat { struct cat {
meows : uint, meows : uint,

View File

@ -14,10 +14,10 @@ fn id<T>(x: T) -> T {
x x
} }
#[deriving(PartialEq, Show)] #[derive(PartialEq, Show)]
struct Foo<T>(T); struct Foo<T>(T);
#[deriving(PartialEq, Show)] #[derive(PartialEq, Show)]
enum Bar<T> { enum Bar<T> {
Baz(T) Baz(T)
} }

View File

@ -23,7 +23,7 @@ impl<T> MyTrait for T
} }
} }
#[deriving(Clone,Show,PartialEq)] #[derive(Clone,Show,PartialEq)]
struct MyType { struct MyType {
dummy: uint dummy: uint
} }

View File

@ -10,7 +10,7 @@
use std::cmp; use std::cmp;
#[deriving(Show)] #[derive(Show)]
struct foo { a: int, b: int, c: int } struct foo { a: int, b: int, c: int }
impl cmp::PartialEq for foo { impl cmp::PartialEq for foo {

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Copy)] #[derive(Copy)]
struct Test; struct Test;
pub fn main() {} pub fn main() {}

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Clone)] #[derive(Clone)]
enum E { enum E {
A, A,
B(()), B(()),

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Clone)] #[derive(Clone)]
enum E<T,U> { enum E<T,U> {
A(T), A(T),
B(T,U), B(T,U),

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Clone)] #[derive(Clone)]
struct S<T> { struct S<T> {
foo: (), foo: (),
bar: (), bar: (),

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Clone)] #[derive(Clone)]
struct S<T>(T, ()); struct S<T>(T, ());
pub fn main() { pub fn main() {

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Clone)] #[derive(Clone)]
struct S { struct S {
_int: int, _int: int,
_i8: i8, _i8: i8,

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#[deriving(Clone)] #[derive(Clone)]
struct S((), ()); struct S((), ());
pub fn main() {} pub fn main() {}

View File

@ -10,7 +10,7 @@
// no-pretty-expanded FIXME #15189 // no-pretty-expanded FIXME #15189
#[deriving(PartialEq, Eq, PartialOrd, Ord)] #[derive(PartialEq, Eq, PartialOrd, Ord)]
enum E<T> { enum E<T> {
E0, E0,
E1(T), E1(T),

View File

@ -10,7 +10,7 @@
// no-pretty-expanded FIXME #15189 // no-pretty-expanded FIXME #15189
#[deriving(PartialEq, Eq, PartialOrd, Ord)] #[derive(PartialEq, Eq, PartialOrd, Ord)]
enum ES<T> { enum ES<T> {
ES1 { x: T }, ES1 { x: T },
ES2 { x: T, y: T } ES2 { x: T, y: T }

View File

@ -10,7 +10,7 @@
// no-pretty-expanded FIXME #15189 // no-pretty-expanded FIXME #15189
#[deriving(PartialEq, Eq, PartialOrd, Ord)] #[derive(PartialEq, Eq, PartialOrd, Ord)]
struct S<T> { struct S<T> {
x: T, x: T,
y: T y: T

Some files were not shown because too many files have changed in this diff Show More