Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions src/compiletest/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::fmt;
use std::str::FromStr;
use regex::Regex;

#[deriving(Clone, PartialEq)]
#[derive(Clone, PartialEq)]
pub enum Mode {
CompileFail,
RunFail,
Expand Down Expand Up @@ -59,7 +59,7 @@ impl fmt::Show for Mode {
}
}

#[deriving(Clone)]
#[derive(Clone)]
pub struct Config {
// The library paths required for running the compiler
pub compile_lib_path: String,
Expand Down
2 changes: 1 addition & 1 deletion src/compiletest/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub struct ExpectedError {
pub static EXPECTED_PATTERN : &'static str =
r"//~(?P<follow>\|)?(?P<adjusts>\^*)\s*(?P<kind>\S*)\s*(?P<msg>.*)";

#[deriving(PartialEq, Show)]
#[derive(PartialEq, Show)]
enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) }

// Load any test directives embedded in the file
Expand Down
4 changes: 2 additions & 2 deletions src/doc/guide-error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ for all but the most trivial of situations.
Here's an example of using `Result`:

```rust
#[deriving(Show)]
#[derive(Show)]
enum Version { Version1, Version2 }

#[deriving(Show)]
#[derive(Show)]
enum ParseError { InvalidHeaderLength, InvalidVersion }

fn parse_version(header: &[u8]) -> Result<Version, ParseError> {
Expand Down
2 changes: 1 addition & 1 deletion src/doc/guide-pointers.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ Sometimes, you need a recursive data structure. The simplest is known as a


```{rust}
#[deriving(Show)]
#[derive(Show)]
enum List<T> {
Cons(T, Box<List<T>>),
Nil,
Expand Down
2 changes: 1 addition & 1 deletion src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2411,7 +2411,7 @@ for data structures. For example, the following will create an `impl` for the
the `PartialEq` or `Clone` constraints for the appropriate `impl`:

```
#[deriving(PartialEq, Clone)]
#[derive(PartialEq, Clone)]
struct Foo<T> {
a: int,
b: T
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ Rustdoc also supplies some extra sugar for helping with some tedious
documentation examples. If a line is prefixed with `# `, then the line
will not show up in the HTML documentation, but it will be used when
testing the code block (NB. the space after the `#` is required, so
that one can still write things like `#[deriving(Eq)]`).
that one can still write things like `#[derive(Eq)]`).

~~~md
```
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,6 @@ mod tests {
}

// Make sure deriving works with Arc<T>
#[deriving(Eq, Ord, PartialEq, PartialOrd, Clone, Show, Default)]
#[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Show, Default)]
struct Foo { inner: Arc<int> }
}
2 changes: 1 addition & 1 deletion src/libarena/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use std::rt::heap::{allocate, deallocate};
// The way arena uses arrays is really deeply awful. The arrays are
// allocated, and have capacities reserved, but the fill for the array
// will always stay at 0.
#[deriving(Clone, PartialEq)]
#[derive(Clone, PartialEq)]
struct Chunk {
data: Rc<RefCell<Vec<u8>>>,
fill: Cell<uint>,
Expand Down
6 changes: 3 additions & 3 deletions src/libcollections/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//! use std::collections::BinaryHeap;
//! use std::uint;
//!
//! #[deriving(Copy, Eq, PartialEq)]
//! #[derive(Copy, Eq, PartialEq)]
//! struct State {
//! cost: uint,
//! position: uint,
Expand Down Expand Up @@ -160,7 +160,7 @@ use vec::{mod, Vec};
/// A priority queue implemented with a binary heap.
///
/// This will be a max-heap.
#[deriving(Clone)]
#[derive(Clone)]
#[stable]
pub struct BinaryHeap<T> {
data: Vec<T>,
Expand Down Expand Up @@ -563,7 +563,7 @@ pub struct Iter <'a, T: 'a> {
iter: slice::Iter<'a, T>,
}

// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
impl<'a, T> Clone for Iter<'a, T> {
fn clone(&self) -> Iter<'a, T> {
Iter { iter: self.iter.clone() }
Expand Down
8 changes: 4 additions & 4 deletions src/libcollections/bit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ impl cmp::Eq for Bitv {}

/// An iterator for `Bitv`.
#[stable]
#[deriving(Clone)]
#[derive(Clone)]
pub struct Iter<'a> {
bitv: &'a Bitv,
next_idx: uint,
Expand Down Expand Up @@ -1117,7 +1117,7 @@ impl<'a> RandomAccessIterator<bool> for Iter<'a> {
/// let bv: Bitv = s.into_bitv();
/// assert!(bv[3]);
/// ```
#[deriving(Clone)]
#[derive(Clone)]
#[stable]
pub struct BitvSet {
bitv: Bitv,
Expand Down Expand Up @@ -1762,15 +1762,15 @@ impl<S: hash::Writer> hash::Hash<S> for BitvSet {
}

/// An iterator for `BitvSet`.
#[deriving(Clone)]
#[derive(Clone)]
#[stable]
pub struct SetIter<'a> {
set: &'a BitvSet,
next_idx: uint
}

