mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Use derive
rather than deriving
in tests
This commit is contained in:
parent
7506fe5269
commit
30e149231c
@ -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
|
||||
}
|
||||
|
@ -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 {}
|
||||
|
@ -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>>)
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -9,7 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct foo(Box<uint>);
|
||||
|
||||
impl Add<foo, foo> for foo {
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ impl<T> MyTrait<T> for T { //~ ERROR E0119
|
||||
}
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct MyType {
|
||||
dummy: uint
|
||||
}
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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() {}
|
||||
|
@ -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`
|
||||
|
@ -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() { }
|
||||
|
@ -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
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
enum Enum {
|
||||
A {
|
||||
x: Error //~ ERROR
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
enum Enum {
|
||||
A(
|
||||
Error //~ ERROR
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct Struct {
|
||||
x: Error //~ ERROR
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct Struct(
|
||||
Error //~ ERROR
|
||||
);
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Default)]
|
||||
#[derive(Default)]
|
||||
struct Struct {
|
||||
x: Error //~ ERROR `core::default::Default` is not implemented
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Default)]
|
||||
#[derive(Default)]
|
||||
struct Struct(
|
||||
Error //~ ERROR
|
||||
);
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Hash)]
|
||||
#[derive(Hash)]
|
||||
enum Enum {
|
||||
A {
|
||||
x: Error //~ ERROR
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Hash)]
|
||||
#[derive(Hash)]
|
||||
enum Enum {
|
||||
A(
|
||||
Error //~ ERROR
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Hash)]
|
||||
#[derive(Hash)]
|
||||
struct Struct {
|
||||
x: Error //~ ERROR
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Hash)]
|
||||
#[derive(Hash)]
|
||||
struct Struct(
|
||||
Error //~ ERROR
|
||||
);
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
#[derive(PartialEq)]
|
||||
enum Enum {
|
||||
A {
|
||||
x: Error //~ ERROR
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
#[derive(PartialEq)]
|
||||
enum Enum {
|
||||
A(
|
||||
Error //~ ERROR
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
#[derive(PartialEq)]
|
||||
struct Struct {
|
||||
x: Error //~ ERROR
|
||||
//~^ ERROR
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
#[derive(PartialEq)]
|
||||
struct Struct(
|
||||
Error //~ ERROR
|
||||
//~^ ERROR
|
||||
|
@ -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
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
extern crate rand;
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
#[derive(PartialEq)]
|
||||
struct Error;
|
||||
|
||||
#[deriving(PartialOrd,PartialEq)]
|
||||
#[derive(PartialOrd,PartialEq)]
|
||||
enum Enum {
|
||||
A(
|
||||
Error //~ ERROR
|
||||
|
@ -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
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
extern crate rand;
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
#[derive(PartialEq)]
|
||||
struct Error;
|
||||
|
||||
#[deriving(PartialOrd,PartialEq)]
|
||||
#[derive(PartialOrd,PartialEq)]
|
||||
struct Struct(
|
||||
Error //~ ERROR
|
||||
//~^ ERROR
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Rand)]
|
||||
#[derive(Rand)]
|
||||
enum Enum {
|
||||
A {
|
||||
x: Error //~ ERROR
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Rand)]
|
||||
#[derive(Rand)]
|
||||
enum Enum {
|
||||
A(
|
||||
Error //~ ERROR
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Rand)]
|
||||
#[derive(Rand)]
|
||||
struct Struct {
|
||||
x: Error //~ ERROR
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Rand)]
|
||||
#[derive(Rand)]
|
||||
struct Struct(
|
||||
Error //~ ERROR
|
||||
);
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
enum Enum {
|
||||
A {
|
||||
x: Error //~ ERROR
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
enum Enum {
|
||||
A(
|
||||
Error //~ ERROR
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
struct Struct {
|
||||
x: Error //~ ERROR
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
struct Struct(
|
||||
Error //~ ERROR
|
||||
);
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
extern crate rand;
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
#[derive(PartialEq)]
|
||||
struct Error;
|
||||
|
||||
#[deriving(Eq,PartialEq)]
|
||||
#[derive(Eq,PartialEq)]
|
||||
enum Enum {
|
||||
A {
|
||||
x: Error //~ ERROR
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
extern crate rand;
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
#[derive(PartialEq)]
|
||||
struct Error;
|
||||
|
||||
#[deriving(Eq,PartialEq)]
|
||||
#[derive(Eq,PartialEq)]
|
||||
enum Enum {
|
||||
A(
|
||||
Error //~ ERROR
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
extern crate rand;
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
#[derive(PartialEq)]
|
||||
struct Error;
|
||||
|
||||
#[deriving(Eq,PartialEq)]
|
||||
#[derive(Eq,PartialEq)]
|
||||
struct Struct {
|
||||
x: Error //~ ERROR
|
||||
}
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
extern crate rand;
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
#[derive(PartialEq)]
|
||||
struct Error;
|
||||
|
||||
#[deriving(Eq,PartialEq)]
|
||||
#[derive(Eq,PartialEq)]
|
||||
struct Struct(
|
||||
Error //~ ERROR
|
||||
);
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
extern crate rand;
|
||||
|
||||
#[deriving(Eq,PartialOrd,PartialEq)]
|
||||
#[derive(Eq,PartialOrd,PartialEq)]
|
||||
struct Error;
|
||||
|
||||
#[deriving(Ord,Eq,PartialOrd,PartialEq)]
|
||||
#[derive(Ord,Eq,PartialOrd,PartialEq)]
|
||||
enum Enum {
|
||||
A {
|
||||
x: Error //~ ERROR
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
extern crate rand;
|
||||
|
||||
#[deriving(Eq,PartialOrd,PartialEq)]
|
||||
#[derive(Eq,PartialOrd,PartialEq)]
|
||||
struct Error;
|
||||
|
||||
#[deriving(Ord,Eq,PartialOrd,PartialEq)]
|
||||
#[derive(Ord,Eq,PartialOrd,PartialEq)]
|
||||
enum Enum {
|
||||
A(
|
||||
Error //~ ERROR
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
extern crate rand;
|
||||
|
||||
#[deriving(Eq,PartialOrd,PartialEq)]
|
||||
#[derive(Eq,PartialOrd,PartialEq)]
|
||||
struct Error;
|
||||
|
||||
#[deriving(Ord,Eq,PartialOrd,PartialEq)]
|
||||
#[derive(Ord,Eq,PartialOrd,PartialEq)]
|
||||
struct Struct {
|
||||
x: Error //~ ERROR
|
||||
}
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
extern crate rand;
|
||||
|
||||
#[deriving(Eq,PartialOrd,PartialEq)]
|
||||
#[derive(Eq,PartialOrd,PartialEq)]
|
||||
struct Error;
|
||||
|
||||
#[deriving(Ord,Eq,PartialOrd,PartialEq)]
|
||||
#[derive(Ord,Eq,PartialOrd,PartialEq)]
|
||||
struct Struct(
|
||||
Error //~ ERROR
|
||||
);
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Zero)] //~ ERROR not implemented
|
||||
#[derive(Zero)] //~ ERROR not implemented
|
||||
struct Struct {
|
||||
x: Error
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ extern crate rand;
|
||||
|
||||
struct Error;
|
||||
|
||||
#[deriving(Zero)] //~ ERROR not implemented
|
||||
#[derive(Zero)] //~ ERROR not implemented
|
||||
struct Struct(
|
||||
Error
|
||||
);
|
||||
|
@ -9,4 +9,4 @@
|
||||
// except according to those terms.
|
||||
|
||||
/// hi
|
||||
#[deriving(Show)] //~ERROR expected item after attributes
|
||||
#[derive(Show)] //~ERROR expected item after attributes
|
||||
|
@ -16,10 +16,10 @@ struct Fat<Sized? T> {
|
||||
ptr: T
|
||||
}
|
||||
|
||||
#[deriving(PartialEq,Eq)]
|
||||
#[derive(PartialEq,Eq)]
|
||||
struct Bar;
|
||||
|
||||
#[deriving(PartialEq,Eq)]
|
||||
#[derive(PartialEq,Eq)]
|
||||
struct Bar1 {
|
||||
f: int
|
||||
}
|
||||
|
@ -16,10 +16,10 @@ struct Fat<Sized? T> {
|
||||
ptr: T
|
||||
}
|
||||
|
||||
#[deriving(PartialEq,Eq)]
|
||||
#[derive(PartialEq,Eq)]
|
||||
struct Bar;
|
||||
|
||||
#[deriving(PartialEq,Eq)]
|
||||
#[derive(PartialEq,Eq)]
|
||||
struct Bar1 {
|
||||
f: int
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ trait TraversesWorld {
|
||||
}
|
||||
|
||||
|
||||
#[deriving(Show, Eq, PartialEq, Hash)]
|
||||
#[derive(Show, Eq, PartialEq, Hash)]
|
||||
enum RoomDirection {
|
||||
West,
|
||||
East,
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
struct Pair<T, V> (T, V);
|
||||
|
||||
impl Pair<
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
#[derive(PartialEq)]
|
||||
struct thing(uint);
|
||||
impl PartialOrd for thing { //~ ERROR not all trait items implemented, missing: `partial_cmp`
|
||||
fn le(&self, other: &thing) -> bool { true }
|
||||
|
@ -11,7 +11,7 @@
|
||||
fn main() {
|
||||
let foo = 100;
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
enum Stuff {
|
||||
Bar = foo //~ ERROR attempt to use a non-constant value in a constant
|
||||
}
|
||||
|
@ -11,24 +11,24 @@
|
||||
#![allow(dead_code)]
|
||||
#![deny(raw_pointer_deriving)]
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
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)]
|
||||
struct Bar(*mut int); //~ ERROR use of `#[deriving]` with a raw pointer
|
||||
#[derive(Clone)]
|
||||
struct Bar(*mut int); //~ ERROR use of `#[derive]` with a raw pointer
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
enum Baz {
|
||||
A(*const int), //~ ERROR use of `#[deriving]` with a raw pointer
|
||||
B { x: *mut 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 `#[derive]` with a raw pointer
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct Buzz {
|
||||
x: (*const int, //~ ERROR use of `#[deriving]` with a raw pointer
|
||||
*const uint) //~ ERROR use of `#[deriving]` with a raw pointer
|
||||
x: (*const int, //~ ERROR use of `#[derive]` with a raw pointer
|
||||
*const uint) //~ ERROR use of `#[derive]` with a raw pointer
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#![deny(unused_parens)]
|
||||
|
||||
#[deriving(Eq, PartialEq)]
|
||||
#[derive(Eq, PartialEq)]
|
||||
struct X { y: bool }
|
||||
impl X {
|
||||
fn foo(&self) -> bool { self.y }
|
||||
|
@ -14,7 +14,7 @@ fn send<T:Send + std::fmt::Show>(ch: _chan<T>, data: T) {
|
||||
panic!();
|
||||
}
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
struct _chan<T>(int);
|
||||
|
||||
// Tests that "log(debug, message);" is flagged as using
|
||||
|
@ -14,7 +14,7 @@
|
||||
#![feature(asm)]
|
||||
#![feature(trace_macros, concat_idents)]
|
||||
|
||||
#[deriving(Default, //~ ERROR
|
||||
#[derive(Default, //~ ERROR
|
||||
Rand, //~ ERROR
|
||||
Zero)] //~ ERROR
|
||||
enum CantDeriveThose {}
|
||||
|
@ -13,11 +13,11 @@
|
||||
use std::task;
|
||||
use std::rc::Rc;
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
struct Port<T>(Rc<T>);
|
||||
|
||||
fn main() {
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
struct foo {
|
||||
_x: Port<()>,
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
// Test that a class with a non-copyable field can't be
|
||||
// copied
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
struct bar {
|
||||
x: int,
|
||||
}
|
||||
@ -26,7 +26,7 @@ fn bar(x:int) -> bar {
|
||||
}
|
||||
}
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
struct foo {
|
||||
i: int,
|
||||
j: bar,
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// error-pattern:non-scalar cast
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
struct foo {
|
||||
x: int
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ struct Foo {
|
||||
baz: uint
|
||||
}
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
struct Oof {
|
||||
rab: u8,
|
||||
zab: uint
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
struct r {
|
||||
b: bool,
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
use std::cell::Cell;
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
struct r<'a> {
|
||||
i: &'a Cell<int>,
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
struct r {
|
||||
i:int
|
||||
}
|
||||
|
@ -73,13 +73,13 @@
|
||||
|
||||
#![omit_gdb_pretty_printer_section]
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct Struct {
|
||||
a: int,
|
||||
b: f64
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct StructStruct {
|
||||
a: Struct,
|
||||
b: Struct
|
||||
|
@ -105,21 +105,21 @@ use self::AutoDiscriminant::{One, Two, Three};
|
||||
use self::ManualDiscriminant::{OneHundred, OneThousand, OneMillion};
|
||||
use self::SingleVariant::TheOnlyVariant;
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
enum AutoDiscriminant {
|
||||
One,
|
||||
Two,
|
||||
Three
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
enum ManualDiscriminant {
|
||||
OneHundred = 100,
|
||||
OneThousand = 1000,
|
||||
OneMillion = 1000000
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
enum SingleVariant {
|
||||
TheOnlyVariant
|
||||
}
|
||||
|
@ -72,7 +72,7 @@
|
||||
|
||||
#![omit_gdb_pretty_printer_section]
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct Struct {
|
||||
a: int,
|
||||
b: f64
|
||||
|
@ -9,7 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
#[repr(packed)]
|
||||
#[deriving(PartialEq, Show)]
|
||||
#[derive(PartialEq, Show)]
|
||||
struct Foo {
|
||||
a: i8,
|
||||
b: i16,
|
||||
|
@ -14,9 +14,9 @@
|
||||
|
||||
extern crate serialize;
|
||||
|
||||
#[deriving(Encodable)] pub struct A;
|
||||
#[deriving(Encodable)] pub struct B(int);
|
||||
#[deriving(Encodable)] pub struct C { x: int }
|
||||
#[deriving(Encodable)] pub enum D {}
|
||||
#[deriving(Encodable)] pub enum E { y }
|
||||
#[deriving(Encodable)] pub enum F { z(int) }
|
||||
#[derive(Encodable)] pub struct A;
|
||||
#[derive(Encodable)] pub struct B(int);
|
||||
#[derive(Encodable)] pub struct C { x: int }
|
||||
#[derive(Encodable)] pub enum D {}
|
||||
#[derive(Encodable)] pub enum E { y }
|
||||
#[derive(Encodable)] pub enum F { z(int) }
|
||||
|
@ -10,16 +10,16 @@
|
||||
|
||||
#![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.
|
||||
///
|
||||
/// ```rust
|
||||
/// mod to_make_deriving_work { // FIXME #4913
|
||||
///
|
||||
/// # #[deriving(PartialEq)] // invisible
|
||||
/// # #[derive(PartialEq)] // invisible
|
||||
/// # struct Foo; // invisible
|
||||
///
|
||||
/// #[deriving(PartialEq)] // Bar
|
||||
/// #[derive(PartialEq)] // Bar
|
||||
/// struct Bar(Foo);
|
||||
///
|
||||
/// fn test() {
|
||||
|
@ -3,6 +3,6 @@
|
||||
file="$1/doc/foo/fn.foo.html"
|
||||
|
||||
grep -v 'invisible' $file &&
|
||||
grep '#.*\[.*deriving.*(.*Eq.*).*\].*//.*Bar' $file
|
||||
grep '#.*\[.*derive.*(.*Eq.*).*\].*//.*Bar' $file
|
||||
|
||||
exit $?
|
||||
|
@ -17,7 +17,7 @@
|
||||
extern crate macro_crate_test;
|
||||
|
||||
#[into_foo]
|
||||
#[deriving(PartialEq, Clone, Show)]
|
||||
#[derive(PartialEq, Clone, Show)]
|
||||
fn foo() -> AFakeTypeThatHadBetterGoAway {}
|
||||
|
||||
pub fn main() {
|
||||
|
@ -33,7 +33,7 @@ fn syntax_extension(cx: &ExtCtxt) {
|
||||
let _g: P<syntax::ast::Expr> = quote_expr!(cx, true);
|
||||
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());
|
||||
|
||||
let _j: P<syntax::ast::Method> = quote_method!(cx, fn foo(&self) {});
|
||||
|
@ -9,7 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
|
||||
#[deriving(PartialEq, Show)]
|
||||
#[derive(PartialEq, Show)]
|
||||
struct Point { x : int }
|
||||
|
||||
pub fn main() {
|
||||
|
@ -41,7 +41,7 @@ fn test_rbml<'a, 'b, A:
|
||||
assert!(*a1 == a2);
|
||||
}
|
||||
|
||||
#[deriving(Decodable, Encodable)]
|
||||
#[derive(Decodable, Encodable)]
|
||||
enum Expr {
|
||||
Val(uint),
|
||||
Plus(@Expr, @Expr),
|
||||
@ -108,26 +108,26 @@ impl cmp::Eq for CLike {
|
||||
fn ne(&self, other: &CLike) -> bool { !self.eq(other) }
|
||||
}
|
||||
|
||||
#[deriving(Decodable, Encodable, Eq)]
|
||||
#[derive(Decodable, Encodable, Eq)]
|
||||
struct Spanned<T> {
|
||||
lo: uint,
|
||||
hi: uint,
|
||||
node: T,
|
||||
}
|
||||
|
||||
#[deriving(Decodable, Encodable)]
|
||||
#[derive(Decodable, Encodable)]
|
||||
struct SomeStruct { v: Vec<uint> }
|
||||
|
||||
#[deriving(Decodable, Encodable)]
|
||||
#[derive(Decodable, Encodable)]
|
||||
struct Point {x: uint, y: uint}
|
||||
|
||||
#[deriving(Decodable, Encodable)]
|
||||
#[derive(Decodable, Encodable)]
|
||||
enum Quark<T> {
|
||||
Top(T),
|
||||
Bottom(T)
|
||||
}
|
||||
|
||||
#[deriving(Decodable, Encodable)]
|
||||
#[derive(Decodable, Encodable)]
|
||||
enum CLike { A, B, C }
|
||||
|
||||
pub fn main() {
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
struct Pair<T, U> { a: T, b: U }
|
||||
struct Triple { x: int, y: int, z: int }
|
||||
|
||||
|
@ -59,7 +59,7 @@ fn test_ptr() {
|
||||
}
|
||||
}
|
||||
|
||||
#[deriving(PartialEq, Show)]
|
||||
#[derive(PartialEq, Show)]
|
||||
struct p {
|
||||
x: int,
|
||||
y: int,
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
use std::mem::swap;
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
struct Ints {sum: Box<int>, values: Vec<int> }
|
||||
|
||||
fn add_int(x: &mut Ints, v: int) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
extern crate trait_superkinds_in_metadata;
|
||||
use trait_superkinds_in_metadata::{RequiresRequiresShareAndSend, RequiresShare};
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
#[derive(PartialEq)]
|
||||
struct X<T>(T);
|
||||
|
||||
impl <T: Sync> RequiresShare for X<T> { }
|
||||
|
@ -47,7 +47,7 @@ fn dog() -> dog {
|
||||
}
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct cat {
|
||||
meows: uint,
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
use std::cmp;
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
enum cat_type { tuxedo, tabby, tortoiseshell }
|
||||
|
||||
impl Copy for cat_type {}
|
||||
|
@ -13,7 +13,7 @@ trait noisy {
|
||||
fn speak(&mut self);
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct cat {
|
||||
meows : uint,
|
||||
|
||||
|
@ -14,10 +14,10 @@ fn id<T>(x: T) -> T {
|
||||
x
|
||||
}
|
||||
|
||||
#[deriving(PartialEq, Show)]
|
||||
#[derive(PartialEq, Show)]
|
||||
struct Foo<T>(T);
|
||||
|
||||
#[deriving(PartialEq, Show)]
|
||||
#[derive(PartialEq, Show)]
|
||||
enum Bar<T> {
|
||||
Baz(T)
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ impl<T> MyTrait for T
|
||||
}
|
||||
}
|
||||
|
||||
#[deriving(Clone,Show,PartialEq)]
|
||||
#[derive(Clone,Show,PartialEq)]
|
||||
struct MyType {
|
||||
dummy: uint
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
use std::cmp;
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
struct foo { a: int, b: int, c: int }
|
||||
|
||||
impl cmp::PartialEq for foo {
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
struct Test;
|
||||
|
||||
pub fn main() {}
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
enum E {
|
||||
A,
|
||||
B(()),
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
enum E<T,U> {
|
||||
A(T),
|
||||
B(T,U),
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct S<T> {
|
||||
foo: (),
|
||||
bar: (),
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct S<T>(T, ());
|
||||
|
||||
pub fn main() {
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct S {
|
||||
_int: int,
|
||||
_i8: i8,
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct S((), ());
|
||||
|
||||
pub fn main() {}
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// no-pretty-expanded FIXME #15189
|
||||
|
||||
#[deriving(PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
||||
enum E<T> {
|
||||
E0,
|
||||
E1(T),
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// no-pretty-expanded FIXME #15189
|
||||
|
||||
#[deriving(PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
||||
enum ES<T> {
|
||||
ES1 { x: T },
|
||||
ES2 { x: T, y: T }
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// no-pretty-expanded FIXME #15189
|
||||
|
||||
#[deriving(PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
||||
struct S<T> {
|
||||
x: T,
|
||||
y: T
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user