auto merge of #20504 : japaric/rust/derive-self, r=alexcrichton

I put the sed scripts in the commits, in case this needs a "rebase".
This commit is contained in:
bors 2015-01-04 04:50:56 +00:00
commit 470118f3e9
327 changed files with 1416 additions and 1416 deletions

View File

@ -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,
@ -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,

View File

@ -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

View File

@ -26,7 +26,7 @@ use std::io::File;
use syntax::parse;
use syntax::parse::lexer;
use rustc::session::{mod, config};
use rustc::session::{self, config};
use syntax::ast;
use syntax::ast::Name;

View File

@ -71,7 +71,7 @@ use core::atomic;
use core::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
use core::borrow::BorrowFrom;
use core::clone::Clone;
use core::fmt::{mod, Show};
use core::fmt::{self, Show};
use core::cmp::{Eq, Ord, PartialEq, PartialOrd, Ordering};
use core::default::Default;
use core::kinds::{Sync, Send};
@ -81,7 +81,7 @@ use core::nonzero::NonZero;
use core::ops::{Drop, Deref};
use core::option::Option;
use core::option::Option::{Some, None};
use core::ptr::{mod, PtrExt};
use core::ptr::{self, PtrExt};
use heap::deallocate;
/// An atomically reference counted wrapper for shared state.
@ -800,6 +800,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> }
}

View File

@ -17,7 +17,7 @@ use core::clone::Clone;
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
use core::default::Default;
use core::fmt;
use core::hash::{mod, Hash};
use core::hash::{self, Hash};
use core::kinds::Sized;
use core::mem;
use core::option::Option;

View File