/// An iterator combining two `BitvSet` iterators.
#[deriving(Clone)]
#[derive(Clone)]
struct TwoBitPositions<'a> {
set: &'a BitvSet,
other: &'a BitvSet,
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ use self::Continuation::{Continue, Finished};
/// force this degenerate behaviour to occur on every operation. While the total amount of work
/// done on each operation isn't *catastrophic*, and *is* still bounded by O(B log<sub>B</sub>n),
/// it is certainly much slower when it does.
#[deriving(Clone)]
#[derive(Clone)]
#[stable]
pub struct BTreeMap<K, V> {
root: Node<K, V>,
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/btree/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ impl<K: Clone, V: Clone> Clone for Node<K, V> {
/// println!("Uninitialized memory: {}", handle.into_kv());
/// }
/// ```
#[deriving(Copy)]
#[derive(Copy)]
pub struct Handle<NodeRef, Type, NodeType> {
node: NodeRef,
index: uint
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use core::fmt::Show;
///
/// See BTreeMap's documentation for a detailed discussion of this collection's performance
/// benefits and drawbacks.
#[deriving(Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]
#[derive(Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]
#[stable]
pub struct BTreeSet<T>{
map: BTreeMap<T, ()>,
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/dlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub struct IterMut<'a, T:'a> {
}

/// An iterator over mutable references to the items of a `DList`.
#[deriving(Clone)]
#[derive(Clone)]
#[stable]
pub struct IntoIter<T> {
list: DList<T>
Expand Down
8 changes: 4 additions & 4 deletions src/libcollections/enum_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use core::num::Int;

// FIXME(contentions): implement union family of methods? (general design may be wrong here)

#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
/// A specialized set implementation to use enum types.
pub struct EnumSet<E> {
// We must maintain the invariant that no bits are set
Expand Down Expand Up @@ -213,7 +213,7 @@ pub struct Iter<E> {
bits: uint,
}

// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
impl<E> Clone for Iter<E> {
fn clone(&self) -> Iter<E> {
Iter {
Expand Down Expand Up @@ -275,7 +275,7 @@ mod test {

use super::{EnumSet, CLike};

#[deriving(Copy, PartialEq, Show)]
#[derive(Copy, PartialEq, Show)]
#[repr(uint)]
enum Foo {
A, B, C
Expand Down Expand Up @@ -479,7 +479,7 @@ mod test {
#[should_fail]
fn test_overflow() {
#[allow(dead_code)]
#[deriving(Copy)]
#[derive(Copy)]
#[repr(uint)]
enum Bar {
V00, V01, V02, V03, V04, V05, V06, V07, V08, V09,
Expand Down
8 changes: 4 additions & 4 deletions src/libcollections/ring_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ pub struct Iter<'a, T:'a> {
head: uint
}

// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
impl<'a, T> Clone for Iter<'a, T> {
fn clone(&self) -> Iter<'a, T> {
Iter {
Expand Down Expand Up @@ -1638,21 +1638,21 @@ mod tests {
})
}

#[deriving(Clone, PartialEq, Show)]
#[derive(Clone, PartialEq, Show)]
enum Taggy {
One(int),
Two(int, int),
Three(int, int, int),
}

#[deriving(Clone, PartialEq, Show)]
#[derive(Clone, PartialEq, Show)]
enum Taggypar<T> {
Onepar(int),
Twopar(int, int),
Threepar(int, int, int),
}

#[deriving(Clone, PartialEq, Show)]
#[derive(Clone, PartialEq, Show)]
struct RecCy {
x: int,
y: int,
Expand Down
8 changes: 4 additions & 4 deletions src/libcollections/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ impl<T: Clone, V: AsSlice<T>> SliceConcatExt<T, Vec<T>> for [V] {
/// The last generated swap is always (0, 1), and it returns the
/// sequence to its initial order.
#[experimental]
#[deriving(Clone)]
#[derive(Clone)]
pub struct ElementSwaps {
sdir: Vec<SizeDirection>,
/// If `true`, emit the last swap that returns the sequence to initial
Expand Down Expand Up @@ -1103,11 +1103,11 @@ impl<T: Clone> ToOwned<Vec<T>> for [T] {
// Iterators
////////////////////////////////////////////////////////////////////////////////

#[deriving(Copy, Clone)]
#[derive(Copy, Clone)]
enum Direction { Pos, Neg }

/// An `Index` and `Direction` together.
#[deriving(Copy, Clone)]
#[derive(Copy, Clone)]
struct SizeDirection {
size: uint,
dir: Direction,
Expand Down Expand Up @@ -2678,7 +2678,7 @@ mod tests {
assert!(values == [2, 3, 5, 6, 7]);
}

#[deriving(Clone, PartialEq)]
#[derive(Clone, PartialEq)]
struct Foo;

#[test]
Expand Down
10 changes: 5 additions & 5 deletions src/libcollections/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ fn canonical_sort(comb: &mut [(char, u8)]) {
}
}

#[deriving(Clone)]
#[derive(Clone)]
enum DecompositionType {
Canonical,
Compatible
}

/// External iterator for a string's decomposition's characters.
/// Use with the `std::iter` module.
#[deriving(Clone)]
#[derive(Clone)]
pub struct Decompositions<'a> {
kind: DecompositionType,
iter: Chars<'a>,
Expand Down Expand Up @@ -250,7 +250,7 @@ impl<'a> Iterator<char> for Decompositions<'a> {
}
}

#[deriving(Clone)]
#[derive(Clone)]
enum RecompositionState {
Composing,
Purging,
Expand All @@ -259,7 +259,7 @@ enum RecompositionState {

/// External iterator for a string's recomposition's characters.
/// Use with the `std::iter` module.
#[deriving(Clone)]
#[derive(Clone)]
pub struct Recompositions<'a> {
iter: Decompositions<'a>,
state: RecompositionState,
Expand Down Expand Up @@ -352,7 +352,7 @@ impl<'a> Iterator<char> for Recompositions<'a> {

/// External iterator for a string's UTF16 codeunits.
/// Use with the `std::iter` module.
#[deriving(Clone)]
#[derive(Clone)]
pub struct Utf16Units<'a> {
encoder: Utf16Encoder<Chars<'a>>
}
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use str::{mod, CharRange, FromStr, Utf8Error};
use vec::{DerefVec, Vec, as_vec};

/// A growable string stored as a UTF-8 encoded buffer.
#[deriving(Clone, PartialOrd, Eq, Ord)]
#[derive(Clone, PartialOrd, Eq, Ord)]
#[stable]
pub struct String {
vec: Vec<u8>,
Expand Down
8 changes: 4 additions & 4 deletions src/libcollections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ impl<T> Vec<T> {
/// let w = v.map_in_place(|i| i + 3);
/// assert_eq!(w.as_slice(), [3, 4, 5].as_slice());
///
/// #[deriving(PartialEq, Show)]
/// #[derive(PartialEq, Show)]
/// struct Newtype(u8);
/// let bytes = vec![0x11, 0x22];
/// let newtyped_bytes = bytes.map_in_place(|x| Newtype(x));
Expand Down Expand Up @@ -2241,7 +2241,7 @@ mod tests {
#[test]
fn test_map_in_place_zero_sized() {
let v = vec![(), ()];
#[deriving(PartialEq, Show)]
#[derive(PartialEq, Show)]
struct ZeroSized;
assert_eq!(v.map_in_place(|_| ZeroSized), [ZeroSized, ZeroSized]);
}
Expand All @@ -2251,11 +2251,11 @@ mod tests {
use std::sync::atomic;
use std::sync::atomic::AtomicUint;

#[deriving(Clone, PartialEq, Show)]
#[derive(Clone, PartialEq, Show)]
struct Nothing;
impl Drop for Nothing { fn drop(&mut self) { } }

#[deriving(Clone, PartialEq, Show)]
#[derive(Clone, PartialEq, Show)]
struct ZeroSized;
impl Drop for ZeroSized {
fn drop(&mut self) {
Expand Down
6 changes: 3 additions & 3 deletions src/libcollections/vec_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ pub struct Iter<'a, V:'a> {
iter: slice::Iter<'a, Option<V>>
}

// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
impl<'a, V> Clone for Iter<'a, V> {
fn clone(&self) -> Iter<'a, V> {
Iter {
Expand Down Expand Up @@ -676,7 +676,7 @@ pub struct Keys<'a, V: 'a> {
iter: Map<(uint, &'a V), uint, Iter<'a, V>, fn((uint, &'a V)) -> uint>
}

// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
impl<'a, V> Clone for Keys<'a, V> {
fn clone(&self) -> Keys<'a, V> {
Keys {
Expand All @@ -691,7 +691,7 @@ pub struct Values<'a, V: 'a> {
iter: Map<(uint, &'a V), &'a V, Iter<'a, V>, fn((uint, &'a V)) -> &'a V>
}

// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
impl<'a, V> Clone for Values<'a, V> {
fn clone(&self) -> Values<'a, V> {
Values {
Expand Down
Loading