@ -147,14 +147,14 @@ use core::clone::Clone;
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
use core::default::Default;
use core::fmt;
use core::hash::{mod, Hash};
use core::hash::{self, Hash};
use core::kinds::marker;
use core::mem::{transmute, min_align_of, size_of, forget};
use core::nonzero::NonZero;
use core::ops::{Deref, Drop};
use core::option::Option;
use core::option::Option::{Some, None};
use core::ptr::{mod, PtrExt};
use core::ptr::{self, PtrExt};
use core::result::Result;
use core::result::Result::{Ok, Err};
@ -264,7 +264,7 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool {
/// # Example
///
/// ```
/// use std::rc::{mod, Rc};
/// use std::rc::{self, Rc};
///
/// let x = Rc::new(3u);
/// assert_eq!(rc::try_unwrap(x), Ok(3u));
@ -298,7 +298,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
/// # Example
///
/// ```
/// use std::rc::{mod, Rc};
/// use std::rc::{self, Rc};
///
/// let mut x = Rc::new(3u);
/// *rc::get_mut(&mut x).unwrap() = 4u;

View File

@ -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>,

View File

@ -30,7 +30,7 @@
//! use std::collections::BinaryHeap;
//! use std::uint;
//!
//! #[deriving(Copy, Eq, PartialEq)]
//! #[derive(Copy, Eq, PartialEq)]
//! struct State {
//! cost: uint,
//! position: uint,
@ -157,12 +157,12 @@ use core::mem::{zeroed, replace, swap};
use core::ptr;
use slice;
use vec::{mod, Vec};
use vec::{self, 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>,
@ -565,7 +565,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() }

View File

@ -89,7 +89,7 @@ use core::fmt;
use core::hash;
use core::iter::RandomAccessIterator;
use core::iter::{Chain, Enumerate, Repeat, Skip, Take, repeat, Cloned};
use core::iter::{mod, FromIterator};
use core::iter::{self, FromIterator};
use core::num::Int;
use core::ops::Index;
use core::slice;
@ -1040,7 +1040,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,
@ -1139,7 +1139,7 @@ impl<'a> RandomAccessIterator for Iter<'a> {
/// let bv: Bitv = s.into_bitv();
/// assert!(bv[3]);
/// ```
#[deriving(Clone)]
#[derive(Clone)]
#[stable]
pub struct BitvSet {
bitv: Bitv,
@ -1784,7 +1784,7 @@ 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,
@ -1792,7 +1792,7 @@ pub struct SetIter<'a> {
}
/// An iterator combining two `BitvSet` iterators.
#[deriving(Clone)]
#[derive(Clone)]
struct TwoBitPositions<'a> {
set: &'a BitvSet,
other: &'a BitvSet,

View File

@ -33,9 +33,9 @@ use ring_buf::RingBuf;
use self::Continuation::{Continue, Finished};
use self::StackOp::*;
use super::node::ForceResult::{Leaf, Internal};
use super::node::TraversalItem::{mod, Elem, Edge};
use super::node::TraversalItem::{self, Elem, Edge};
use super::node::{Traversal, MutTraversal, MoveTraversal};
use super::node::{mod, Node, Found, GoDown};
use super::node::{self, Node, Found, GoDown};
// FIXME(conventions): implement bounded iterators
@ -81,7 +81,7 @@ use super::node::{mod, Node, Found, GoDown};
/// 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>,
@ -505,7 +505,7 @@ mod stack {
use core::mem;
use core::ops::{Deref, DerefMut};
use super::BTreeMap;
use super::super::node::{mod, Node, Fit, Split, Internal, Leaf};
use super::super::node::{self, Node, Fit, Split, Internal, Leaf};
use super::super::node::handle;
use vec::Vec;

View File

@ -496,7 +496,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

View File

@ -14,7 +14,7 @@
use core::prelude::*;
use core::borrow::BorrowFrom;
use core::cmp::Ordering::{mod, Less, Greater, Equal};
use core::cmp::Ordering::{self, Less, Greater, Equal};
use core::default::Default;
use core::fmt::Show;
use core::fmt;
@ -30,7 +30,7 @@ use btree_map::{BTreeMap, Keys};
///
/// 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, ()>,

View File

@ -26,7 +26,7 @@ use core::cmp::Ordering;
use core::default::Default;
use core::fmt;
use core::hash::{Writer, Hash};
use core::iter::{mod, FromIterator};
use core::iter::{self, FromIterator};
use core::mem;
use core::ptr;
@ -84,7 +84,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>

View File

@ -21,7 +21,7 @@ use core::ops::{Sub, BitOr, BitAnd, BitXor};
// 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
@ -223,7 +223,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 {
@ -287,7 +287,7 @@ mod test {
use super::{EnumSet, CLike};
#[deriving(Copy, PartialEq, Show)]
#[derive(Copy, PartialEq, Show)]
#[repr(uint)]
enum Foo {
A, B, C
@ -491,7 +491,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,

View File

@ -17,7 +17,7 @@ use core::prelude::*;
use core::cmp::Ordering;
use core::default::Default;
use core::fmt;
use core::iter::{mod, FromIterator, RandomAccessIterator};
use core::iter::{self, FromIterator, RandomAccessIterator};
use core::kinds::marker;
use core::mem;
use core::num::{Int, UnsignedInt};
@ -1139,7 +1139,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 {
@ -1674,21 +1674,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,

View File

@ -90,15 +90,15 @@
use alloc::boxed::Box;
use core::borrow::{BorrowFrom, BorrowFromMut, ToOwned};
use core::clone::Clone;
use core::cmp::Ordering::{mod, Greater, Less};
use core::cmp::{mod, Ord, PartialEq};
use core::cmp::Ordering::{self, Greater, Less};
use core::cmp::{self, Ord, PartialEq};
use core::iter::{Iterator, IteratorExt, IteratorCloneExt};
use core::iter::{range, range_step, MultiplicativeIterator};
use core::kinds::Sized;
use core::mem::size_of;
use core::mem;
use core::ops::{FnMut, SliceMut};
use core::option::Option::{mod, Some, None};
use core::option::Option::{self, Some, None};
use core::ptr::PtrExt;
use core::ptr;
use core::result::Result;
@ -1083,7 +1083,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
@ -1130,11 +1130,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,
@ -2709,7 +2709,7 @@ mod tests {
assert!(values == [2, 3, 5, 6, 7]);
}
#[deriving(Clone, PartialEq)]
#[derive(Clone, PartialEq)]
struct Foo;
#[test]

View File

@ -64,10 +64,10 @@ use core::default::Default;
use core::fmt;
use core::hash;
use core::iter::AdditiveIterator;
use core::iter::{mod, range, Iterator, IteratorExt};
use core::iter::{self, range, Iterator, IteratorExt};
use core::kinds::Sized;
use core::ops;
use core::option::Option::{mod, Some, None};
use core::option::Option::{self, Some, None};
use core::slice::AsSlice;
use core::str as core_str;
use unicode::str::{UnicodeStr, Utf16Encoder};
@ -165,7 +165,7 @@ fn canonical_sort(comb: &mut [(char, u8)]) {
}
}
#[deriving(Clone)]
#[derive(Clone)]
enum DecompositionType {
Canonical,
Compatible
@ -173,7 +173,7 @@ enum DecompositionType {
/// 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>,
@ -252,7 +252,7 @@ impl<'a> Iterator for Decompositions<'a> {
}
}
#[deriving(Clone)]
#[derive(Clone)]
enum RecompositionState {
Composing,
Purging,
@ -261,7 +261,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,
@ -356,7 +356,7 @@ impl<'a> Iterator 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>>
}

View File

@ -23,17 +23,17 @@ use core::fmt;
use core::hash;
use core::iter::FromIterator;
use core::mem;
use core::ops::{mod, Deref, Add};
use core::ops::{self, Deref, Add};
use core::ptr;
use core::raw::Slice as RawSlice;
use unicode::str as unicode_str;
use unicode::str::Utf16Item;
use str::{mod, CharRange, FromStr, Utf8Error};
use str::{self, 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>,

View File

@ -53,7 +53,7 @@ use core::cmp::max;
use core::cmp::{Equiv, Ordering};
use core::default::Default;
use core::fmt;
use core::hash::{mod, Hash};
use core::hash::{self, Hash};
use core::iter::{repeat, FromIterator};
use core::kinds::marker::{ContravariantLifetime, InvariantType};
use core::mem;
@ -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));
@ -2276,7 +2276,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]);
}
@ -2286,11 +2286,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) {

View File

@ -673,7 +673,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 {
@ -705,7 +705,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 {
@ -720,7 +720,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 {

View File

@ -62,7 +62,7 @@ unsafe impl<T> Sync for AtomicPtr<T> {}
/// Rust's memory orderings are [the same as
/// C++'s](http://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync).
#[stable]
#[deriving(Copy)]
#[derive(Copy)]
pub enum Ordering {
/// No ordering constraints, only atomic operations.
#[stable]

View File

@ -430,13 +430,13 @@ impl Char for char {
/// An iterator over the characters that represent a `char`, as escaped by
/// Rust's unicode escaping rules.
#[deriving(Clone)]
#[derive(Clone)]
pub struct EscapeUnicode {
c: char,
state: EscapeUnicodeState
}
#[deriving(Clone)]
#[derive(Clone)]
enum EscapeUnicodeState {
Backslash,
Type,
@ -490,12 +490,12 @@ impl Iterator for EscapeUnicode {
/// An iterator over the characters that represent a `char`, escaped
/// for maximum portability.
#[deriving(Clone)]
#[derive(Clone)]
pub struct EscapeDefault {
state: EscapeDefaultState
}
#[deriving(Clone)]
#[derive(Clone)]
enum EscapeDefaultState {
Backslash(char),
Char(char),

View File

@ -44,7 +44,7 @@
use self::Ordering::*;
use kinds::Sized;
use option::Option::{mod, Some, None};
use option::Option::{self, Some, None};
/// Trait for equality comparisons which are [partial equivalence relations](
/// http://en.wikipedia.org/wiki/Partial_equivalence_relation).
@ -104,7 +104,7 @@ pub trait Eq for Sized?: PartialEq<Self> {
}
/// An ordering is, e.g, a result of a comparison between two values.
#[deriving(Clone, Copy, PartialEq, Show)]
#[derive(Clone, Copy, PartialEq, Show)]
#[stable]
pub enum Ordering {
/// An ordering where a compared value is less [than another].

View File

@ -26,7 +26,7 @@
//! ```
//! use std::default::Default;
//!
//! #[deriving(Default)]
//! #[derive(Default)]
//! struct SomeOptions {
//! foo: int,
//! bar: f32,
@ -54,7 +54,7 @@
//! fn default() -> Kind { Kind::A }
//! }
//!
//! #[deriving(Default)]
//! #[derive(Default)]
//! struct SomeOptions {
//! foo: int,
//! bar: f32,
@ -71,7 +71,7 @@
//!
//! ```
//! # use std::default::Default;
//! # #[deriving(Default)]
//! # #[derive(Default)]
//! # struct SomeOptions {
//! # foo: int,
//! # bar: f32,
@ -86,12 +86,12 @@
/// A trait that types which have a useful default value should implement.
///
/// A struct can derive default implementations of `Default` for basic types using
/// `#[deriving(Default)]`.
/// `#[derive(Default)]`.
///
/// # Examples
///
/// ```
/// #[deriving(Default)]
/// #[derive(Default)]
/// struct SomeOptions {
/// foo: int,
/// bar: f32,

View File

@ -22,8 +22,8 @@ use num::{cast, Float, ToPrimitive};
use num::FpCategory as Fp;
use ops::FnOnce;
use result::Result::Ok;
use slice::{mod, SliceExt};
use str::{mod, StrExt};
use slice::{self, SliceExt};
use str::{self, StrExt};
/// A flag that specifies whether to use exponential (scientific) notation.
pub enum ExponentFormat {

View File

@ -24,7 +24,7 @@ use result::Result::{Ok, Err};
use result;
use slice::SliceExt;
use slice;
use str::{mod, StrExt, Utf8Error};
use str::{self, StrExt, Utf8Error};
pub use self::num::radix;
pub use self::num::Radix;
@ -44,7 +44,7 @@ pub type Result = result::Result<(), Error>;
/// occurred. Any extra information must be arranged to be transmitted through
/// some other means.
#[experimental = "core and I/O reconciliation may alter this definition"]
#[deriving(Copy)]
#[derive(Copy)]
pub struct Error;
/// A collection of methods that are required to format a message into a stream.
@ -122,7 +122,7 @@ enum Void {}
/// compile time it is ensured that the function and the value have the correct
/// types, and then this struct is used to canonicalize arguments to one type.
#[experimental = "implementation detail of the `format_args!` macro"]
#[deriving(Copy)]
#[derive(Copy)]
pub struct Argument<'a> {
value: &'a Void,
formatter: fn(&Void, &mut Formatter) -> Result,
@ -199,7 +199,7 @@ impl<'a> Arguments<'a> {
/// macro validates the format string at compile-time so usage of the `write`
/// and `format` functions can be safely performed.
#[stable]
#[deriving(Copy)]
#[derive(Copy)]
pub struct Arguments<'a> {
// Format string pieces to print.
pieces: &'a [&'a str],

View File

@ -67,23 +67,23 @@ trait GenericRadix {
}
/// A binary (base 2) radix
#[deriving(Clone, PartialEq)]
#[derive(Clone, PartialEq)]
struct Binary;
/// An octal (base 8) radix
#[deriving(Clone, PartialEq)]
#[derive(Clone, PartialEq)]
struct Octal;
/// A decimal (base 10) radix
#[deriving(Clone, PartialEq)]
#[derive(Clone, PartialEq)]
struct Decimal;
/// A hexadecimal (base 16) radix, formatted with lower-case characters
#[deriving(Clone, PartialEq)]
#[derive(Clone, PartialEq)]
struct LowerHex;
/// A hexadecimal (base 16) radix, formatted with upper-case characters
#[deriving(Clone, PartialEq)]
#[derive(Clone, PartialEq)]
pub struct UpperHex;
macro_rules! radix {
@ -110,7 +110,7 @@ radix! { UpperHex, 16, "0x", x @ 0 ... 9 => b'0' + x,
x @ 10 ... 15 => b'A' + (x - 10) }
/// A radix with in the range of `2..36`.
#[deriving(Clone, Copy, PartialEq)]
#[derive(Clone, Copy, PartialEq)]
#[unstable = "may be renamed or move to a different module"]
pub struct Radix {
base: u8,
@ -136,7 +136,7 @@ impl GenericRadix for Radix {
/// A helper type for formatting radixes.
#[unstable = "may be renamed or move to a different module"]
#[deriving(Copy)]
#[derive(Copy)]
pub struct RadixFmt<T, R>(T, R);
/// Constructs a radix formatter in the range of `2..36`.

View File

@ -22,14 +22,14 @@ pub use self::Position::*;
pub use self::Flag::*;
#[doc(hidden)]
#[deriving(Copy)]
#[derive(Copy)]
pub struct Argument<'a> {
pub position: Position,
pub format: FormatSpec,
}
#[doc(hidden)]
#[deriving(Copy)]
#[derive(Copy)]
pub struct FormatSpec {
pub fill: char,
pub align: Alignment,
@ -39,7 +39,7 @@ pub struct FormatSpec {
}
/// Possible alignments that can be requested as part of a formatting directive.
#[deriving(Copy, PartialEq)]
#[derive(Copy, PartialEq)]
pub enum Alignment {
/// Indication that contents should be left-aligned.
AlignLeft,
@ -52,13 +52,13 @@ pub enum Alignment {
}
#[doc(hidden)]
#[deriving(Copy)]
#[derive(Copy)]
pub enum Count {
CountIs(uint), CountIsParam(uint), CountIsNextParam, CountImplied,
}
#[doc(hidden)]
#[deriving(Copy)]
#[derive(Copy)]
pub enum Position {
ArgumentNext, ArgumentIs(uint)
}
@ -68,7 +68,7 @@ pub enum Position {
/// These flags are discovered through the `flags` field of the `Formatter`
/// structure. The flag in that structure is a union of these flags into a
/// `uint` where each flag's discriminant is the corresponding bit.
#[deriving(Copy)]
#[derive(Copy)]
pub enum Flag {
/// A flag which enables number formatting to always print the sign of a
/// number.

View File

@ -11,7 +11,7 @@
//! Generic hashing support.
//!
//! This module provides a generic way to compute the hash of a value. The
//! simplest way to make a type hashable is to use `#[deriving(Hash)]`:
//! simplest way to make a type hashable is to use `#[derive(Hash)]`:
//!
//! # Examples
//!
@ -19,7 +19,7 @@
//! use std::hash;
//! use std::hash::Hash;
//!
//! #[deriving(Hash)]
//! #[derive(Hash)]
//! struct Person {
//! id: uint,
//! name: String,

View File

@ -30,7 +30,7 @@ use default::Default;
use super::{Hash, Hasher, Writer};
/// `SipState` computes a SipHash 2-4 hash over a stream of bytes.
#[deriving(Copy)]
#[derive(Copy)]
pub struct SipState {
k0: u64,
k1: u64,
@ -213,7 +213,7 @@ impl Default for SipState {
}
/// `SipHasher` computes the SipHash algorithm from a stream of bytes.
#[deriving(Clone)]
#[derive(Clone)]
#[allow(missing_copy_implementations)]
pub struct SipHasher {
k0: u64,

View File

@ -45,7 +45,7 @@
pub type GlueFn = extern "Rust" fn(*const i8);
#[lang="ty_desc"]
#[deriving(Copy)]
#[derive(Copy)]
pub struct TyDesc {
// sizeof(T)
pub size: uint,
@ -545,7 +545,7 @@ extern "rust-intrinsic" {
/// `TypeId` represents a globally unique identifier for a type
#[lang="type_id"] // This needs to be kept in lockstep with the code in trans/intrinsic.rs and
// middle/lang_items.rs
#[deriving(Clone, Copy, PartialEq, Eq, Show)]
#[derive(Clone, Copy, PartialEq, Eq, Show)]
pub struct TypeId {
t: u64,
}

View File

@ -885,7 +885,7 @@ impl<A, B, I, F> ExactSizeIterator for Map<A, B, I, F> where
impl<A, B> ExactSizeIterator for Zip<A, B> where A: ExactSizeIterator, B: ExactSizeIterator {}
/// An double-ended iterator with the direction inverted
#[deriving(Clone)]
#[derive(Clone)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable]
pub struct Rev<T> {
@ -1153,7 +1153,7 @@ impl<T, I> IteratorOrdExt<T> for I where I: Iterator<Item=T>, T: Ord {
}
/// `MinMaxResult` is an enum returned by `min_max`. See `IteratorOrdExt::min_max` for more detail.
#[deriving(Clone, PartialEq, Show)]
#[derive(Clone, PartialEq, Show)]
#[unstable = "waiting on namespaced enum conventions"]
pub enum MinMaxResult<T> {
/// Empty iterator
@ -1176,7 +1176,7 @@ impl<T: Clone> MinMaxResult<T> {
/// # Example
///
/// ```rust
/// use std::iter::MinMaxResult::{mod, NoElements, OneElement, MinMax};
/// use std::iter::MinMaxResult::{self, NoElements, OneElement, MinMax};
///
/// let r: MinMaxResult<int> = NoElements;
/// assert_eq!(r.into_option(), None);
@ -1280,7 +1280,7 @@ impl<I> CloneIteratorExt for I where I: Iterator + Clone {
}
/// An iterator that repeats endlessly
#[deriving(Clone, Copy)]
#[derive(Clone, Copy)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable]
pub struct Cycle<I> {
@ -1338,7 +1338,7 @@ impl<I> RandomAccessIterator for Cycle<I> where
}
/// An iterator that strings two iterators together
#[deriving(Clone)]
#[derive(Clone)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable]
pub struct Chain<A, B> {
@ -1418,7 +1418,7 @@ impl<T, A, B> RandomAccessIterator for Chain<A, B> where
}
/// An iterator that iterates two other iterators simultaneously
#[deriving(Clone)]
#[derive(Clone)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable]
pub struct Zip<A, B> {
@ -1517,7 +1517,7 @@ pub struct Map<A, B, I: Iterator<Item=A>, F: FnMut(A) -> B> {
f: F,
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable]
impl<A, B, I, F> Clone for Map<A, B, I, F> where
I: Clone + Iterator<Item=A>,
@ -1594,7 +1594,7 @@ pub struct Filter<A, I, P> where I: Iterator<Item=A>, P: FnMut(&A) -> bool {
predicate: P,
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable]
impl<A, I, P> Clone for Filter<A, I, P> where
I: Clone + Iterator<Item=A>,
@ -1655,7 +1655,7 @@ pub struct FilterMap<A, B, I, F> where I: Iterator<Item=A>, F: FnMut(A) -> Optio
f: F,
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable]
impl<A, B, I, F> Clone for FilterMap<A, B, I, F> where
I: Clone + Iterator<Item=A>,
@ -1712,7 +1712,7 @@ impl<A, B, I, F> DoubleEndedIterator for FilterMap<A, B, I, F> where
}
/// An iterator that yields the current count and the element during iteration
#[deriving(Clone)]
#[derive(Clone)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable]
pub struct Enumerate<I> {
@ -1775,7 +1775,7 @@ impl<I> RandomAccessIterator for Enumerate<I> where I: RandomAccessIterator {
/// An iterator with a `peek()` that returns an optional reference to the next element.
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable]
#[deriving(Copy)]
#[derive(Copy)]
pub struct Peekable<T, I> where I: Iterator<Item=T> {
iter: I,
peeked: Option<T>,
@ -1837,7 +1837,7 @@ pub struct SkipWhile<A, I, P> where I: Iterator<Item=A>, P: FnMut(&A) -> bool {
predicate: P,
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable]
impl<A, I, P> Clone for SkipWhile<A, I, P> where
I: Clone + Iterator<Item=A>,
@ -1883,7 +1883,7 @@ pub struct TakeWhile<A, I, P> where I: Iterator<Item=A>, P: FnMut(&A) -> bool {
predicate: P,
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable]
impl<A, I, P> Clone for TakeWhile<A, I, P> where
I: Clone + Iterator<Item=A>,
@ -1929,7 +1929,7 @@ impl<A, I, P> Iterator for TakeWhile<A, I, P> where I: Iterator<Item=A>, P: FnMu
}
/// An iterator that skips over `n` elements of `iter`.
#[deriving(Clone)]
#[derive(Clone)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable]
pub struct Skip<I> {
@ -1999,7 +1999,7 @@ impl<I> RandomAccessIterator for Skip<I> where I: RandomAccessIterator{
}
/// An iterator that only iterates over the first `n` iterations of `iter`.
#[deriving(Clone)]
#[derive(Clone)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable]
pub struct Take<I> {
@ -2065,7 +2065,7 @@ pub struct Scan<A, B, I, St, F> where I: Iterator, F: FnMut(&mut St, A) -> Optio
pub state: St,
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable]
impl<A, B, I, St, F> Clone for Scan<A, B, I, St, F> where
I: Clone + Iterator<Item=A>,
@ -2116,7 +2116,7 @@ pub struct FlatMap<A, B, I, U, F> where
backiter: Option<U>,
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable]
impl<A, B, I, U, F> Clone for FlatMap<A, B, I, U, F> where
I: Clone + Iterator<Item=A>,
@ -2193,7 +2193,7 @@ impl<A, B, I, U, F> DoubleEndedIterator for FlatMap<A, B, I, U, F> where
/// An iterator that yields `None` forever after the underlying iterator
/// yields `None` once.
#[deriving(Clone)]
#[derive(Clone)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable]
pub struct Fuse<I> {
@ -2281,7 +2281,7 @@ pub struct Inspect<A, I, F> where I: Iterator<Item=A>, F: FnMut(&A) {
f: F,
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable]
impl<A, I, F> Clone for Inspect<A, I, F> where
I: Clone + Iterator<Item=A>,
@ -2391,7 +2391,7 @@ pub struct Unfold<A, St, F> where F: FnMut(&mut St) -> Option<A> {
pub state: St,
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable]
impl<A, St, F> Clone for Unfold<A, St, F> where
F: Clone + FnMut(&mut St) -> Option<A>,
@ -2436,7 +2436,7 @@ impl<A, St, F> Iterator for Unfold<A, St, F> where F: FnMut(&mut St) -> Option<A
/// An infinite iterator starting at `start` and advancing by `step` with each
/// iteration
#[deriving(Clone, Copy)]
#[derive(Clone, Copy)]
#[unstable = "may be renamed"]
pub struct Counter<A> {
/// The current state the counter is at (next value to be yielded)
@ -2470,7 +2470,7 @@ impl<A: Add<Output=A> + Clone> Iterator for Counter<A> {
}
/// An iterator over the range [start, stop)
#[deriving(Clone, Copy)]
#[derive(Clone, Copy)]
#[unstable = "may be refactored due to numerics reform or ops reform"]
pub struct Range<A> {
state: A,
@ -2565,7 +2565,7 @@ impl<A: Int + ToPrimitive> DoubleEndedIterator for Range<A> {
}
/// An iterator over the range [start, stop]
#[deriving(Clone)]
#[derive(Clone)]
#[unstable = "may be refactored due to numerics reform or ops reform"]
pub struct RangeInclusive<A> {
range: Range<A>,
@ -2635,7 +2635,7 @@ impl<A: Int + ToPrimitive> DoubleEndedIterator for RangeInclusive<A> {
}
/// An iterator over the range [start, stop) by `step`. It handles overflow by stopping.
#[deriving(Clone)]
#[derive(Clone)]
#[unstable = "may be refactored due to numerics reform or ops reform"]
pub struct RangeStep<A> {
state: A,
@ -2672,7 +2672,7 @@ impl<A: Int> Iterator for RangeStep<A> {
}
/// An iterator over the range [start, stop] by `step`. It handles overflow by stopping.
#[deriving(Clone)]
#[derive(Clone)]
#[unstable = "may be refactored due to numerics reform or ops reform"]
pub struct RangeStepInclusive<A> {
state: A,
@ -2775,7 +2775,7 @@ step_impl_no_between!(u64 i64);
/// An iterator that repeats an element endlessly
#[deriving(Clone)]
#[derive(Clone)]
#[stable]
pub struct Repeat<A> {
element: A

View File

@ -132,7 +132,7 @@ pub mod marker {
/// (for example, `S<&'static int>` is a subtype of `S<&'a int>`
/// for some lifetime `'a`, but not the other way around).
#[lang="covariant_type"]
#[deriving(PartialEq, Eq, PartialOrd, Ord)]
#[derive(PartialEq, Eq, PartialOrd, Ord)]
pub struct CovariantType<Sized? T>;
impl<Sized? T> Copy for CovariantType<T> {}
@ -180,7 +180,7 @@ pub mod marker {
/// function requires arguments of type `T`, it must also accept
/// arguments of type `U`, hence such a conversion is safe.
#[lang="contravariant_type"]
#[deriving(PartialEq, Eq, PartialOrd, Ord)]
#[derive(PartialEq, Eq, PartialOrd, Ord)]
pub struct ContravariantType<Sized? T>;
impl<Sized? T> Copy for ContravariantType<T> {}
@ -210,7 +210,7 @@ pub mod marker {
/// never written, but in fact `Cell` uses unsafe code to achieve
/// interior mutability.
#[lang="invariant_type"]
#[deriving(PartialEq, Eq, PartialOrd, Ord)]
#[derive(PartialEq, Eq, PartialOrd, Ord)]
pub struct InvariantType<Sized? T>;
impl<Sized? T> Copy for InvariantType<T> {}
@ -235,7 +235,7 @@ pub mod marker {
/// For more information about variance, refer to this Wikipedia
/// article <http://en.wikipedia.org/wiki/Variance_%28computer_science%29>.
#[lang="covariant_lifetime"]
#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct CovariantLifetime<'a>;
/// As `ContravariantType`, but for lifetime parameters. Using
@ -251,7 +251,7 @@ pub mod marker {
/// For more information about variance, refer to this Wikipedia
/// article <http://en.wikipedia.org/wiki/Variance_%28computer_science%29>.
#[lang="contravariant_lifetime"]
#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct ContravariantLifetime<'a>;
/// As `InvariantType`, but for lifetime parameters. Using
@ -262,7 +262,7 @@ pub mod marker {
/// and this pointer is itself stored in an inherently mutable
/// location (such as a `Cell`).
#[lang="invariant_lifetime"]
#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct InvariantLifetime<'a>;
/// A type which is considered "not sendable", meaning that it cannot
@ -270,14 +270,14 @@ pub mod marker {
/// typically embedded in other types, such as `Gc`, to ensure that
/// their instances remain thread-local.
#[lang="no_send_bound"]
#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct NoSend;
/// A type which is considered "not POD", meaning that it is not
/// implicitly copyable. This is typically embedded in other types to
/// ensure that they are never copied, even if they lack a destructor.
#[lang="no_copy_bound"]
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
#[allow(missing_copy_implementations)]
pub struct NoCopy;
@ -285,13 +285,13 @@ pub mod marker {
/// its contents are not threadsafe, hence they cannot be
/// shared between tasks.
#[lang="no_sync_bound"]
#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct NoSync;
/// A type which is considered managed by the GC. This is typically
/// embedded in other types.
#[lang="managed_bound"]
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
#[allow(missing_copy_implementations)]
pub struct Managed;
}

View File

@ -31,7 +31,7 @@ unsafe impl Zeroable for u64 {}
/// A wrapper type for raw pointers and integers that will never be
/// NULL or 0 that might allow certain optimizations.
#[lang="non_zero"]
#[deriving(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Show)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Show)]
#[experimental]
pub struct NonZero<T: Zeroable>(T);

View File

@ -1218,7 +1218,7 @@ impl_num_cast! { f32, to_f32 }
impl_num_cast! { f64, to_f64 }
/// Used for representing the classification of floating point numbers
#[deriving(Copy, PartialEq, Show)]
#[derive(Copy, PartialEq, Show)]
#[unstable = "may be renamed"]
pub enum FpCategory {
/// "Not a Number", often obtained by dividing by zero

View File

@ -29,7 +29,7 @@
//!
//! use std::ops::{Add, Sub};
//!
//! #[deriving(Show)]
//! #[derive(Show)]
//! struct Point {
//! x: int,
//! y: int
@ -62,7 +62,7 @@
use clone::Clone;
use iter::{Step, Iterator,DoubleEndedIterator,ExactSizeIterator};
use kinds::Sized;
use option::Option::{mod, Some, None};
use option::Option::{self, Some, None};
/// The `Drop` trait is used to run some code when a value goes out of scope. This
/// is sometimes called a 'destructor'.
@ -103,7 +103,7 @@ pub trait Drop {
///
/// use std::ops::Add;
///
/// #[deriving(Copy)]
/// #[derive(Copy)]
/// struct Foo;
///
/// impl Add for Foo {
@ -152,7 +152,7 @@ add_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 }
///
/// use std::ops::Sub;
///
/// #[deriving(Copy)]
/// #[derive(Copy)]
/// struct Foo;
///
/// impl Sub for Foo {
@ -201,7 +201,7 @@ sub_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 }
///
/// use std::ops::Mul;
///
/// #[deriving(Copy)]
/// #[derive(Copy)]
/// struct Foo;
///
/// impl Mul for Foo {
@ -250,7 +250,7 @@ mul_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 }
///
/// use std::ops::Div;
///
/// #[deriving(Copy)]
/// #[derive(Copy)]
/// struct Foo;
///
/// impl Div for Foo {
@ -299,7 +299,7 @@ div_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 }
///
/// use std::ops::Rem;
///
/// #[deriving(Copy)]
/// #[derive(Copy)]
/// struct Foo;
///
/// impl Rem for Foo {
@ -482,7 +482,7 @@ not_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 }
///
/// use std::ops::BitAnd;
///
/// #[deriving(Copy)]
/// #[derive(Copy)]
/// struct Foo;
///
/// impl BitAnd for Foo {
@ -531,7 +531,7 @@ bitand_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 }
///
/// use std::ops::BitOr;
///
/// #[deriving(Copy)]
/// #[derive(Copy)]
/// struct Foo;
///
/// impl BitOr for Foo {
@ -580,7 +580,7 @@ bitor_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 }
///
/// use std::ops::BitXor;
///
/// #[deriving(Copy)]
/// #[derive(Copy)]
/// struct Foo;
///
/// impl BitXor for Foo {
@ -629,7 +629,7 @@ bitxor_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 }
///
/// use std::ops::Shl;
///
/// #[deriving(Copy)]
/// #[derive(Copy)]
/// struct Foo;
///
/// impl Shl<Foo> for Foo {
@ -680,7 +680,7 @@ shl_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 }
///
/// use std::ops::Shr;
///
/// #[deriving(Copy)]
/// #[derive(Copy)]
/// struct Foo;
///
/// impl Shr<Foo> for Foo {
@ -739,7 +739,7 @@ pub trait Index<Sized? Index, Sized? Result> for Sized? {
///
/// use std::ops::Index;
///
/// #[deriving(Copy)]
/// #[derive(Copy)]
/// struct Foo;
///
/// impl Index<Foo> for Foo {
@ -786,7 +786,7 @@ pub trait IndexMut<Sized? Index, Sized? Result> for Sized? {
///
/// use std::ops::IndexMut;
///
/// #[deriving(Copy)]
/// #[derive(Copy)]
/// struct Foo;
///
/// impl IndexMut<Foo> for Foo {
@ -822,7 +822,7 @@ pub trait IndexMut<Sized? Index> for Sized? {
/// ```ignore
/// use std::ops::Slice;
///
/// #[deriving(Copy)]
/// #[derive(Copy)]
/// struct Foo;
///
/// impl Slice<Foo, Foo> for Foo {
@ -871,7 +871,7 @@ pub trait Slice<Sized? Idx, Sized? Result> for Sized? {
/// ```ignore
/// use std::ops::SliceMut;
///
/// #[deriving(Copy)]
/// #[derive(Copy)]
/// struct Foo;
///
/// impl SliceMut<Foo, Foo> for Foo {
@ -911,12 +911,12 @@ pub trait SliceMut<Sized? Idx, Sized? Result> for Sized? {
/// An unbounded range.
#[deriving(Copy)]
#[derive(Copy)]
#[lang="full_range"]
pub struct FullRange;
/// A (half-open) range which is bounded at both ends.
#[deriving(Copy)]
#[derive(Copy)]
#[lang="range"]
pub struct Range<Idx> {
/// The lower bound of the range (inclusive).
@ -966,7 +966,7 @@ impl<Idx: Clone + Step> DoubleEndedIterator for Range<Idx> {
impl<Idx: Clone + Step> ExactSizeIterator for Range<Idx> {}
/// A range which is only bounded below.
#[deriving(Copy)]
#[derive(Copy)]
#[lang="range_from"]
pub struct RangeFrom<Idx> {
/// The lower bound of the range (inclusive).
@ -986,7 +986,7 @@ impl<Idx: Clone + Step> Iterator for RangeFrom<Idx> {
}
/// A range which is only bounded above.
#[deriving(Copy)]
#[derive(Copy)]
#[lang="range_to"]
pub struct RangeTo<Idx> {
/// The upper bound of the range (exclusive).

View File

@ -163,7 +163,7 @@ use ops::{Deref, FnOnce};
// which basically means it must be `Option`.
/// The `Option` type.
#[deriving(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Show, Hash)]
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Show, Hash)]
#[stable]
pub enum Option<T> {
/// No value
@ -772,7 +772,7 @@ impl<T> Default for Option<T> {
// The Option Iterators
/////////////////////////////////////////////////////////////////////////////
#[deriving(Clone)]
#[derive(Clone)]
struct Item<A> {
opt: Option<A>
}

View File

@ -45,8 +45,8 @@ pub use iter::{Extend, IteratorExt};
pub use iter::{Iterator, DoubleEndedIterator};
pub use iter::{IteratorCloneExt, CloneIteratorExt};
pub use iter::{IteratorOrdExt, ExactSizeIterator};
pub use option::Option::{mod, Some, None};
pub use option::Option::{self, Some, None};
pub use ptr::{PtrExt, MutPtrExt};
pub use result::Result::{mod, Ok, Err};
pub use result::Result::{self, Ok, Err};
pub use slice::{AsSlice, SliceExt};
pub use str::{Str, StrExt};

View File

@ -91,11 +91,11 @@
use mem;
use clone::Clone;
use intrinsics;
use option::Option::{mod, Some, None};
use option::Option::{self, Some, None};
use kinds::{Send, Sized, Sync};
use cmp::{PartialEq, Eq, Ord, PartialOrd, Equiv};
use cmp::Ordering::{mod, Less, Equal, Greater};
use cmp::Ordering::{self, Less, Equal, Greater};
// FIXME #19649: instrinsic docs don't render, so these have no docs :(

View File

@ -33,7 +33,7 @@ impl<T> Copy for Slice<T> {}
/// The representation of a Rust closure
#[repr(C)]
#[deriving(Copy)]
#[derive(Copy)]
pub struct Closure {
pub code: *mut (),
pub env: *mut (),
@ -44,7 +44,7 @@ pub struct Closure {
/// This struct does not have a `Repr` implementation
/// because there is no way to refer to all trait objects generically.
#[repr(C)]
#[deriving(Copy)]
#[derive(Copy)]
pub struct TraitObject {
pub data: *mut (),
pub vtable: *mut (),

View File

@ -30,7 +30,7 @@
//! defined and used like so:
//!
//! ```
//! #[deriving(Show)]
//! #[derive(Show)]
//! enum Version { Version1, Version2 }
//!
//! fn parse_version(header: &[u8]) -> Result<Version, &'static str> {
@ -236,14 +236,14 @@ use clone::Clone;
use fmt::Show;
use iter::{Iterator, IteratorExt, DoubleEndedIterator, FromIterator, ExactSizeIterator};
use ops::{FnMut, FnOnce};
use option::Option::{mod, None, Some};
use option::Option::{self, None, Some};
use slice::AsSlice;
use slice;
/// `Result` is a type that represents either success (`Ok`) or failure (`Err`).
///
/// See the [`std::result`](index.html) module documentation for details.
#[deriving(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Show, Hash)]
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Show, Hash)]
#[must_use]
#[stable]
pub enum Result<T, E> {

View File

@ -39,7 +39,7 @@
#[experimental]
#[simd]
#[deriving(Copy, Show)]
#[derive(Copy, Show)]
#[repr(C)]
pub struct i8x16(pub i8, pub i8, pub i8, pub i8,
pub i8, pub i8, pub i8, pub i8,
@ -48,26 +48,26 @@ pub struct i8x16(pub i8, pub i8, pub i8, pub i8,
#[experimental]
#[simd]
#[deriving(Copy, Show)]
#[derive(Copy, Show)]
#[repr(C)]
pub struct i16x8(pub i16, pub i16, pub i16, pub i16,
pub i16, pub i16, pub i16, pub i16);
#[experimental]
#[simd]
#[deriving(Copy, Show)]
#[derive(Copy, Show)]
#[repr(C)]
pub struct i32x4(pub i32, pub i32, pub i32, pub i32);
#[experimental]
#[simd]
#[deriving(Copy, Show)]
#[derive(Copy, Show)]
#[repr(C)]
pub struct i64x2(pub i64, pub i64);
#[experimental]
#[simd]
#[deriving(Copy, Show)]
#[derive(Copy, Show)]
#[repr(C)]
pub struct u8x16(pub u8, pub u8, pub u8, pub u8,
pub u8, pub u8, pub u8, pub u8,
@ -76,31 +76,31 @@ pub struct u8x16(pub u8, pub u8, pub u8, pub u8,
#[experimental]
#[simd]
#[deriving(Copy, Show)]
#[derive(Copy, Show)]
#[repr(C)]
pub struct u16x8(pub u16, pub u16, pub u16, pub u16,
pub u16, pub u16, pub u16, pub u16);
#[experimental]
#[simd]
#[deriving(Copy, Show)]
#[derive(Copy, Show)]
#[repr(C)]
pub struct u32x4(pub u32, pub u32, pub u32, pub u32);
#[experimental]
#[simd]
#[deriving(Copy, Show)]
#[derive(Copy, Show)]
#[repr(C)]
pub struct u64x2(pub u64, pub u64);
#[experimental]
#[simd]
#[deriving(Copy, Show)]
#[derive(Copy, Show)]
#[repr(C)]
pub struct f32x4(pub f32, pub f32, pub f32, pub f32);
#[experimental]
#[simd]
#[deriving(Copy, Show)]
#[derive(Copy, Show)]
#[repr(C)]
pub struct f64x2(pub f64, pub f64);

View File

@ -43,7 +43,7 @@ use default::Default;
use iter::*;
use kinds::Copy;
use num::Int;
use ops::{FnMut, mod};
use ops::{FnMut, self};
use option::Option;
use option::Option::{None, Some};
use result::Result;
@ -907,7 +907,7 @@ pub struct Split<'a, T:'a, P> where P: FnMut(&T) -> bool {
finished: bool
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable]
impl<'a, T, P> Clone for Split<'a, T, P> where P: Clone + FnMut(&T) -> bool {
fn clone(&self) -> Split<'a, T, P> {
@ -1133,7 +1133,7 @@ forward_iterator! { SplitNMut: T, &'a mut [T] }
forward_iterator! { RSplitNMut: T, &'a mut [T] }
/// An iterator over overlapping subslices of length `size`.
#[deriving(Clone)]
#[derive(Clone)]
#[experimental = "needs review"]
pub struct Windows<'a, T:'a> {
v: &'a [T],
@ -1170,7 +1170,7 @@ impl<'a, T> Iterator for Windows<'a, T> {
///
/// When the slice len is not evenly divided by the chunk size, the last slice
/// of the iteration will be the remainder.
#[deriving(Clone)]
#[derive(Clone)]
#[experimental = "needs review"]
pub struct Chunks<'a, T:'a> {
v: &'a [T],

View File

@ -18,7 +18,7 @@
use self::Searcher::{Naive, TwoWay, TwoWayLong};
use cmp::{mod, Eq};
use cmp::{self, Eq};
use default::Default;
use iter::range;
use iter::ExactSizeIterator;
@ -27,11 +27,11 @@ use kinds::Sized;
use mem;
use num::Int;
use ops::{Fn, FnMut};
use option::Option::{mod, None, Some};
use option::Option::{self, None, Some};
use ptr::PtrExt;
use raw::{Repr, Slice};
use result::Result::{mod, Ok, Err};
use slice::{mod, SliceExt};
use result::Result::{self, Ok, Err};
use slice::{self, SliceExt};
use uint;
macro_rules! delegate_iter {
@ -147,7 +147,7 @@ Section: Creating a string
*/
/// Errors which can occur when attempting to interpret a byte slice as a `str`.
#[deriving(Copy, Eq, PartialEq, Clone)]
#[derive(Copy, Eq, PartialEq, Clone)]
pub enum Utf8Error {
/// An invalid byte was detected at the byte offset given.
///
@ -252,7 +252,7 @@ Section: Iterators
/// Iterator for the char (representing *Unicode Scalar Values*) of a string
///
/// Created with the method `.chars()`.
#[deriving(Clone, Copy)]
#[derive(Clone, Copy)]
pub struct Chars<'a> {
iter: slice::Iter<'a, u8>
}
@ -361,7 +361,7 @@ impl<'a> DoubleEndedIterator for Chars<'a> {
/// External iterator for a string's characters and their byte offsets.
/// Use with the `std::iter` module.
#[deriving(Clone)]
#[derive(Clone)]
pub struct CharIndices<'a> {
front_offset: uint,
iter: Chars<'a>,
@ -409,13 +409,13 @@ impl<'a> DoubleEndedIterator for CharIndices<'a> {
///
/// Created with `StrExt::bytes`
#[stable]
#[deriving(Clone)]
#[derive(Clone)]
pub struct Bytes<'a>(Map<&'a u8, u8, slice::Iter<'a, u8>, BytesDeref>);
delegate_iter!{exact u8 in Bytes<'a>}
/// A temporary fn new type that ensures that the `Bytes` iterator
/// is cloneable.
#[deriving(Copy, Clone)]
#[derive(Copy, Clone)]
struct BytesDeref;
impl<'a> Fn(&'a u8) -> u8 for BytesDeref {
@ -426,7 +426,7 @@ impl<'a> Fn(&'a u8) -> u8 for BytesDeref {
}
/// An iterator over the substrings of a string, separated by `sep`.
#[deriving(Clone)]
#[derive(Clone)]
#[deprecated = "Type is now named `Split` or `SplitTerminator`"]
pub struct CharSplits<'a, Sep> {
/// The slice remaining to be iterated
@ -440,7 +440,7 @@ pub struct CharSplits<'a, Sep> {
/// An iterator over the substrings of a string, separated by `sep`,
/// splitting at most `count` times.
#[deriving(Clone)]
#[derive(Clone)]
#[deprecated = "Type is now named `SplitN` or `RSplitN`"]
pub struct CharSplitsN<'a, Sep> {
iter: CharSplits<'a, Sep>,
@ -564,7 +564,7 @@ impl<'a, Sep: CharEq> Iterator for CharSplitsN<'a, Sep> {
/// The internal state of an iterator that searches for matches of a substring
/// within a larger string using naive search
#[deriving(Clone)]
#[derive(Clone)]
struct NaiveSearcher {
position: uint
}
@ -590,7 +590,7 @@ impl NaiveSearcher {
/// The internal state of an iterator that searches for matches of a substring
/// within a larger string using two-way search
#[deriving(Clone)]
#[derive(Clone)]
struct TwoWaySearcher {
// constants
crit_pos: uint,
@ -827,7 +827,7 @@ impl TwoWaySearcher {
/// The internal state of an iterator that searches for matches of a substring
/// within a larger string using a dynamically chosen search algorithm
#[deriving(Clone)]
#[derive(Clone)]
enum Searcher {
Naive(NaiveSearcher),
TwoWay(TwoWaySearcher),
@ -855,7 +855,7 @@ impl Searcher {
/// An iterator over the start and end indices of the matches of a
/// substring within a larger string
#[deriving(Clone)]
#[derive(Clone)]
pub struct MatchIndices<'a> {
// constants
haystack: &'a str,
@ -865,7 +865,7 @@ pub struct MatchIndices<'a> {
/// An iterator over the substrings of a string separated by a given
/// search string
#[deriving(Clone)]
#[derive(Clone)]
#[unstable = "Type might get removed"]
pub struct SplitStr<'a> {
it: MatchIndices<'a>,
@ -1073,7 +1073,7 @@ pub fn utf8_char_width(b: u8) -> uint {
/// Struct that contains a `char` and the index of the first byte of
/// the next `char` in a string. This can be used as a data structure
/// for iterating over the UTF-8 bytes of a string.
#[deriving(Copy)]
#[derive(Copy)]
#[unstable = "naming is uncertain with container conventions"]
pub struct CharRange {
/// Current `char`
@ -1249,25 +1249,25 @@ impl<'a, Sized? S> Str for &'a S where S: Str {
}
/// Return type of `StrExt::split`
#[deriving(Clone)]
#[derive(Clone)]
#[stable]
pub struct Split<'a, P>(CharSplits<'a, P>);
delegate_iter!{pattern &'a str in Split<'a, P>}
/// Return type of `StrExt::split_terminator`
#[deriving(Clone)]
#[derive(Clone)]
#[unstable = "might get removed in favour of a constructor method on Split"]
pub struct SplitTerminator<'a, P>(CharSplits<'a, P>);
delegate_iter!{pattern &'a str in SplitTerminator<'a, P>}
/// Return type of `StrExt::splitn`
#[deriving(Clone)]
#[derive(Clone)]
#[stable]
pub struct SplitN<'a, P>(CharSplitsN<'a, P>);
delegate_iter!{pattern forward &'a str in SplitN<'a, P>}
/// Return type of `StrExt::rsplitn`
#[deriving(Clone)]
#[derive(Clone)]
#[stable]
pub struct RSplitN<'a, P>(CharSplitsN<'a, P>);
delegate_iter!{pattern forward &'a str in RSplitN<'a, P>}

View File

@ -11,7 +11,7 @@ use core::any::*;
use test::Bencher;
use test;
#[deriving(PartialEq, Show)]
#[derive(PartialEq, Show)]
struct Test;
static TEST: &'static str = "Test";

View File

@ -37,7 +37,7 @@ use std::string;
/// A piece is a portion of the format string which represents the next part
/// to emit. These are emitted as a stream by the `Parser` class.
#[deriving(Copy, PartialEq)]
#[derive(Copy, PartialEq)]
pub enum Piece<'a> {
/// A literal string which should directly be emitted
String(&'a str),
@ -47,7 +47,7 @@ pub enum Piece<'a> {
}
/// Representation of an argument specification.
#[deriving(Copy, PartialEq)]
#[derive(Copy, PartialEq)]
pub struct Argument<'a> {
/// Where to find this argument
pub position: Position<'a>,
@ -56,7 +56,7 @@ pub struct Argument<'a> {
}
/// Specification for the formatting of an argument in the format string.
#[deriving(Copy, PartialEq)]
#[derive(Copy, PartialEq)]
pub struct FormatSpec<'a> {
/// Optionally specified character to fill alignment with
pub fill: Option<char>,
@ -75,7 +75,7 @@ pub struct FormatSpec<'a> {
}
/// Enum describing where an argument for a format can be located.
#[deriving(Copy, PartialEq)]
#[derive(Copy, PartialEq)]
pub enum Position<'a> {
/// The argument will be in the next position. This is the default.
ArgumentNext,
@ -86,7 +86,7 @@ pub enum Position<'a> {
}
/// Enum of alignments which are supported.
#[deriving(Copy, PartialEq)]
#[derive(Copy, PartialEq)]
pub enum Alignment {
/// The value will be aligned to the left.
AlignLeft,
@ -100,7 +100,7 @@ pub enum Alignment {
/// Various flags which can be applied to format strings. The meaning of these
/// flags is defined by the formatters themselves.
#[deriving(Copy, PartialEq)]
#[derive(Copy, PartialEq)]
pub enum Flag {
/// A `+` will be used to denote positive numbers.
FlagSignPlus,
@ -116,7 +116,7 @@ pub enum Flag {
/// A count is used for the precision and width parameters of an integer, and
/// can reference either an argument or a literal integer.
#[deriving(Copy, PartialEq)]
#[derive(Copy, PartialEq)]
pub enum Count<'a> {
/// The count is specified explicitly.
CountIs(uint),

View File

@ -105,7 +105,7 @@ use std::iter::repeat;
use std::result;
/// Name of an option. Either a string or a single char.
#[deriving(Clone, PartialEq, Eq)]
#[derive(Clone, PartialEq, Eq)]
pub enum Name {
/// A string representing the long name of an option.
/// For example: "help"
@ -116,7 +116,7 @@ pub enum Name {
}
/// Describes whether an option has an argument.
#[deriving(Clone, Copy, PartialEq, Eq)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum HasArg {
/// The option requires an argument.
Yes,
@ -127,7 +127,7 @@ pub enum HasArg {
}
/// Describes how often an option may occur.
#[deriving(Clone, Copy, PartialEq, Eq)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Occur {
/// The option occurs once.
Req,
@ -138,7 +138,7 @@ pub enum Occur {
}
/// A description of a possible option.
#[deriving(Clone, PartialEq, Eq)]
#[derive(Clone, PartialEq, Eq)]
pub struct Opt {
/// Name of the option
pub name: Name,
@ -152,7 +152,7 @@ pub struct Opt {
/// One group of options, e.g., both `-h` and `--help`, along with
/// their shared description and properties.
#[deriving(Clone, PartialEq, Eq)]
#[derive(Clone, PartialEq, Eq)]
pub struct OptGroup {
/// Short name of the option, e.g. `h` for a `-h` option
pub short_name: String,
@ -169,7 +169,7 @@ pub struct OptGroup {
}
/// Describes whether an option is given at all or has a value.
#[deriving(Clone, PartialEq, Eq)]
#[derive(Clone, PartialEq, Eq)]
enum Optval {
Val(String),
Given,
@ -177,7 +177,7 @@ enum Optval {
/// The result of checking command line arguments. Contains a vector
/// of matches and a vector of free strings.
#[deriving(Clone, PartialEq, Eq)]
#[derive(Clone, PartialEq, Eq)]
pub struct Matches {
/// Options that matched
opts: Vec<Opt>,
@ -190,7 +190,7 @@ pub struct Matches {
/// The type returned when the command line does not conform to the
/// expected format. Use the `Show` implementation to output detailed
/// information.
#[deriving(Clone, PartialEq, Eq)]
#[derive(Clone, PartialEq, Eq)]
pub enum Fail {
/// The option requires an argument but none was passed.
ArgumentMissing(String),
@ -205,7 +205,7 @@ pub enum Fail {
}
/// The type of failure that occurred.
#[deriving(Copy, PartialEq, Eq)]
#[derive(Copy, PartialEq, Eq)]
#[allow(missing_docs)]
pub enum FailType {
ArgumentMissing_,
@ -827,18 +827,18 @@ pub fn short_usage(program_name: &str, opts: &[OptGroup]) -> String {
line
}
#[deriving(Copy)]
#[derive(Copy)]
enum SplitWithinState {
A, // leading whitespace, initial state
B, // words
C, // internal and trailing whitespace
}
#[deriving(Copy)]
#[derive(Copy)]
enum Whitespace {
Ws, // current char is whitespace
Cr // current char is not whitespace
}
#[deriving(Copy)]
#[derive(Copy)]
enum LengthLimit {
UnderLim, // current char makes current substring still fit in limit
OverLim // current char makes current substring no longer fit in limit

View File

@ -517,7 +517,7 @@ pub trait GraphWalk<'a, N, E> {
fn target(&'a self, edge: &E) -> N;
}
#[deriving(Copy, PartialEq, Eq, Show)]
#[derive(Copy, PartialEq, Eq, Show)]
pub enum RenderOption {
NoEdgeLabels,
NoNodeLabels,

View File

@ -386,7 +386,7 @@ pub mod types {
pub type pthread_t = c_ulong;
#[repr(C)]
#[deriving(Copy)] pub struct glob_t {
#[derive(Copy)] pub struct glob_t {
pub gl_pathc: size_t,
pub gl_pathv: *mut *mut c_char,
pub gl_offs: size_t,
@ -399,18 +399,18 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct timeval {
#[derive(Copy)] pub struct timeval {
pub tv_sec: time_t,
pub tv_usec: suseconds_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct timespec {
#[derive(Copy)] pub struct timespec {
pub tv_sec: time_t,
pub tv_nsec: c_long,
}
#[deriving(Copy)] pub enum timezone {}
#[derive(Copy)] pub enum timezone {}
pub type sighandler_t = size_t;
}
@ -423,29 +423,29 @@ pub mod types {
pub type in_port_t = u16;
pub type in_addr_t = u32;
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr {
#[derive(Copy)] pub struct sockaddr {
pub sa_family: sa_family_t,
pub sa_data: [u8; 14],
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_storage {
#[derive(Copy)] pub struct sockaddr_storage {
pub ss_family: sa_family_t,
pub __ss_align: i64,
pub __ss_pad2: [u8; 112],
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_in {
#[derive(Copy)] pub struct sockaddr_in {
pub sin_family: sa_family_t,
pub sin_port: in_port_t,
pub sin_addr: in_addr,
pub sin_zero: [u8; 8],
}
#[repr(C)]
#[deriving(Copy)] pub struct in_addr {
#[derive(Copy)] pub struct in_addr {
pub s_addr: in_addr_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_in6 {
#[derive(Copy)] pub struct sockaddr_in6 {
pub sin6_family: sa_family_t,
pub sin6_port: in_port_t,
pub sin6_flowinfo: u32,
@ -453,21 +453,21 @@ pub mod types {
pub sin6_scope_id: u32,
}
#[repr(C)]
#[deriving(Copy)] pub struct in6_addr {
#[derive(Copy)] pub struct in6_addr {
pub s6_addr: [u16; 8]
}
#[repr(C)]
#[deriving(Copy)] pub struct ip_mreq {
#[derive(Copy)] pub struct ip_mreq {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
}
#[repr(C)]
#[deriving(Copy)] pub struct ip6_mreq {
#[derive(Copy)] pub struct ip6_mreq {
pub ipv6mr_multiaddr: in6_addr,
pub ipv6mr_interface: c_uint,
}
#[repr(C)]
#[deriving(Copy)] pub struct addrinfo {
#[derive(Copy)] pub struct addrinfo {
pub ai_flags: c_int,
pub ai_family: c_int,
pub ai_socktype: c_int,
@ -489,13 +489,13 @@ pub mod types {
pub ai_next: *mut addrinfo,
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_un {
#[derive(Copy)] pub struct sockaddr_un {
pub sun_family: sa_family_t,
pub sun_path: [c_char; 108]
}
#[repr(C)]
#[deriving(Copy)] pub struct ifaddrs {
#[derive(Copy)] pub struct ifaddrs {
pub ifa_next: *mut ifaddrs,
pub ifa_name: *mut c_char,
pub ifa_flags: c_uint,
@ -578,7 +578,7 @@ pub mod types {
pub type blkcnt_t = i32;
#[repr(C)]
#[deriving(Copy)] pub struct stat {
#[derive(Copy)] pub struct stat {
pub st_dev: dev_t,
pub __pad1: c_short,
pub st_ino: ino_t,
@ -602,13 +602,13 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct utimbuf {
#[derive(Copy)] pub struct utimbuf {
pub actime: time_t,
pub modtime: time_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct pthread_attr_t {
#[derive(Copy)] pub struct pthread_attr_t {
pub __size: [u32; 9]
}
}
@ -623,7 +623,7 @@ pub mod types {
pub type blkcnt_t = u32;
#[repr(C)]
#[deriving(Copy)] pub struct stat {
#[derive(Copy)] pub struct stat {
pub st_dev: c_ulonglong,
pub __pad0: [c_uchar; 4],
pub __st_ino: ino_t,
@ -646,13 +646,13 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct utimbuf {
#[derive(Copy)] pub struct utimbuf {
pub actime: time_t,
pub modtime: time_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct pthread_attr_t {
#[derive(Copy)] pub struct pthread_attr_t {
pub __size: [u32; 9]
}
}
@ -668,7 +668,7 @@ pub mod types {
pub type blkcnt_t = i32;
#[repr(C)]
#[deriving(Copy)] pub struct stat {
#[derive(Copy)] pub struct stat {
pub st_dev: c_ulong,
pub st_pad1: [c_long; 3],
pub st_ino: ino_t,
@ -692,13 +692,13 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct utimbuf {
#[derive(Copy)] pub struct utimbuf {
pub actime: time_t,
pub modtime: time_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct pthread_attr_t {
#[derive(Copy)] pub struct pthread_attr_t {
pub __size: [u32; 9]
}
}
@ -707,7 +707,7 @@ pub mod types {
pub mod extra {
use types::os::arch::c95::{c_ushort, c_int, c_uchar};
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_ll {
#[derive(Copy)] pub struct sockaddr_ll {
pub sll_family: c_ushort,
pub sll_protocol: c_ushort,
pub sll_ifindex: c_int,
@ -779,7 +779,7 @@ pub mod types {
pub type blkcnt_t = i64;
#[repr(C)]
#[deriving(Copy)] pub struct stat {
#[derive(Copy)] pub struct stat {
pub st_dev: dev_t,
pub st_ino: ino_t,
pub st_nlink: nlink_t,
@ -801,13 +801,13 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct utimbuf {
#[derive(Copy)] pub struct utimbuf {
pub actime: time_t,
pub modtime: time_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct pthread_attr_t {
#[derive(Copy)] pub struct pthread_attr_t {
pub __size: [u64; 7]
}
}
@ -823,7 +823,7 @@ pub mod types {
pub type blkcnt_t = i64;
#[repr(C)]
#[deriving(Copy)] pub struct stat {
#[derive(Copy)] pub struct stat {
pub st_dev: dev_t,
pub st_ino: ino_t,
pub st_mode: mode_t,
@ -846,13 +846,13 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct utimbuf {
#[derive(Copy)] pub struct utimbuf {
pub actime: time_t,
pub modtime: time_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct pthread_attr_t {
#[derive(Copy)] pub struct pthread_attr_t {
pub __size: [u64; 8]
}
}
@ -862,7 +862,7 @@ pub mod types {
}
pub mod extra {
use types::os::arch::c95::{c_ushort, c_int, c_uchar};
#[deriving(Copy)] pub struct sockaddr_ll {
#[derive(Copy)] pub struct sockaddr_ll {
pub sll_family: c_ushort,
pub sll_protocol: c_ushort,
pub sll_ifindex: c_int,
@ -888,7 +888,7 @@ pub mod types {
pub type pthread_t = uintptr_t;
#[repr(C)]
#[deriving(Copy)] pub struct glob_t {
#[derive(Copy)] pub struct glob_t {
pub gl_pathc: size_t,
pub __unused1: size_t,
pub gl_offs: size_t,
@ -905,18 +905,18 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct timeval {
#[derive(Copy)] pub struct timeval {
pub tv_sec: time_t,
pub tv_usec: suseconds_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct timespec {
#[derive(Copy)] pub struct timespec {
pub tv_sec: time_t,
pub tv_nsec: c_long,
}
#[deriving(Copy)] pub enum timezone {}
#[derive(Copy)] pub enum timezone {}
pub type sighandler_t = size_t;
}
@ -929,13 +929,13 @@ pub mod types {
pub type in_port_t = u16;
pub type in_addr_t = u32;
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr {
#[derive(Copy)] pub struct sockaddr {
pub sa_len: u8,
pub sa_family: sa_family_t,
pub sa_data: [u8; 14],
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_storage {
#[derive(Copy)] pub struct sockaddr_storage {
pub ss_len: u8,
pub ss_family: sa_family_t,
pub __ss_pad1: [u8; 6],
@ -943,7 +943,7 @@ pub mod types {
pub __ss_pad2: [u8; 112],
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_in {
#[derive(Copy)] pub struct sockaddr_in {
pub sin_len: u8,
pub sin_family: sa_family_t,
pub sin_port: in_port_t,
@ -951,11 +951,11 @@ pub mod types {
pub sin_zero: [u8; 8],
}
#[repr(C)]
#[deriving(Copy)] pub struct in_addr {
#[derive(Copy)] pub struct in_addr {
pub s_addr: in_addr_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_in6 {
#[derive(Copy)] pub struct sockaddr_in6 {
pub sin6_len: u8,
pub sin6_family: sa_family_t,
pub sin6_port: in_port_t,
@ -964,21 +964,21 @@ pub mod types {
pub sin6_scope_id: u32,
}
#[repr(C)]
#[deriving(Copy)] pub struct in6_addr {
#[derive(Copy)] pub struct in6_addr {
pub s6_addr: [u16; 8]
}
#[repr(C)]
#[deriving(Copy)] pub struct ip_mreq {
#[derive(Copy)] pub struct ip_mreq {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
}
#[repr(C)]
#[deriving(Copy)] pub struct ip6_mreq {
#[derive(Copy)] pub struct ip6_mreq {
pub ipv6mr_multiaddr: in6_addr,
pub ipv6mr_interface: c_uint,
}
#[repr(C)]
#[deriving(Copy)] pub struct addrinfo {
#[derive(Copy)] pub struct addrinfo {
pub ai_flags: c_int,
pub ai_family: c_int,
pub ai_socktype: c_int,
@ -989,13 +989,13 @@ pub mod types {
pub ai_next: *mut addrinfo,
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_un {
#[derive(Copy)] pub struct sockaddr_un {
pub sun_len: u8,
pub sun_family: sa_family_t,
pub sun_path: [c_char; 104]
}
#[repr(C)]
#[deriving(Copy)] pub struct ifaddrs {
#[derive(Copy)] pub struct ifaddrs {
pub ifa_next: *mut ifaddrs,
pub ifa_name: *mut c_char,
pub ifa_flags: c_uint,
@ -1062,7 +1062,7 @@ pub mod types {
pub type blkcnt_t = i64;
pub type fflags_t = u32;
#[repr(C)]
#[deriving(Copy)] pub struct stat {
#[derive(Copy)] pub struct stat {
pub st_dev: dev_t,
pub st_ino: ino_t,
pub st_mode: mode_t,
@ -1088,7 +1088,7 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct utimbuf {
#[derive(Copy)] pub struct utimbuf {
pub actime: time_t,
pub modtime: time_t,
}
@ -1116,7 +1116,7 @@ pub mod types {
pub type pthread_t = uintptr_t;
#[repr(C)]
#[deriving(Copy)] pub struct glob_t {
#[derive(Copy)] pub struct glob_t {
pub gl_pathc: size_t,
pub __unused1: size_t,
pub gl_offs: size_t,
@ -1133,18 +1133,18 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct timeval {
#[derive(Copy)] pub struct timeval {
pub tv_sec: time_t,
pub tv_usec: suseconds_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct timespec {
#[derive(Copy)] pub struct timespec {
pub tv_sec: time_t,
pub tv_nsec: c_long,
}
#[deriving(Copy)] pub enum timezone {}
#[derive(Copy)] pub enum timezone {}
pub type sighandler_t = size_t;
}
@ -1157,13 +1157,13 @@ pub mod types {
pub type in_port_t = u16;
pub type in_addr_t = u32;
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr {
#[derive(Copy)] pub struct sockaddr {
pub sa_len: u8,
pub sa_family: sa_family_t,
pub sa_data: [u8; 14],
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_storage {
#[derive(Copy)] pub struct sockaddr_storage {
pub ss_len: u8,
pub ss_family: sa_family_t,
pub __ss_pad1: [u8; 6],
@ -1171,7 +1171,7 @@ pub mod types {
pub __ss_pad2: [u8; 112],
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_in {
#[derive(Copy)] pub struct sockaddr_in {
pub sin_len: u8,
pub sin_family: sa_family_t,
pub sin_port: in_port_t,
@ -1179,11 +1179,11 @@ pub mod types {
pub sin_zero: [u8; 8],
}
#[repr(C)]
#[deriving(Copy)] pub struct in_addr {
#[derive(Copy)] pub struct in_addr {
pub s_addr: in_addr_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_in6 {
#[derive(Copy)] pub struct sockaddr_in6 {
pub sin6_len: u8,
pub sin6_family: sa_family_t,
pub sin6_port: in_port_t,
@ -1192,21 +1192,21 @@ pub mod types {
pub sin6_scope_id: u32,
}
#[repr(C)]
#[deriving(Copy)] pub struct in6_addr {
#[derive(Copy)] pub struct in6_addr {
pub s6_addr: [u16; 8]
}
#[repr(C)]
#[deriving(Copy)] pub struct ip_mreq {
#[derive(Copy)] pub struct ip_mreq {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
}
#[repr(C)]
#[deriving(Copy)] pub struct ip6_mreq {
#[derive(Copy)] pub struct ip6_mreq {
pub ipv6mr_multiaddr: in6_addr,
pub ipv6mr_interface: c_uint,
}
#[repr(C)]
#[deriving(Copy)] pub struct addrinfo {
#[derive(Copy)] pub struct addrinfo {
pub ai_flags: c_int,
pub ai_family: c_int,
pub ai_socktype: c_int,
@ -1217,13 +1217,13 @@ pub mod types {
pub ai_next: *mut addrinfo,
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_un {
#[derive(Copy)] pub struct sockaddr_un {
pub sun_len: u8,
pub sun_family: sa_family_t,
pub sun_path: [c_char; 104]
}
#[repr(C)]
#[deriving(Copy)] pub struct ifaddrs {
#[derive(Copy)] pub struct ifaddrs {
pub ifa_next: *mut ifaddrs,
pub ifa_name: *mut c_char,
pub ifa_flags: c_uint,
@ -1291,7 +1291,7 @@ pub mod types {
pub type fflags_t = u32;
#[repr(C)]
#[deriving(Copy)] pub struct stat {
#[derive(Copy)] pub struct stat {
pub st_ino: ino_t,
pub st_nlink: nlink_t,
pub st_dev: dev_t,
@ -1316,7 +1316,7 @@ pub mod types {
pub st_qspare2: int64_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct utimbuf {
#[derive(Copy)] pub struct utimbuf {
pub actime: time_t,
pub modtime: time_t,
}
@ -1343,7 +1343,7 @@ pub mod types {
// pub Note: this is the struct called stat64 in Windows. Not stat,
// nor stati64.
#[repr(C)]
#[deriving(Copy)] pub struct stat {
#[derive(Copy)] pub struct stat {
pub st_dev: dev_t,
pub st_ino: ino_t,
pub st_mode: u16,
@ -1359,24 +1359,24 @@ pub mod types {
// note that this is called utimbuf64 in Windows
#[repr(C)]
#[deriving(Copy)] pub struct utimbuf {
#[derive(Copy)] pub struct utimbuf {
pub actime: time64_t,
pub modtime: time64_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct timeval {
#[derive(Copy)] pub struct timeval {
pub tv_sec: c_long,
pub tv_usec: c_long,
}
#[repr(C)]
#[deriving(Copy)] pub struct timespec {
#[derive(Copy)] pub struct timespec {
pub tv_sec: time_t,
pub tv_nsec: c_long,
}
#[deriving(Copy)] pub enum timezone {}
#[derive(Copy)] pub enum timezone {}
}
pub mod bsd44 {
@ -1389,30 +1389,30 @@ pub mod types {
pub type in_port_t = u16;
pub type in_addr_t = u32;
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr {
#[derive(Copy)] pub struct sockaddr {
pub sa_family: sa_family_t,
pub sa_data: [u8; 14],
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_storage {
#[derive(Copy)] pub struct sockaddr_storage {
pub ss_family: sa_family_t,
pub __ss_pad1: [u8; 6],
pub __ss_align: i64,
pub __ss_pad2: [u8; 112],
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_in {
#[derive(Copy)] pub struct sockaddr_in {
pub sin_family: sa_family_t,
pub sin_port: in_port_t,
pub sin_addr: in_addr,
pub sin_zero: [u8; 8],
}
#[repr(C)]
#[deriving(Copy)] pub struct in_addr {
#[derive(Copy)] pub struct in_addr {
pub s_addr: in_addr_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_in6 {
#[derive(Copy)] pub struct sockaddr_in6 {
pub sin6_family: sa_family_t,
pub sin6_port: in_port_t,
pub sin6_flowinfo: u32,
@ -1420,21 +1420,21 @@ pub mod types {
pub sin6_scope_id: u32,
}
#[repr(C)]
#[deriving(Copy)] pub struct in6_addr {
#[derive(Copy)] pub struct in6_addr {
pub s6_addr: [u16; 8]
}
#[repr(C)]
#[deriving(Copy)] pub struct ip_mreq {
#[derive(Copy)] pub struct ip_mreq {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
}
#[repr(C)]
#[deriving(Copy)] pub struct ip6_mreq {
#[derive(Copy)] pub struct ip6_mreq {
pub ipv6mr_multiaddr: in6_addr,
pub ipv6mr_interface: c_uint,
}
#[repr(C)]
#[deriving(Copy)] pub struct addrinfo {
#[derive(Copy)] pub struct addrinfo {
pub ai_flags: c_int,
pub ai_family: c_int,
pub ai_socktype: c_int,
@ -1445,7 +1445,7 @@ pub mod types {
pub ai_next: *mut addrinfo,
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_un {
#[derive(Copy)] pub struct sockaddr_un {
pub sun_family: sa_family_t,
pub sun_path: [c_char; 108]
}
@ -1573,7 +1573,7 @@ pub mod types {
pub type LPCH = *mut CHAR;
#[repr(C)]
#[deriving(Copy)] pub struct SECURITY_ATTRIBUTES {
#[derive(Copy)] pub struct SECURITY_ATTRIBUTES {
pub nLength: DWORD,
pub lpSecurityDescriptor: LPVOID,
pub bInheritHandle: BOOL,
@ -1597,7 +1597,7 @@ pub mod types {
pub type int64 = i64;
#[repr(C)]
#[deriving(Copy)] pub struct STARTUPINFO {
#[derive(Copy)] pub struct STARTUPINFO {
pub cb: DWORD,
pub lpReserved: LPWSTR,
pub lpDesktop: LPWSTR,
@ -1620,7 +1620,7 @@ pub mod types {
pub type LPSTARTUPINFO = *mut STARTUPINFO;
#[repr(C)]
#[deriving(Copy)] pub struct PROCESS_INFORMATION {
#[derive(Copy)] pub struct PROCESS_INFORMATION {
pub hProcess: HANDLE,
pub hThread: HANDLE,
pub dwProcessId: DWORD,
@ -1629,7 +1629,7 @@ pub mod types {
pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION;
#[repr(C)]
#[deriving(Copy)] pub struct SYSTEM_INFO {
#[derive(Copy)] pub struct SYSTEM_INFO {
pub wProcessorArchitecture: WORD,
pub wReserved: WORD,
pub dwPageSize: DWORD,
@ -1645,7 +1645,7 @@ pub mod types {
pub type LPSYSTEM_INFO = *mut SYSTEM_INFO;
#[repr(C)]
#[deriving(Copy)] pub struct MEMORY_BASIC_INFORMATION {
#[derive(Copy)] pub struct MEMORY_BASIC_INFORMATION {
pub BaseAddress: LPVOID,
pub AllocationBase: LPVOID,
pub AllocationProtect: DWORD,
@ -1657,7 +1657,7 @@ pub mod types {
pub type LPMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION;
#[repr(C)]
#[deriving(Copy)] pub struct OVERLAPPED {
#[derive(Copy)] pub struct OVERLAPPED {
pub Internal: *mut c_ulong,
pub InternalHigh: *mut c_ulong,
pub Offset: DWORD,
@ -1668,7 +1668,7 @@ pub mod types {
pub type LPOVERLAPPED = *mut OVERLAPPED;
#[repr(C)]
#[deriving(Copy)] pub struct FILETIME {
#[derive(Copy)] pub struct FILETIME {
pub dwLowDateTime: DWORD,
pub dwHighDateTime: DWORD,
}
@ -1676,7 +1676,7 @@ pub mod types {
pub type LPFILETIME = *mut FILETIME;
#[repr(C)]
#[deriving(Copy)] pub struct GUID {
#[derive(Copy)] pub struct GUID {
pub Data1: DWORD,
pub Data2: WORD,
pub Data3: WORD,
@ -1684,7 +1684,7 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct WSAPROTOCOLCHAIN {
#[derive(Copy)] pub struct WSAPROTOCOLCHAIN {
pub ChainLen: c_int,
pub ChainEntries: [DWORD; MAX_PROTOCOL_CHAIN as uint],
}
@ -1692,7 +1692,7 @@ pub mod types {
pub type LPWSAPROTOCOLCHAIN = *mut WSAPROTOCOLCHAIN;
#[repr(C)]
#[deriving(Copy)] pub struct WSAPROTOCOL_INFO {
#[derive(Copy)] pub struct WSAPROTOCOL_INFO {
pub dwServiceFlags1: DWORD,
pub dwServiceFlags2: DWORD,
pub dwServiceFlags3: DWORD,
@ -1720,7 +1720,7 @@ pub mod types {
pub type GROUP = c_uint;
#[repr(C)]
#[deriving(Copy)] pub struct WIN32_FIND_DATAW {
#[derive(Copy)] pub struct WIN32_FIND_DATAW {
pub dwFileAttributes: DWORD,
pub ftCreationTime: FILETIME,
pub ftLastAccessTime: FILETIME,
@ -1750,7 +1750,7 @@ pub mod types {
pub type pthread_t = uintptr_t;
#[repr(C)]
#[deriving(Copy)] pub struct glob_t {
#[derive(Copy)] pub struct glob_t {
pub gl_pathc: size_t,
pub __unused1: c_int,
pub gl_offs: size_t,
@ -1767,18 +1767,18 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct timeval {
#[derive(Copy)] pub struct timeval {
pub tv_sec: time_t,
pub tv_usec: suseconds_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct timespec {
#[derive(Copy)] pub struct timespec {
pub tv_sec: time_t,
pub tv_nsec: c_long,
}
#[deriving(Copy)] pub enum timezone {}
#[derive(Copy)] pub enum timezone {}
pub type sighandler_t = size_t;
}
@ -1792,14 +1792,14 @@ pub mod types {
pub type in_port_t = u16;
pub type in_addr_t = u32;
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr {
#[derive(Copy)] pub struct sockaddr {
pub sa_len: u8,
pub sa_family: sa_family_t,
pub sa_data: [u8; 14],
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_storage {
#[derive(Copy)] pub struct sockaddr_storage {
pub ss_len: u8,
pub ss_family: sa_family_t,
pub __ss_pad1: [u8; 6],
@ -1808,7 +1808,7 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_in {
#[derive(Copy)] pub struct sockaddr_in {
pub sin_len: u8,
pub sin_family: sa_family_t,
pub sin_port: in_port_t,
@ -1817,12 +1817,12 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct in_addr {
#[derive(Copy)] pub struct in_addr {
pub s_addr: in_addr_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_in6 {
#[derive(Copy)] pub struct sockaddr_in6 {
pub sin6_len: u8,
pub sin6_family: sa_family_t,
pub sin6_port: in_port_t,
@ -1832,24 +1832,24 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct in6_addr {
#[derive(Copy)] pub struct in6_addr {
pub s6_addr: [u16; 8]
}
#[repr(C)]
#[deriving(Copy)] pub struct ip_mreq {
#[derive(Copy)] pub struct ip_mreq {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
}
#[repr(C)]
#[deriving(Copy)] pub struct ip6_mreq {
#[derive(Copy)] pub struct ip6_mreq {
pub ipv6mr_multiaddr: in6_addr,
pub ipv6mr_interface: c_uint,
}
#[repr(C)]
#[deriving(Copy)] pub struct addrinfo {
#[derive(Copy)] pub struct addrinfo {
pub ai_flags: c_int,
pub ai_family: c_int,
pub ai_socktype: c_int,
@ -1861,14 +1861,14 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct sockaddr_un {
#[derive(Copy)] pub struct sockaddr_un {
pub sun_len: u8,
pub sun_family: sa_family_t,
pub sun_path: [c_char; 104]
}
#[repr(C)]
#[deriving(Copy)] pub struct ifaddrs {
#[derive(Copy)] pub struct ifaddrs {
pub ifa_next: *mut ifaddrs,
pub ifa_name: *mut c_char,
pub ifa_flags: c_uint,
@ -1931,7 +1931,7 @@ pub mod types {
pub type blkcnt_t = i32;
#[repr(C)]
#[deriving(Copy)] pub struct stat {
#[derive(Copy)] pub struct stat {
pub st_dev: dev_t,
pub st_mode: mode_t,
pub st_nlink: nlink_t,
@ -1957,13 +1957,13 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct utimbuf {
#[derive(Copy)] pub struct utimbuf {
pub actime: time_t,
pub modtime: time_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct pthread_attr_t {
#[derive(Copy)] pub struct pthread_attr_t {
pub __sig: c_long,
pub __opaque: [c_char; 36]
}
@ -1974,7 +1974,7 @@ pub mod types {
}
pub mod extra {
#[repr(C)]
#[deriving(Copy)] pub struct mach_timebase_info {
#[derive(Copy)] pub struct mach_timebase_info {
pub numer: u32,
pub denom: u32,
}
@ -2035,7 +2035,7 @@ pub mod types {
pub type blkcnt_t = i32;
#[repr(C)]
#[deriving(Copy)] pub struct stat {
#[derive(Copy)] pub struct stat {
pub st_dev: dev_t,
pub st_mode: mode_t,
pub st_nlink: nlink_t,
@ -2061,13 +2061,13 @@ pub mod types {
}
#[repr(C)]
#[deriving(Copy)] pub struct utimbuf {
#[derive(Copy)] pub struct utimbuf {
pub actime: time_t,
pub modtime: time_t,
}
#[repr(C)]
#[deriving(Copy)] pub struct pthread_attr_t {
#[derive(Copy)] pub struct pthread_attr_t {
pub __sig: c_long,
pub __opaque: [c_char; 56]
}
@ -2078,7 +2078,7 @@ pub mod types {
}
pub mod extra {
#[repr(C)]
#[deriving(Copy)] pub struct mach_timebase_info {
#[derive(Copy)] pub struct mach_timebase_info {
pub numer: u32,
pub denom: u32,
}

View File

@ -12,7 +12,7 @@ use regex::Regex;
use std::ascii::AsciiExt;
use std::cmp;
#[deriving(Show, Clone)]
#[derive(Show, Clone)]
pub struct LogDirective {
pub name: Option<String>,
pub level: u32,

View File

@ -232,7 +232,7 @@ struct DefaultLogger {
}
/// Wraps the log level with fmt implementations.
#[deriving(Copy, PartialEq, PartialOrd)]
#[derive(Copy, PartialEq, PartialOrd)]
pub struct LogLevel(pub u32);
impl fmt::Show for LogLevel {
@ -319,7 +319,7 @@ pub fn set_logger(logger: Box<Logger + Send>) -> Option<Box<Logger + Send>> {
/// A LogRecord is created by the logging macros, and passed as the only
/// argument to Loggers.
#[deriving(Show)]
#[derive(Show)]
pub struct LogRecord<'a> {
/// The module path of where the LogRecord originated.
@ -339,7 +339,7 @@ pub struct LogRecord<'a> {
}
#[doc(hidden)]
#[deriving(Copy)]
#[derive(Copy)]
pub struct LogLocation {
pub module_path: &'static str,
pub file: &'static str,

View File

@ -29,7 +29,7 @@ const CHACHA_ROUNDS: uint = 20; // Cryptographically secure from 8 upwards as of
/// [1]: D. J. Bernstein, [*ChaCha, a variant of
/// Salsa20*](http://cr.yp.to/chacha.html)
#[deriving(Copy)]
#[derive(Copy)]
pub struct ChaChaRng {
buffer: [u32; STATE_WORDS], // Internal buffer of output
state: [u32; STATE_WORDS], // Initial state

View File

@ -29,7 +29,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample};
/// Generate Normal Random
/// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
/// College, Oxford
#[deriving(Copy)]
#[derive(Copy)]
pub struct Exp1(pub f64);
// This could be done via `-rng.gen::<f64>().ln()` but that is slower.
@ -67,7 +67,7 @@ impl Rand for Exp1 {
/// let v = exp.ind_sample(&mut rand::thread_rng());
/// println!("{} is from a Exp(2) distribution", v);
/// ```
#[deriving(Copy)]
#[derive(Copy)]
pub struct Exp {
/// `lambda` stored as `1/lambda`, since this is what we scale by.
lambda_inverse: f64

View File

@ -263,7 +263,7 @@ mod tests {
use {Rng, Rand};
use super::{RandSample, WeightedChoice, Weighted, Sample, IndependentSample};
#[deriving(PartialEq, Show)]
#[derive(PartialEq, Show)]
struct ConstRand(uint);
impl Rand for ConstRand {
fn rand<R: Rng>(_: &mut R) -> ConstRand {

View File

@ -28,7 +28,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample};
/// Generate Normal Random
/// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
/// College, Oxford
#[deriving(Copy)]
#[derive(Copy)]
pub struct StandardNormal(pub f64);
impl Rand for StandardNormal {
@ -84,7 +84,7 @@ impl Rand for StandardNormal {
/// let v = normal.ind_sample(&mut rand::thread_rng());
/// println!("{} is from a N(2, 9) distribution", v)
/// ```
#[deriving(Copy)]
#[derive(Copy)]
pub struct Normal {
mean: f64,
std_dev: f64,
@ -132,7 +132,7 @@ impl IndependentSample<f64> for Normal {
/// let v = log_normal.ind_sample(&mut rand::thread_rng());
/// println!("{} is from an ln N(2, 9) distribution", v)
/// ```
#[deriving(Copy)]
#[derive(Copy)]
pub struct LogNormal {
norm: Normal
}

View File

@ -29,7 +29,7 @@ const RAND_SIZE_UINT: uint = 1 << (RAND_SIZE_LEN as uint);
///
/// [1]: Bob Jenkins, [*ISAAC: A fast cryptographic random number
/// generator*](http://www.burtleburtle.net/bob/rand/isaacafa.html)
#[deriving(Copy)]
#[derive(Copy)]
pub struct IsaacRng {
cnt: u32,
rsl: [u32; RAND_SIZE_UINT],
@ -264,7 +264,7 @@ const RAND_SIZE_64: uint = 1 << RAND_SIZE_64_LEN;
///
/// [1]: Bob Jenkins, [*ISAAC: A fast cryptographic random number
/// generator*](http://www.burtleburtle.net/bob/rand/isaacafa.html)
#[deriving(Copy)]
#[derive(Copy)]
pub struct Isaac64Rng {
cnt: uint,
rsl: [u64; RAND_SIZE_64],

View File

@ -133,7 +133,7 @@ pub trait Reseeder<R> {
/// Reseed an RNG using a `Default` instance. This reseeds by
/// replacing the RNG with the result of a `Default::default` call.
#[deriving(Copy)]
#[derive(Copy)]
pub struct ReseedWithDefault;
impl<R: Rng + Default> Reseeder<R> for ReseedWithDefault {

View File

@ -41,7 +41,7 @@ use std::str;
pub mod io;
/// Common data structures
#[deriving(Clone, Copy)]
#[derive(Clone, Copy)]
pub struct Doc<'a> {
pub data: &'a [u8],
pub start: uint,
@ -71,7 +71,7 @@ pub struct TaggedDoc<'a> {
pub doc: Doc<'a>,
}
#[deriving(Copy, Show)]
#[derive(Copy, Show)]
pub enum EbmlEncoderTag {
EsUint, // 0
EsU64, // 1
@ -105,7 +105,7 @@ pub enum EbmlEncoderTag {
EsLabel, // Used only when debugging
}
#[deriving(Show)]
#[derive(Show)]
pub enum Error {
IntTooBig(uint),
Expected(String),
@ -147,7 +147,7 @@ pub mod reader {
)
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct Res {
pub val: uint,
pub next: uint

View File

@ -25,7 +25,7 @@ use parse::{
type InstIdx = uint;
#[deriving(Show, Clone)]
#[derive(Show, Clone)]
pub enum Inst {
// When a Match instruction is executed, the current thread is successful.
Match,
@ -78,7 +78,7 @@ pub enum Inst {
/// All of the data in a compiled expression is wrapped in "MaybeStatic" or
/// "MaybeOwned" types so that a `Program` can be represented as static data.
/// (This makes it convenient and efficient for use with the `regex!` macro.)
#[deriving(Clone)]
#[derive(Clone)]
pub struct Program {
/// A sequence of instructions.
pub insts: Vec<Inst>,

View File

@ -52,7 +52,7 @@ impl fmt::Show for Error {
///
/// Note that this representation prevents one from reproducing the regex as
/// it was typed. (But it could be used to reproduce an equivalent regex.)
#[deriving(Show, Clone)]
#[derive(Show, Clone)]
pub enum Ast {
Nothing,
Literal(char, Flags),
@ -69,14 +69,14 @@ pub enum Ast {
Rep(Box<Ast>, Repeater, Greed),
}
#[deriving(Show, PartialEq, Clone)]
#[derive(Show, PartialEq, Clone)]
pub enum Repeater {
ZeroOne,
ZeroMore,
OneMore,
}
#[deriving(Copy, Show, Clone)]
#[derive(Copy, Show, Clone)]
pub enum Greed {
Greedy,
Ungreedy,
@ -103,7 +103,7 @@ impl Greed {
/// constructing an abstract syntax tree. Its central purpose is to facilitate
/// parsing groups and alternations while also maintaining a stack of flag
/// state.
#[deriving(Show)]
#[derive(Show)]
enum BuildAst {
Expr(Ast),
Paren(Flags, uint, String), // '('

View File

@ -104,7 +104,7 @@ pub fn is_match(regex: &str, text: &str) -> Result<bool, parse::Error> {
/// makes it much faster when searching text.
/// More details about the `regex!` macro can be found in the `regex` crate
/// documentation.
#[deriving(Clone)]
#[derive(Clone)]
pub enum Regex {
// The representation of `Regex` is exported to support the `regex!`
// syntax extension. Do not rely on it.
@ -117,7 +117,7 @@ pub enum Regex {
Native(ExNative),
}
#[deriving(Clone)]
#[derive(Clone)]
#[doc(hidden)]
pub struct ExDynamic {
original: String,
@ -127,7 +127,7 @@ pub struct ExDynamic {
}
#[doc(hidden)]
#[deriving(Copy)]
#[derive(Copy)]
pub struct ExNative {
#[doc(hidden)]
pub original: &'static str,
@ -540,7 +540,7 @@ impl Regex {
}
#[deriving(Clone)]
#[derive(Clone)]
pub enum NamesIter<'a> {
NamesIterNative(::std::slice::Iter<'a, Option<&'static str>>),
NamesIterDynamic(::std::slice::Iter<'a, Option<String>>)
@ -599,7 +599,7 @@ impl<F> Replacer for F where F: FnMut(&Captures) -> String {
///
/// `'r` is the lifetime of the compiled expression and `'t` is the lifetime
/// of the string being split.
#[deriving(Clone)]
#[derive(Clone)]
pub struct RegexSplits<'r, 't> {
finder: FindMatches<'r, 't>,
last: uint,
@ -635,7 +635,7 @@ impl<'r, 't> Iterator for RegexSplits<'r, 't> {
///
/// `'r` is the lifetime of the compiled expression and `'t` is the lifetime
/// of the string being split.
#[deriving(Clone)]
#[derive(Clone)]
pub struct RegexSplitsN<'r, 't> {
splits: RegexSplits<'r, 't>,
cur: uint,
@ -801,7 +801,7 @@ impl<'t> Captures<'t> {
/// expression.
///
/// `'t` is the lifetime of the matched text.
#[deriving(Clone)]
#[derive(Clone)]
pub struct SubCaptures<'t> {
idx: uint,
caps: &'t Captures<'t>,
@ -826,7 +826,7 @@ impl<'t> Iterator for SubCaptures<'t> {
/// Positions are byte indices in terms of the original string matched.
///
/// `'t` is the lifetime of the matched text.
#[deriving(Clone)]
#[derive(Clone)]
pub struct SubCapturesPos<'t> {
idx: uint,
caps: &'t Captures<'t>,
@ -852,7 +852,7 @@ impl<'t> Iterator for SubCapturesPos<'t> {
///
/// `'r` is the lifetime of the compiled expression and `'t` is the lifetime
/// of the matched string.
#[deriving(Clone)]
#[derive(Clone)]
pub struct FindCaptures<'r, 't> {
re: &'r Regex,
search: &'t str,
@ -897,7 +897,7 @@ impl<'r, 't> Iterator for FindCaptures<'r, 't> {
///
/// `'r` is the lifetime of the compiled expression and `'t` is the lifetime
/// of the matched string.
#[deriving(Clone)]
#[derive(Clone)]
pub struct FindMatches<'r, 't> {
re: &'r Regex,
search: &'t str,

View File

@ -37,7 +37,7 @@ pub use self::MatchKind::*;
pub use self::StepState::*;
use std::cmp;
use std::cmp::Ordering::{mod, Less, Equal, Greater};
use std::cmp::Ordering::{self, Less, Equal, Greater};
use std::mem;
use std::iter::repeat;
use std::slice::SliceExt;
@ -52,7 +52,7 @@ use unicode::regex::PERLW;
pub type CaptureLocs = Vec<Option<uint>>;
/// Indicates the type of match to be performed by the VM.
#[deriving(Copy)]
#[derive(Copy)]
pub enum MatchKind {
/// Only checks if a match exists or not. Does not return location.
Exists,
@ -97,7 +97,7 @@ struct Nfa<'r, 't> {
/// Indicates the next action to take after a single non-empty instruction
/// is processed.
#[deriving(Copy)]
#[derive(Copy)]
pub enum StepState {
/// This is returned if and only if a Match instruction is reached and
/// we only care about the existence of a match. It instructs the VM to

View File

@ -29,7 +29,7 @@ use self::MethodContext::*;
use metadata::csearch;
use middle::def::*;
use middle::subst::Substs;
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use middle::{def, pat_util, stability};
use middle::const_eval::{eval_const_expr_partial, const_int, const_uint};
use util::ppaux::{ty_to_string};
@ -43,13 +43,13 @@ use std::{i8, i16, i32, i64, u8, u16, u32, u64, f32, f64};
use syntax::{abi, ast, ast_map};
use syntax::ast_util::is_shift_binop;
use syntax::attr::{mod, AttrMetaMethods};
use syntax::attr::{self, AttrMetaMethods};
use syntax::codemap::{Span, DUMMY_SP};
use syntax::parse::token;
use syntax::ast::{TyI, TyU, TyI8, TyU8, TyI16, TyU16, TyI32, TyU32, TyI64, TyU64};
use syntax::ast_util;
use syntax::ptr::P;
use syntax::visit::{mod, Visitor};
use syntax::visit::{self, Visitor};
declare_lint! {
WHILE_TRUE,
@ -57,7 +57,7 @@ declare_lint! {
"suggest using `loop { }` instead of `while true { }`"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct WhileTrue;
impl LintPass for WhileTrue {
@ -83,7 +83,7 @@ declare_lint! {
"detects unnecessary type casts that can be removed"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct UnusedCasts;
impl LintPass for UnusedCasts {
@ -125,7 +125,7 @@ declare_lint! {
"shift exceeds the type's number of bits"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct TypeLimits {
/// Id of the last visited negated expression
negated_expr_id: ast::NodeId,
@ -442,7 +442,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for ImproperCTypesVisitor<'a, 'tcx> {
}
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct ImproperCTypes;
impl LintPass for ImproperCTypes {
@ -485,7 +485,7 @@ declare_lint! {
"use of owned (Box type) heap memory"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct BoxPointers;
impl BoxPointers {
@ -625,7 +625,7 @@ declare_lint! {
"detects attributes that were not used by the compiler"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct UnusedAttributes;
impl LintPass for UnusedAttributes {
@ -709,7 +709,7 @@ declare_lint! {
"path statements with no effect"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct PathStatements;
impl LintPass for PathStatements {
@ -743,7 +743,7 @@ declare_lint! {
"unused result of an expression in a statement"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct UnusedResults;
impl LintPass for UnusedResults {
@ -811,7 +811,7 @@ declare_lint! {
"types, variants, traits and type parameters should have camel case names"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct NonCamelCaseTypes;
impl NonCamelCaseTypes {
@ -884,7 +884,7 @@ impl LintPass for NonCamelCaseTypes {
}
}
#[deriving(PartialEq)]
#[derive(PartialEq)]
enum MethodContext {
TraitDefaultImpl,
TraitImpl,
@ -934,7 +934,7 @@ declare_lint! {
"methods, functions, lifetime parameters and modules should have snake case names"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct NonSnakeCase;
impl NonSnakeCase {
@ -1047,7 +1047,7 @@ declare_lint! {
"static constants should have uppercase identifiers"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct NonUpperCaseGlobals;
impl LintPass for NonUpperCaseGlobals {
@ -1100,7 +1100,7 @@ declare_lint! {
"`if`, `match`, `while` and `return` do not need parentheses"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct UnusedParens;
impl UnusedParens {
@ -1194,7 +1194,7 @@ declare_lint! {
"unnecessary braces around an imported item"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct UnusedImportBraces;
impl LintPass for UnusedImportBraces {
@ -1233,7 +1233,7 @@ declare_lint! {
"using `Struct { x: x }` instead of `Struct { x }`"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct NonShorthandFieldPatterns;
impl LintPass for NonShorthandFieldPatterns {
@ -1266,7 +1266,7 @@ declare_lint! {
"unnecessary use of an `unsafe` block"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct UnusedUnsafe;
impl LintPass for UnusedUnsafe {
@ -1291,7 +1291,7 @@ declare_lint! {
"usage of an `unsafe` block"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct UnsafeBlocks;
impl LintPass for UnsafeBlocks {
@ -1315,7 +1315,7 @@ declare_lint! {
"detect mut variables which don't need to be mutable"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct UnusedMut;
impl UnusedMut {
@ -1384,7 +1384,7 @@ declare_lint! {
"detects unnecessary allocations that can be eliminated"
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct UnusedAllocation;
impl LintPass for UnusedAllocation {
@ -1575,7 +1575,7 @@ impl LintPass for MissingDoc {
}
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct MissingCopyImplementations;
impl LintPass for MissingCopyImplementations {
@ -1646,7 +1646,7 @@ declare_lint! {
/// Checks for use of items with `#[deprecated]`, `#[experimental]` and
/// `#[unstable]` attributes, or no stability attribute.
#[deriving(Copy)]
#[derive(Copy)]
pub struct Stability;
impl Stability {
@ -1857,7 +1857,7 @@ declare_lint!{
/// Does nothing as a lint pass, but registers some `Lint`s
/// which are used by other parts of the compiler.
#[deriving(Copy)]
#[derive(Copy)]
pub struct HardwiredLints;
impl LintPass for HardwiredLints {

View File

@ -26,7 +26,7 @@
use self::TargetLint::*;
use middle::privacy::ExportedItems;
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use session::{early_error, Session};
use lint::{Level, LevelSource, Lint, LintId, LintArray, LintPass, LintPassObject};
use lint::{Default, CommandLine, Node, Allow, Warn, Deny, Forbid};

View File

@ -42,7 +42,7 @@ use syntax::ast;
pub use lint::context::{Context, LintStore, raw_emit_lint, check_crate, gather_attrs};
/// Specification of a single lint.
#[deriving(Copy)]
#[derive(Copy)]
pub struct Lint {
/// A string identifier for the lint.
///
@ -174,7 +174,7 @@ pub trait LintPass {
pub type LintPassObject = Box<LintPass + 'static>;
/// Identifies a lint known to the compiler.
#[deriving(Clone, Copy)]
#[derive(Clone, Copy)]
pub struct LintId {
// Identity is based on pointer equality of this field.
lint: &'static Lint,
@ -210,7 +210,7 @@ impl LintId {
}
/// Setting for how to handle a lint.
#[deriving(Clone, Copy, PartialEq, PartialOrd, Eq, Ord)]
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord)]
pub enum Level {
Allow, Warn, Deny, Forbid
}
@ -239,7 +239,7 @@ impl Level {
}
/// How a lint level was set.
#[deriving(Clone, Copy, PartialEq, Eq)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum LintSource {
/// Lint is at the default level as declared
/// in rustc or a plugin.

View File

@ -113,7 +113,7 @@ pub const tag_items_data_item_reexport_def_id: uint = 0x39;
pub const tag_items_data_item_reexport_name: uint = 0x3a;
// used to encode crate_ctxt side tables
#[deriving(Copy, PartialEq)]
#[derive(Copy, PartialEq)]
#[repr(uint)]
pub enum astencode_tag { // Reserves 0x40 -- 0x5f
tag_ast = 0x40,
@ -219,7 +219,7 @@ pub const tag_items_data_item_stability: uint = 0x92;
pub const tag_items_data_item_repr: uint = 0x93;
#[deriving(Clone, Show)]
#[derive(Clone, Show)]
pub struct LinkMeta {
pub crate_name: String,
pub crate_hash: Svh,

View File

@ -32,7 +32,7 @@ use syntax::parse::token;
use std::collections::hash_map::HashMap;
#[deriving(Copy)]
#[derive(Copy)]
pub struct MethodInfo {
pub name: ast::Name,
pub def_id: ast::DefId,

View File

@ -48,13 +48,13 @@ pub struct crate_metadata {
pub span: Span,
}
#[deriving(Copy, Show, PartialEq, Clone)]
#[derive(Copy, Show, PartialEq, Clone)]
pub enum LinkagePreference {
RequireDynamic,
RequireStatic,
}
#[deriving(Copy, Clone, PartialEq, FromPrimitive)]
#[derive(Copy, Clone, PartialEq, FromPrimitive)]
pub enum NativeLibraryKind {
NativeStatic, // native static library (.a archive)
NativeFramework, // OSX-specific
@ -63,7 +63,7 @@ pub enum NativeLibraryKind {
// Where a crate came from on the local filesystem. One of these two options
// must be non-None.
#[deriving(PartialEq, Clone)]
#[derive(PartialEq, Clone)]
pub struct CrateSource {
pub dylib: Option<Path>,
pub rlib: Option<Path>,

View File

@ -29,7 +29,7 @@ use middle::def;
use middle::lang_items;
use middle::subst;
use middle::ty::{ImplContainer, TraitContainer};
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use middle::astencode::vtable_decoder_helpers;
use std::collections::HashMap;
@ -111,7 +111,7 @@ fn lookup_item<'a>(item_id: ast::NodeId, data: &'a [u8]) -> rbml::Doc<'a> {
find_item(item_id, items)
}
#[deriving(PartialEq)]
#[derive(PartialEq)]
enum Family {
ImmStatic, // c
MutStatic, // b
@ -471,7 +471,7 @@ pub fn get_symbol(data: &[u8], id: ast::NodeId) -> String {
}
// Something that a name can resolve to.
#[deriving(Copy, Clone, Show)]
#[derive(Copy, Clone, Show)]
pub enum DefLike {
DlDef(def::Def),
DlImpl(ast::DefId),
@ -1173,7 +1173,7 @@ pub fn get_crate_attributes(data: &[u8]) -> Vec<ast::Attribute> {
get_attributes(rbml::Doc::new(data))
}
#[deriving(Clone)]
#[derive(Clone)]
pub struct CrateDep {
pub cnum: ast::CrateNum,
pub name: String,

View File

@ -23,7 +23,7 @@ use metadata::decoder;
use metadata::tyencode;
use middle::def;
use middle::ty::{lookup_item_type};
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use middle::stability;
use util::nodemap::{FnvHashMap, NodeMap, NodeSet};
@ -32,7 +32,7 @@ use std::cell::RefCell;
use std::hash::Hash;
use std::hash;
use syntax::abi;
use syntax::ast::{mod, DefId, NodeId};
use syntax::ast::{self, DefId, NodeId};
use syntax::ast_map::{PathElem, PathElems};
use syntax::ast_map;
use syntax::ast_util::*;
@ -98,7 +98,7 @@ pub fn encode_def_id(rbml_w: &mut Encoder, id: DefId) {
rbml_w.wr_tagged_str(tag_def_id, def_to_string(id)[]);
}
#[deriving(Clone)]
#[derive(Clone)]
struct entry<T> {
val: T,
pos: u64

View File

@ -20,7 +20,7 @@ use std::os;
use util::fs as myfs;
use session::search_paths::{SearchPaths, PathKind};
#[deriving(Copy)]
#[derive(Copy)]
pub enum FileMatch {
FileMatches,
FileDoesntMatch,

View File

@ -21,7 +21,7 @@ pub use self::DefIdSource::*;
use middle::region;
use middle::subst;
use middle::subst::VecPerParamSpace;
use middle::ty::{mod, AsPredicate, Ty};
use middle::ty::{self, AsPredicate, Ty};
use std::rc::Rc;
use std::str;
@ -43,7 +43,7 @@ use syntax::parse::token;
// def-id will depend on where it originated from. Therefore, the conversion
// function is given an indicator of the source of the def-id. See
// astencode.rs for more information.
#[deriving(Copy, Show)]
#[derive(Copy, Show)]
pub enum DefIdSource {
// Identifies a struct, trait, enum, etc.
NominalType,

View File

@ -19,7 +19,7 @@ use middle::region;
use middle::subst;
use middle::subst::VecPerParamSpace;
use middle::ty::ParamTy;
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use util::nodemap::FnvHashMap;
use syntax::abi::Abi;

View File

@ -15,7 +15,7 @@
*/
use middle::def;
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use syntax::ast;
use util::ppaux::Repr;

View File

@ -26,7 +26,7 @@ use metadata::tyencode;
use middle::mem_categorization::Typer;
use middle::subst;
use middle::subst::VecPerParamSpace;
use middle::ty::{mod, Ty, MethodCall, MethodCallee, MethodOrigin};
use middle::ty::{self, Ty, MethodCall, MethodCallee, MethodOrigin};
use util::ppaux::ty_to_string;
use syntax::{ast, ast_map, ast_util, codemap, fold};

View File

@ -26,7 +26,7 @@ struct CFGBuilder<'a, 'tcx: 'a> {
loop_scopes: Vec<LoopScope>,
}
#[deriving(Copy)]
#[derive(Copy)]
struct LoopScope {
loop_id: ast::NodeId, // id of loop/while node
continue_index: CFGIndex, // where to go on a `loop`

View File

@ -26,7 +26,7 @@ pub struct CFG {
pub exit: CFGIndex,
}
#[deriving(Copy)]
#[derive(Copy)]
pub struct CFGNodeData {
pub id: ast::NodeId
}

View File

@ -16,12 +16,12 @@ use syntax::codemap::Span;
use syntax::visit::Visitor;
use syntax::visit;
#[deriving(Clone, Copy, PartialEq)]
#[derive(Clone, Copy, PartialEq)]
enum Context {
Normal, Loop, Closure
}
#[deriving(Copy)]
#[derive(Copy)]
struct CheckLoopVisitor<'a> {
sess: &'a Session,
cx: Context

View File

@ -27,14 +27,14 @@ use std::fmt;
use std::iter::{range_inclusive, AdditiveIterator, FromIterator, repeat};
use std::num::Float;
use std::slice;
use syntax::ast::{mod, DUMMY_NODE_ID, NodeId, Pat};
use syntax::ast::{self, DUMMY_NODE_ID, NodeId, Pat};
use syntax::ast_util::walk_pat;
use syntax::codemap::{Span, Spanned, DUMMY_SP};
use syntax::fold::{Folder, noop_fold_pat};
use syntax::print::pprust::pat_to_string;
use syntax::parse::token;
use syntax::ptr::P;
use syntax::visit::{mod, Visitor, FnKind};
use syntax::visit::{self, Visitor, FnKind};
use util::ppaux::ty_to_string;
pub const DUMMY_WILD_PAT: &'static Pat = &Pat {
@ -102,7 +102,7 @@ pub struct MatchCheckCtxt<'a, 'tcx: 'a> {
pub param_env: ParameterEnvironment<'a, 'tcx>,
}
#[deriving(Clone, PartialEq)]
#[derive(Clone, PartialEq)]
pub enum Constructor {
/// The constructor of all patterns that don't vary by constructor,
/// e.g. struct patterns and fixed-length arrays.
@ -119,14 +119,14 @@ pub enum Constructor {
SliceWithSubslice(uint, uint)
}
#[deriving(Clone, PartialEq)]
#[derive(Clone, PartialEq)]
enum Usefulness {
Useful,
UsefulWithWitness(Vec<P<Pat>>),
NotUseful
}
#[deriving(Copy)]
#[derive(Copy)]
enum WitnessPreference {
ConstructWitness,
LeaveOutWitness

View File

@ -39,7 +39,7 @@ use syntax::visit::Visitor;
use syntax::codemap::Span;
use syntax::visit;
#[deriving(Copy, Eq, PartialEq)]
#[derive(Copy, Eq, PartialEq)]
enum Mode {
InConstant,
InStatic,

View File

@ -17,14 +17,14 @@ pub use self::constness::*;
use metadata::csearch;
use middle::{astencode, def};
use middle::pat_util::def_to_path;
use middle::ty::{mod};
use middle::ty::{self};
use middle::astconv_util::{ast_ty_to_prim_ty};
use util::nodemap::DefIdMap;
use syntax::ast::{mod, Expr};
use syntax::ast::{self, Expr};
use syntax::parse::token::InternedString;
use syntax::ptr::P;
use syntax::visit::{mod, Visitor};
use syntax::visit::{self, Visitor};
use syntax::{ast_map, ast_util, codemap};
use std::collections::hash_map::Entry::Vacant;
@ -62,7 +62,7 @@ use std::rc::Rc;
// - Non-constants: everything else.
//
#[deriving(Copy)]
#[derive(Copy)]
pub enum constness {
integral_const,
general_const,
@ -294,7 +294,7 @@ pub fn process_crate(tcx: &ty::ctxt) {
// FIXME (#33): this doesn't handle big integer/float literals correctly
// (nor does the rest of our literal handling).
#[deriving(Clone, PartialEq)]
#[derive(Clone, PartialEq)]
pub enum const_val {
const_float(f64),
const_int(i64),

View File

@ -28,13 +28,13 @@ use syntax::visit;
use syntax::print::{pp, pprust};
use util::nodemap::NodeMap;
#[deriving(Copy, Show)]
#[derive(Copy, Show)]
pub enum EntryOrExit {
Entry,
Exit,
}
#[deriving(Clone)]
#[derive(Clone)]
pub struct DataFlowContext<'a, 'tcx: 'a, O> {
tcx: &'a ty::ctxt<'tcx>,

View File

@ -19,8 +19,8 @@ use util::nodemap::NodeSet;
use std::collections::HashSet;
use syntax::{ast, ast_map, codemap};
use syntax::ast_util::{local_def, is_local, PostExpansionMethod};
use syntax::attr::{mod, AttrMetaMethods};
use syntax::visit::{mod, Visitor};
use syntax::attr::{self, AttrMetaMethods};
use syntax::visit::{self, Visitor};
// Any local node that may call something in its body block should be
// explored. For example, if it's a live NodeItem that is a

View File

@ -20,7 +20,7 @@ use syntax::ast_util::local_def;
use std::cell::RefCell;
#[deriving(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
pub enum Def {
DefFn(ast::DefId, bool /* is_ctor */),
DefStaticMethod(/* method */ ast::DefId, MethodProvenance),
@ -68,19 +68,19 @@ pub type DefMap = RefCell<NodeMap<Def>>;
// within.
pub type ExportMap = NodeMap<Vec<Export>>;
#[deriving(Copy)]
#[derive(Copy)]
pub struct Export {
pub name: ast::Name, // The name of the target.
pub def_id: ast::DefId, // The definition of the target.
}
#[deriving(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
pub enum MethodProvenance {
FromTrait(ast::DefId),
FromImpl(ast::DefId),
}
#[deriving(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
pub enum TyParamProvenance {
FromSelf(ast::DefId),
FromParam(ast::DefId),
@ -106,7 +106,7 @@ impl TyParamProvenance {
}
}
#[deriving(Clone, Copy, Eq, PartialEq)]
#[derive(Clone, Copy, Eq, PartialEq)]
pub enum TraitItemKind {
NonstaticMethodTraitItemKind,
StaticMethodTraitItemKind,

View File

@ -13,7 +13,7 @@
use self::UnsafeContext::*;
use middle::def;
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use middle::ty::MethodCall;
use util::ppaux;
@ -23,7 +23,7 @@ use syntax::codemap::Span;
use syntax::visit;
use syntax::visit::Visitor;
#[deriving(Copy, PartialEq)]
#[derive(Copy, PartialEq)]
enum UnsafeContext {
SafeContext,
UnsafeFn,

View File

@ -23,7 +23,7 @@ use self::OverloadedCallType::*;
use middle::{def, region, pat_util};
use middle::mem_categorization as mc;
use middle::mem_categorization::Typer;
use middle::ty::{mod};
use middle::ty::{self};
use middle::ty::{MethodCall, MethodObject, MethodTraitObject};
use middle::ty::{MethodOrigin, MethodParam, MethodTypeParam};
use middle::ty::{MethodStatic, MethodStaticUnboxedClosure};
@ -95,7 +95,7 @@ pub trait Delegate<'tcx> {
mode: MutateMode);
}
#[deriving(Copy, PartialEq, Show)]
#[derive(Copy, PartialEq, Show)]
pub enum LoanCause {
ClosureCapture(Span),
AddrOf,
@ -107,20 +107,20 @@ pub enum LoanCause {
MatchDiscriminant
}
#[deriving(Copy, PartialEq, Show)]
#[derive(Copy, PartialEq, Show)]
pub enum ConsumeMode {
Copy, // reference to x where x has a type that copies
Move(MoveReason), // reference to x where x has a type that moves
}
#[deriving(Copy, PartialEq, Show)]
#[derive(Copy, PartialEq, Show)]
pub enum MoveReason {
DirectRefMove,
PatBindingMove,
CaptureMove,
}
#[deriving(Copy, PartialEq, Show)]
#[derive(Copy, PartialEq, Show)]
pub enum MatchMode {
NonBindingMatch,
BorrowingMatch,
@ -128,7 +128,7 @@ pub enum MatchMode {
MovingMatch,
}
#[deriving(PartialEq,Show)]
#[derive(PartialEq,Show)]
enum TrackMatchMode<T> {
Unknown,
Definite(MatchMode),
@ -197,14 +197,14 @@ impl<T> TrackMatchMode<T> {
}
}
#[deriving(Copy, PartialEq, Show)]
#[derive(Copy, PartialEq, Show)]
pub enum MutateMode {
Init,
JustWrite, // x = y
WriteAndRead, // x += y
}
#[deriving(Copy)]
#[derive(Copy)]
enum OverloadedCallType {
FnOverloadedCall,
FnMutOverloadedCall,

View File

@ -8,13 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use syntax::ast;
use self::SimplifiedType::*;
/// See `simplify_type
#[deriving(Clone, Copy, PartialEq, Eq, Hash)]
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
pub enum SimplifiedType {
BoolSimplifiedType,
CharSimplifiedType,

View File

@ -61,18 +61,18 @@ impl<E: Show> Show for Edge<E> {
}
}
#[deriving(Clone, Copy, PartialEq, Show)]
#[derive(Clone, Copy, PartialEq, Show)]
pub struct NodeIndex(pub uint);
#[allow(non_upper_case_globals)]
pub const InvalidNodeIndex: NodeIndex = NodeIndex(uint::MAX);
#[deriving(Copy, PartialEq, Show)]
#[derive(Copy, PartialEq, Show)]
pub struct EdgeIndex(pub uint);
#[allow(non_upper_case_globals)]
pub const InvalidEdgeIndex: EdgeIndex = EdgeIndex(uint::MAX);
// Use a private field here to guarantee no more instances are created:
#[deriving(Copy, Show)]
#[derive(Copy, Show)]
pub struct Direction { repr: uint }
#[allow(non_upper_case_globals)]
pub const Outgoing: Direction = Direction { repr: 0 };

View File

@ -67,7 +67,7 @@ use super::sub::Sub;
use middle::subst;
use middle::ty::{AutoPtr, AutoDerefRef, AdjustDerefRef, AutoUnsize, AutoUnsafe};
use middle::ty::{mt};
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use util::ppaux;
use util::ppaux::Repr;

View File

@ -46,7 +46,7 @@ use middle::subst::{ErasedRegions, NonerasedRegions, Substs};
use middle::ty::{FloatVar, FnSig, IntVar, TyVar};
use middle::ty::{IntType, UintType};
use middle::ty::{BuiltinBounds};
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use middle::ty_fold;
use middle::ty_fold::{TypeFoldable};
use util::ppaux::Repr;
@ -447,7 +447,7 @@ impl<'tcx> Combineable<'tcx> for ty::FnSig<'tcx> {
}
}
#[deriving(Clone)]
#[derive(Clone)]
pub struct CombineFields<'a, 'tcx: 'a> {
pub infcx: &'a InferCtxt<'a, 'tcx>,
pub a_is_expected: bool,

View File

@ -9,7 +9,7 @@
// except according to those terms.
use middle::ty::{BuiltinBounds};
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use middle::ty::TyVar;
use middle::infer::combine::*;
use middle::infer::{cres};

View File

@ -74,7 +74,7 @@ use std::collections::HashSet;
use middle::def;
use middle::infer;
use middle::subst;
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use middle::ty::{Region, ReFree};
use std::cell::{Cell, RefCell};
use std::char::from_u32;

View File

@ -30,11 +30,11 @@
//! variable only once, and it does so as soon as it can, so it is reasonable to ask what the type
//! inferencer knows "so far".
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use middle::ty_fold;
use middle::ty_fold::TypeFoldable;
use middle::ty_fold::TypeFolder;
use std::collections::hash_map::{mod, Entry};
use std::collections::hash_map::{self, Entry};
use super::InferCtxt;
use super::unify::InferCtxtMethodsForSimplyUnifiableTypes;

View File

@ -18,7 +18,7 @@ use super::{cres, InferCtxt};
use super::{TypeTrace, Subtype};
use middle::ty::{BuiltinBounds};
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use syntax::ast::{Many, Once, MutImmutable, MutMutable};
use syntax::ast::{Onceness, Unsafety};
use util::ppaux::mt_to_string;

View File

@ -14,8 +14,8 @@
use super::{CombinedSnapshot, cres, InferCtxt, HigherRankedType, SkolemizationMap};
use super::combine::{Combine, Combineable};
use middle::ty::{mod, Binder};
use middle::ty_fold::{mod, TypeFoldable};
use middle::ty::{self, Binder};
use middle::ty_fold::{self, TypeFoldable};
use syntax::codemap::Span;
use util::nodemap::{FnvHashMap, FnvHashSet};
use util::ppaux::Repr;

View File

@ -35,7 +35,7 @@ use super::glb::Glb;
use super::lub::Lub;
use middle::ty::{TyVar};
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use util::ppaux::Repr;
pub trait LatticeDir<'tcx> {

View File

@ -18,7 +18,7 @@ use super::{cres, InferCtxt};
use super::{TypeTrace, Subtype};
use middle::ty::{BuiltinBounds};
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use syntax::ast::{Many, Once};
use syntax::ast::{Onceness, Unsafety};
use syntax::ast::{MutMutable, MutImmutable};

View File

@ -25,7 +25,7 @@ use middle::subst;
use middle::subst::Substs;
use middle::ty::{TyVid, IntVid, FloatVid, RegionVid, UnconstrainedNumeric};
use middle::ty::replace_late_bound_regions;
use middle::ty::{mod, Ty};
use middle::ty::{self, Ty};
use middle::ty_fold::{TypeFolder, TypeFoldable};
use std::cell::{RefCell};
use std::rc::Rc;
@ -97,7 +97,7 @@ pub type SkolemizationMap = FnvHashMap<ty::BoundRegion,ty::Region>;
/// Why did we require that the two types be related?
///
/// See `error_reporting.rs` for more details
#[deriving(Clone, Copy, Show)]
#[derive(Clone, Copy, Show)]
pub enum TypeOrigin {
// Not yet categorized in a better way
Misc(Span),
@ -135,7 +135,7 @@ pub enum TypeOrigin {
}
/// See `error_reporting.rs` for more details
#[deriving(Clone, Show)]
#[derive(Clone, Show)]
pub enum ValuePairs<'tcx> {
Types(ty::expected_found<Ty<'tcx>>),
TraitRefs(ty::expected_found<Rc<ty::TraitRef<'tcx>>>),
@ -146,7 +146,7 @@ pub enum ValuePairs<'tcx> {
/// encounter an error or subtyping constraint.
///
/// See `error_reporting.rs` for more details.
#[deriving(Clone, Show)]
#[derive(Clone, Show)]
pub struct TypeTrace<'tcx> {
origin: TypeOrigin,
values: ValuePairs<'tcx>,
@ -155,7 +155,7 @@ pub struct TypeTrace<'tcx> {
/// The origin of a `r1 <= r2` constraint.
///
/// See `error_reporting.rs` for more details
#[deriving(Clone, Show)]
#[derive(Clone, Show)]
pub enum SubregionOrigin<'tcx> {
// Arose from a subtyping relation
Subtype(TypeTrace<'tcx>),
@ -224,7 +224,7 @@ pub enum SubregionOrigin<'tcx> {
}
/// Times when we replace late-bound regions with variables:
#[deriving(Clone, Copy, Show)]
#[derive(Clone, Copy, Show)]
pub enum LateBoundRegionConversionTime {
/// when a fn is called
FnCall,
@ -239,7 +239,7 @@ pub enum LateBoundRegionConversionTime {
/// Reasons to create a region inference variable
///
/// See `error_reporting.rs` for more details
#[deriving(Clone, Show)]
#[derive(Clone, Show)]
pub enum RegionVariableOrigin<'tcx> {
// Region variables created for ill-categorized reasons,
// mostly indicates places in need of refactoring
@ -272,7 +272,7 @@ pub enum RegionVariableOrigin<'tcx> {
BoundRegionInCoherence(ast::Name),
}
#[deriving(Copy, Show)]
#[derive(Copy, Show)]
pub enum fixup_err {
unresolved_int_ty(IntVid),
unresolved_float_ty(FloatVid),

View File

@ -27,7 +27,7 @@ use util::nodemap::{FnvHashMap, FnvHashSet};
use util::ppaux::Repr;
use std::collections::hash_map::Entry::Vacant;
use std::io::{mod, File};
use std::io::{self, File};
use std::os;
use std::sync::atomic;
use syntax::ast;
@ -121,7 +121,7 @@ struct ConstraintGraph<'a, 'tcx: 'a> {
node_ids: FnvHashMap<Node, uint>,
}
#[deriving(Clone, Hash, PartialEq, Eq, Show)]
#[derive(Clone, Hash, PartialEq, Eq, Show)]
enum Node {
RegionVid(ty::RegionVid),
Region(ty::Region),

View File

@ -33,7 +33,7 @@ use util::nodemap::{FnvHashMap, FnvHashSet};
use util::ppaux::Repr;
use std::cell::{Cell, RefCell};
use std::cmp::Ordering::{mod, Less, Greater, Equal};
use std::cmp::Ordering::{self, Less, Greater, Equal};
use std::iter::repeat;
use std::u32;
use syntax::ast;
@ -42,7 +42,7 @@ mod doc;
mod graphviz;
// A constraint that influences the inference process.
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
pub enum Constraint {
// One region variable is subregion of another
ConstrainVarSubVar(RegionVid, RegionVid),
@ -69,13 +69,13 @@ pub enum Verify<'tcx> {
VerifyParamBound(ty::ParamTy, SubregionOrigin<'tcx>, Region, Vec<Region>),
}
#[deriving(Copy, PartialEq, Eq, Hash)]
#[derive(Copy, PartialEq, Eq, Hash)]
pub struct TwoRegions {
a: Region,
b: Region,
}
#[deriving(Copy, PartialEq)]
#[derive(Copy, PartialEq)]
pub enum UndoLogEntry {
OpenSnapshot,
CommitedSnapshot,
@ -86,12 +86,12 @@ pub enum UndoLogEntry {
AddCombination(CombineMapType, TwoRegions)
}
#[deriving(Copy, PartialEq)]
#[derive(Copy, PartialEq)]
pub enum CombineMapType {
Lub, Glb
}
#[deriving(Clone, Show)]
#[derive(Clone, Show)]
pub enum RegionResolutionError<'tcx> {
/// `ConcreteFailure(o, a, b)`:
///
@ -143,7 +143,7 @@ pub enum RegionResolutionError<'tcx> {
/// ```
/// would report an error because we expect 'a and 'b to match, and so we group
/// 'a and 'b together inside a SameRegions struct
#[deriving(Clone, Show)]
#[derive(Clone, Show)]
pub struct SameRegions {
pub scope_id: ast::NodeId,
pub regions: Vec<BoundRegion>
@ -217,7 +217,7 @@ pub struct RegionVarBindings<'a, 'tcx: 'a> {
values: RefCell<Option<Vec<VarValue>>>,
}
#[deriving(Show)]
#[derive(Show)]
#[allow(missing_copy_implementations)]
pub struct RegionSnapshot {
length: uint,
@ -937,10 +937,10 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> {
// ______________________________________________________________________
#[deriving(Copy, PartialEq, Show)]
#[derive(Copy, PartialEq, Show)]
enum Classification { Expanding, Contracting }
#[deriving(Copy)]
#[derive(Copy)]
pub enum VarValue { NoValue, Value(Region), ErrorValue }
struct VarData {

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