sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rs

This commit is contained in:
Jorge Aparicio 2015-01-03 22:54:18 -05:00
parent 8c5bb80d9b
commit 351409a622
231 changed files with 1115 additions and 1115 deletions

View File

@ -13,7 +13,7 @@ use std::fmt;
use std::str::FromStr; use std::str::FromStr;
use regex::Regex; use regex::Regex;
#[deriving(Clone, PartialEq)] #[derive(Clone, PartialEq)]
pub enum Mode { pub enum Mode {
CompileFail, CompileFail,
RunFail, RunFail,
@ -59,7 +59,7 @@ impl fmt::Show for Mode {
} }
} }
#[deriving(Clone)] #[derive(Clone)]
pub struct Config { pub struct Config {
// The library paths required for running the compiler // The library paths required for running the compiler
pub compile_lib_path: String, pub compile_lib_path: String,

View File

@ -30,7 +30,7 @@ pub struct ExpectedError {
pub static EXPECTED_PATTERN : &'static str = pub static EXPECTED_PATTERN : &'static str =
r"//~(?P<follow>\|)?(?P<adjusts>\^*)\s*(?P<kind>\S*)\s*(?P<msg>.*)"; 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) } enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) }
// Load any test directives embedded in the file // Load any test directives embedded in the file

View File

@ -800,6 +800,6 @@ mod tests {
} }
// Make sure deriving works with Arc<T> // 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> } struct Foo { inner: Arc<int> }
} }

View File

@ -46,7 +46,7 @@ use std::rt::heap::{allocate, deallocate};
// The way arena uses arrays is really deeply awful. The arrays are // The way arena uses arrays is really deeply awful. The arrays are
// allocated, and have capacities reserved, but the fill for the array // allocated, and have capacities reserved, but the fill for the array
// will always stay at 0. // will always stay at 0.
#[deriving(Clone, PartialEq)] #[derive(Clone, PartialEq)]
struct Chunk { struct Chunk {
data: Rc<RefCell<Vec<u8>>>, data: Rc<RefCell<Vec<u8>>>,
fill: Cell<uint>, fill: Cell<uint>,

View File

@ -30,7 +30,7 @@
//! use std::collections::BinaryHeap; //! use std::collections::BinaryHeap;
//! use std::uint; //! use std::uint;
//! //!
//! #[deriving(Copy, Eq, PartialEq)] //! #[derive(Copy, Eq, PartialEq)]
//! struct State { //! struct State {
//! cost: uint, //! cost: uint,
//! position: uint, //! position: uint,
@ -162,7 +162,7 @@ use vec::{self, Vec};
/// A priority queue implemented with a binary heap. /// A priority queue implemented with a binary heap.
/// ///
/// This will be a max-heap. /// This will be a max-heap.
#[deriving(Clone)] #[derive(Clone)]
#[stable] #[stable]
pub struct BinaryHeap<T> { pub struct BinaryHeap<T> {
data: Vec<T>, data: Vec<T>,
@ -565,7 +565,7 @@ pub struct Iter <'a, T: 'a> {
iter: slice::Iter<'a, T>, 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> { impl<'a, T> Clone for Iter<'a, T> {
fn clone(&self) -> Iter<'a, T> { fn clone(&self) -> Iter<'a, T> {
Iter { iter: self.iter.clone() } Iter { iter: self.iter.clone() }

View File

@ -1040,7 +1040,7 @@ impl cmp::Eq for Bitv {}
/// An iterator for `Bitv`. /// An iterator for `Bitv`.
#[stable] #[stable]
#[deriving(Clone)] #[derive(Clone)]
pub struct Iter<'a> { pub struct Iter<'a> {
bitv: &'a Bitv, bitv: &'a Bitv,
next_idx: uint, next_idx: uint,
@ -1139,7 +1139,7 @@ impl<'a> RandomAccessIterator for Iter<'a> {
/// let bv: Bitv = s.into_bitv(); /// let bv: Bitv = s.into_bitv();
/// assert!(bv[3]); /// assert!(bv[3]);
/// ``` /// ```
#[deriving(Clone)] #[derive(Clone)]
#[stable] #[stable]
pub struct BitvSet { pub struct BitvSet {
bitv: Bitv, bitv: Bitv,
@ -1784,7 +1784,7 @@ impl<S: hash::Writer> hash::Hash<S> for BitvSet {
} }
/// An iterator for `BitvSet`. /// An iterator for `BitvSet`.
#[deriving(Clone)] #[derive(Clone)]
#[stable] #[stable]
pub struct SetIter<'a> { pub struct SetIter<'a> {
set: &'a BitvSet, set: &'a BitvSet,
@ -1792,7 +1792,7 @@ pub struct SetIter<'a> {
} }
/// An iterator combining two `BitvSet` iterators. /// An iterator combining two `BitvSet` iterators.
#[deriving(Clone)] #[derive(Clone)]
struct TwoBitPositions<'a> { struct TwoBitPositions<'a> {
set: &'a BitvSet, set: &'a BitvSet,
other: &'a BitvSet, other: &'a BitvSet,

View File

@ -81,7 +81,7 @@ use super::node::{self, Node, Found, GoDown};
/// force this degenerate behaviour to occur on every operation. While the total amount of work /// 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), /// 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. /// it is certainly much slower when it does.
#[deriving(Clone)] #[derive(Clone)]
#[stable] #[stable]
pub struct BTreeMap<K, V> { pub struct BTreeMap<K, V> {
root: Node<K, V>, root: Node<K, V>,

View File

@ -496,7 +496,7 @@ impl<K: Clone, V: Clone> Clone for Node<K, V> {
/// println!("Uninitialized memory: {}", handle.into_kv()); /// println!("Uninitialized memory: {}", handle.into_kv());
/// } /// }
/// ``` /// ```
#[deriving(Copy)] #[derive(Copy)]
pub struct Handle<NodeRef, Type, NodeType> { pub struct Handle<NodeRef, Type, NodeType> {
node: NodeRef, node: NodeRef,
index: uint index: uint

View File

@ -30,7 +30,7 @@ use btree_map::{BTreeMap, Keys};
/// ///
/// See BTreeMap's documentation for a detailed discussion of this collection's performance /// See BTreeMap's documentation for a detailed discussion of this collection's performance
/// benefits and drawbacks. /// benefits and drawbacks.
#[deriving(Clone, Hash, PartialEq, Eq, Ord, PartialOrd)] #[derive(Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]
#[stable] #[stable]
pub struct BTreeSet<T>{ pub struct BTreeSet<T>{
map: BTreeMap<T, ()>, map: BTreeMap<T, ()>,

View File

@ -84,7 +84,7 @@ pub struct IterMut<'a, T:'a> {
} }
/// An iterator over mutable references to the items of a `DList`. /// An iterator over mutable references to the items of a `DList`.
#[deriving(Clone)] #[derive(Clone)]
#[stable] #[stable]
pub struct IntoIter<T> { pub struct IntoIter<T> {
list: DList<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) // 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. /// A specialized set implementation to use enum types.
pub struct EnumSet<E> { pub struct EnumSet<E> {
// We must maintain the invariant that no bits are set // We must maintain the invariant that no bits are set
@ -223,7 +223,7 @@ pub struct Iter<E> {
bits: uint, bits: uint,
} }
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` // FIXME(#19839) Remove in favor of `#[derive(Clone)]`
impl<E> Clone for Iter<E> { impl<E> Clone for Iter<E> {
fn clone(&self) -> Iter<E> { fn clone(&self) -> Iter<E> {
Iter { Iter {
@ -287,7 +287,7 @@ mod test {
use super::{EnumSet, CLike}; use super::{EnumSet, CLike};
#[deriving(Copy, PartialEq, Show)] #[derive(Copy, PartialEq, Show)]
#[repr(uint)] #[repr(uint)]
enum Foo { enum Foo {
A, B, C A, B, C
@ -491,7 +491,7 @@ mod test {
#[should_fail] #[should_fail]
fn test_overflow() { fn test_overflow() {
#[allow(dead_code)] #[allow(dead_code)]
#[deriving(Copy)] #[derive(Copy)]
#[repr(uint)] #[repr(uint)]
enum Bar { enum Bar {
V00, V01, V02, V03, V04, V05, V06, V07, V08, V09, V00, V01, V02, V03, V04, V05, V06, V07, V08, V09,

View File

@ -1139,7 +1139,7 @@ pub struct Iter<'a, T:'a> {
head: uint 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> { impl<'a, T> Clone for Iter<'a, T> {
fn clone(&self) -> Iter<'a, T> { fn clone(&self) -> Iter<'a, T> {
Iter { Iter {
@ -1674,21 +1674,21 @@ mod tests {
}) })
} }
#[deriving(Clone, PartialEq, Show)] #[derive(Clone, PartialEq, Show)]
enum Taggy { enum Taggy {
One(int), One(int),
Two(int, int), Two(int, int),
Three(int, int, int), Three(int, int, int),
} }
#[deriving(Clone, PartialEq, Show)] #[derive(Clone, PartialEq, Show)]
enum Taggypar<T> { enum Taggypar<T> {
Onepar(int), Onepar(int),
Twopar(int, int), Twopar(int, int),
Threepar(int, int, int), Threepar(int, int, int),
} }
#[deriving(Clone, PartialEq, Show)] #[derive(Clone, PartialEq, Show)]
struct RecCy { struct RecCy {
x: int, x: int,
y: int, y: int,

View File

@ -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 /// The last generated swap is always (0, 1), and it returns the
/// sequence to its initial order. /// sequence to its initial order.
#[experimental] #[experimental]
#[deriving(Clone)] #[derive(Clone)]
pub struct ElementSwaps { pub struct ElementSwaps {
sdir: Vec<SizeDirection>, sdir: Vec<SizeDirection>,
/// If `true`, emit the last swap that returns the sequence to initial /// 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 // Iterators
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#[deriving(Copy, Clone)] #[derive(Copy, Clone)]
enum Direction { Pos, Neg } enum Direction { Pos, Neg }
/// An `Index` and `Direction` together. /// An `Index` and `Direction` together.
#[deriving(Copy, Clone)] #[derive(Copy, Clone)]
struct SizeDirection { struct SizeDirection {
size: uint, size: uint,
dir: Direction, dir: Direction,
@ -2709,7 +2709,7 @@ mod tests {
assert!(values == [2, 3, 5, 6, 7]); assert!(values == [2, 3, 5, 6, 7]);
} }
#[deriving(Clone, PartialEq)] #[derive(Clone, PartialEq)]
struct Foo; struct Foo;
#[test] #[test]

View File

@ -165,7 +165,7 @@ fn canonical_sort(comb: &mut [(char, u8)]) {
} }
} }
#[deriving(Clone)] #[derive(Clone)]
enum DecompositionType { enum DecompositionType {
Canonical, Canonical,
Compatible Compatible
@ -173,7 +173,7 @@ enum DecompositionType {
/// External iterator for a string's decomposition's characters. /// External iterator for a string's decomposition's characters.
/// Use with the `std::iter` module. /// Use with the `std::iter` module.
#[deriving(Clone)] #[derive(Clone)]
pub struct Decompositions<'a> { pub struct Decompositions<'a> {
kind: DecompositionType, kind: DecompositionType,
iter: Chars<'a>, iter: Chars<'a>,
@ -252,7 +252,7 @@ impl<'a> Iterator for Decompositions<'a> {
} }
} }
#[deriving(Clone)] #[derive(Clone)]
enum RecompositionState { enum RecompositionState {
Composing, Composing,
Purging, Purging,
@ -261,7 +261,7 @@ enum RecompositionState {
/// External iterator for a string's recomposition's characters. /// External iterator for a string's recomposition's characters.
/// Use with the `std::iter` module. /// Use with the `std::iter` module.
#[deriving(Clone)] #[derive(Clone)]
pub struct Recompositions<'a> { pub struct Recompositions<'a> {
iter: Decompositions<'a>, iter: Decompositions<'a>,
state: RecompositionState, state: RecompositionState,
@ -356,7 +356,7 @@ impl<'a> Iterator for Recompositions<'a> {
/// External iterator for a string's UTF16 codeunits. /// External iterator for a string's UTF16 codeunits.
/// Use with the `std::iter` module. /// Use with the `std::iter` module.
#[deriving(Clone)] #[derive(Clone)]
pub struct Utf16Units<'a> { pub struct Utf16Units<'a> {
encoder: Utf16Encoder<Chars<'a>> encoder: Utf16Encoder<Chars<'a>>
} }

View File

@ -33,7 +33,7 @@ use str::{self, CharRange, FromStr, Utf8Error};
use vec::{DerefVec, Vec, as_vec}; use vec::{DerefVec, Vec, as_vec};
/// A growable string stored as a UTF-8 encoded buffer. /// A growable string stored as a UTF-8 encoded buffer.
#[deriving(Clone, PartialOrd, Eq, Ord)] #[derive(Clone, PartialOrd, Eq, Ord)]
#[stable] #[stable]
pub struct String { pub struct String {
vec: Vec<u8>, vec: Vec<u8>,

View File

@ -795,7 +795,7 @@ impl<T> Vec<T> {
/// let w = v.map_in_place(|i| i + 3); /// let w = v.map_in_place(|i| i + 3);
/// assert_eq!(w.as_slice(), [3, 4, 5].as_slice()); /// assert_eq!(w.as_slice(), [3, 4, 5].as_slice());
/// ///
/// #[deriving(PartialEq, Show)] /// #[derive(PartialEq, Show)]
/// struct Newtype(u8); /// struct Newtype(u8);
/// let bytes = vec![0x11, 0x22]; /// let bytes = vec![0x11, 0x22];
/// let newtyped_bytes = bytes.map_in_place(|x| Newtype(x)); /// let newtyped_bytes = bytes.map_in_place(|x| Newtype(x));
@ -2276,7 +2276,7 @@ mod tests {
#[test] #[test]
fn test_map_in_place_zero_sized() { fn test_map_in_place_zero_sized() {
let v = vec![(), ()]; let v = vec![(), ()];
#[deriving(PartialEq, Show)] #[derive(PartialEq, Show)]
struct ZeroSized; struct ZeroSized;
assert_eq!(v.map_in_place(|_| ZeroSized), [ZeroSized, ZeroSized]); assert_eq!(v.map_in_place(|_| ZeroSized), [ZeroSized, ZeroSized]);
} }
@ -2286,11 +2286,11 @@ mod tests {
use std::sync::atomic; use std::sync::atomic;
use std::sync::atomic::AtomicUint; use std::sync::atomic::AtomicUint;
#[deriving(Clone, PartialEq, Show)] #[derive(Clone, PartialEq, Show)]
struct Nothing; struct Nothing;
impl Drop for Nothing { fn drop(&mut self) { } } impl Drop for Nothing { fn drop(&mut self) { } }
#[deriving(Clone, PartialEq, Show)] #[derive(Clone, PartialEq, Show)]
struct ZeroSized; struct ZeroSized;
impl Drop for ZeroSized { impl Drop for ZeroSized {
fn drop(&mut self) { fn drop(&mut self) {

View File

@ -673,7 +673,7 @@ pub struct Iter<'a, V:'a> {
iter: slice::Iter<'a, Option<V>> 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> { impl<'a, V> Clone for Iter<'a, V> {
fn clone(&self) -> Iter<'a, V> { fn clone(&self) -> Iter<'a, V> {
Iter { 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> 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> { impl<'a, V> Clone for Keys<'a, V> {
fn clone(&self) -> Keys<'a, V> { fn clone(&self) -> Keys<'a, V> {
Keys { 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> 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> { impl<'a, V> Clone for Values<'a, V> {
fn clone(&self) -> Values<'a, V> { fn clone(&self) -> Values<'a, V> {
Values { Values {

View File

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

View File

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

View File

@ -104,7 +104,7 @@ pub trait Eq for Sized?: PartialEq<Self> {
} }
/// An ordering is, e.g, a result of a comparison between two values. /// An ordering is, e.g, a result of a comparison between two values.
#[deriving(Clone, Copy, PartialEq, Show)] #[derive(Clone, Copy, PartialEq, Show)]
#[stable] #[stable]
pub enum Ordering { pub enum Ordering {
/// An ordering where a compared value is less [than another]. /// An ordering where a compared value is less [than another].

View File

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

View File

@ -44,7 +44,7 @@ pub type Result = result::Result<(), Error>;
/// occurred. Any extra information must be arranged to be transmitted through /// occurred. Any extra information must be arranged to be transmitted through
/// some other means. /// some other means.
#[experimental = "core and I/O reconciliation may alter this definition"] #[experimental = "core and I/O reconciliation may alter this definition"]
#[deriving(Copy)] #[derive(Copy)]
pub struct Error; pub struct Error;
/// A collection of methods that are required to format a message into a stream. /// 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 /// 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. /// types, and then this struct is used to canonicalize arguments to one type.
#[experimental = "implementation detail of the `format_args!` macro"] #[experimental = "implementation detail of the `format_args!` macro"]
#[deriving(Copy)] #[derive(Copy)]
pub struct Argument<'a> { pub struct Argument<'a> {
value: &'a Void, value: &'a Void,
formatter: fn(&Void, &mut Formatter) -> Result, 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` /// macro validates the format string at compile-time so usage of the `write`
/// and `format` functions can be safely performed. /// and `format` functions can be safely performed.
#[stable] #[stable]
#[deriving(Copy)] #[derive(Copy)]
pub struct Arguments<'a> { pub struct Arguments<'a> {
// Format string pieces to print. // Format string pieces to print.
pieces: &'a [&'a str], pieces: &'a [&'a str],

View File

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

View File

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

View File

@ -11,7 +11,7 @@
//! Generic hashing support. //! Generic hashing support.
//! //!
//! This module provides a generic way to compute the hash of a value. The //! 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 //! # Examples
//! //!
@ -19,7 +19,7 @@
//! use std::hash; //! use std::hash;
//! use std::hash::Hash; //! use std::hash::Hash;
//! //!
//! #[deriving(Hash)] //! #[derive(Hash)]
//! struct Person { //! struct Person {
//! id: uint, //! id: uint,
//! name: String, //! name: String,

View File

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

View File

@ -45,7 +45,7 @@
pub type GlueFn = extern "Rust" fn(*const i8); pub type GlueFn = extern "Rust" fn(*const i8);
#[lang="ty_desc"] #[lang="ty_desc"]
#[deriving(Copy)] #[derive(Copy)]
pub struct TyDesc { pub struct TyDesc {
// sizeof(T) // sizeof(T)
pub size: uint, pub size: uint,
@ -545,7 +545,7 @@ extern "rust-intrinsic" {
/// `TypeId` represents a globally unique identifier for a type /// `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 #[lang="type_id"] // This needs to be kept in lockstep with the code in trans/intrinsic.rs and
// middle/lang_items.rs // middle/lang_items.rs
#[deriving(Clone, Copy, PartialEq, Eq, Show)] #[derive(Clone, Copy, PartialEq, Eq, Show)]
pub struct TypeId { pub struct TypeId {
t: u64, 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 {} impl<A, B> ExactSizeIterator for Zip<A, B> where A: ExactSizeIterator, B: ExactSizeIterator {}
/// An double-ended iterator with the direction inverted /// An double-ended iterator with the direction inverted
#[deriving(Clone)] #[derive(Clone)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable] #[stable]
pub struct Rev<T> { 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. /// `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"] #[unstable = "waiting on namespaced enum conventions"]
pub enum MinMaxResult<T> { pub enum MinMaxResult<T> {
/// Empty iterator /// Empty iterator
@ -1280,7 +1280,7 @@ impl<I> CloneIteratorExt for I where I: Iterator + Clone {
} }
/// An iterator that repeats endlessly /// An iterator that repeats endlessly
#[deriving(Clone, Copy)] #[derive(Clone, Copy)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable] #[stable]
pub struct Cycle<I> { pub struct Cycle<I> {
@ -1338,7 +1338,7 @@ impl<I> RandomAccessIterator for Cycle<I> where
} }
/// An iterator that strings two iterators together /// An iterator that strings two iterators together
#[deriving(Clone)] #[derive(Clone)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable] #[stable]
pub struct Chain<A, B> { 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 /// An iterator that iterates two other iterators simultaneously
#[deriving(Clone)] #[derive(Clone)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable] #[stable]
pub struct Zip<A, B> { pub struct Zip<A, B> {
@ -1517,7 +1517,7 @@ pub struct Map<A, B, I: Iterator<Item=A>, F: FnMut(A) -> B> {
f: F, f: F,
} }
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` // FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable] #[stable]
impl<A, B, I, F> Clone for Map<A, B, I, F> where impl<A, B, I, F> Clone for Map<A, B, I, F> where
I: Clone + Iterator<Item=A>, 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, predicate: P,
} }
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` // FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable] #[stable]
impl<A, I, P> Clone for Filter<A, I, P> where impl<A, I, P> Clone for Filter<A, I, P> where
I: Clone + Iterator<Item=A>, 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, f: F,
} }
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` // FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable] #[stable]
impl<A, B, I, F> Clone for FilterMap<A, B, I, F> where impl<A, B, I, F> Clone for FilterMap<A, B, I, F> where
I: Clone + Iterator<Item=A>, 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 /// 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"] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable] #[stable]
pub struct Enumerate<I> { 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. /// 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"] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable] #[stable]
#[deriving(Copy)] #[derive(Copy)]
pub struct Peekable<T, I> where I: Iterator<Item=T> { pub struct Peekable<T, I> where I: Iterator<Item=T> {
iter: I, iter: I,
peeked: Option<T>, peeked: Option<T>,
@ -1837,7 +1837,7 @@ pub struct SkipWhile<A, I, P> where I: Iterator<Item=A>, P: FnMut(&A) -> bool {
predicate: P, predicate: P,
} }
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` // FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable] #[stable]
impl<A, I, P> Clone for SkipWhile<A, I, P> where impl<A, I, P> Clone for SkipWhile<A, I, P> where
I: Clone + Iterator<Item=A>, 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, predicate: P,
} }
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` // FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable] #[stable]
impl<A, I, P> Clone for TakeWhile<A, I, P> where impl<A, I, P> Clone for TakeWhile<A, I, P> where
I: Clone + Iterator<Item=A>, 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`. /// An iterator that skips over `n` elements of `iter`.
#[deriving(Clone)] #[derive(Clone)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable] #[stable]
pub struct Skip<I> { 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`. /// 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"] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable] #[stable]
pub struct Take<I> { 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, pub state: St,
} }
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` // FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable] #[stable]
impl<A, B, I, St, F> Clone for Scan<A, B, I, St, F> where impl<A, B, I, St, F> Clone for Scan<A, B, I, St, F> where
I: Clone + Iterator<Item=A>, I: Clone + Iterator<Item=A>,
@ -2116,7 +2116,7 @@ pub struct FlatMap<A, B, I, U, F> where
backiter: Option<U>, backiter: Option<U>,
} }
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` // FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable] #[stable]
impl<A, B, I, U, F> Clone for FlatMap<A, B, I, U, F> where impl<A, B, I, U, F> Clone for FlatMap<A, B, I, U, F> where
I: Clone + Iterator<Item=A>, 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 /// An iterator that yields `None` forever after the underlying iterator
/// yields `None` once. /// yields `None` once.
#[deriving(Clone)] #[derive(Clone)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[stable] #[stable]
pub struct Fuse<I> { pub struct Fuse<I> {
@ -2281,7 +2281,7 @@ pub struct Inspect<A, I, F> where I: Iterator<Item=A>, F: FnMut(&A) {
f: F, f: F,
} }
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` // FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable] #[stable]
impl<A, I, F> Clone for Inspect<A, I, F> where impl<A, I, F> Clone for Inspect<A, I, F> where
I: Clone + Iterator<Item=A>, 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, pub state: St,
} }
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` // FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable] #[stable]
impl<A, St, F> Clone for Unfold<A, St, F> where impl<A, St, F> Clone for Unfold<A, St, F> where
F: Clone + FnMut(&mut St) -> Option<A>, 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 /// An infinite iterator starting at `start` and advancing by `step` with each
/// iteration /// iteration
#[deriving(Clone, Copy)] #[derive(Clone, Copy)]
#[unstable = "may be renamed"] #[unstable = "may be renamed"]
pub struct Counter<A> { pub struct Counter<A> {
/// The current state the counter is at (next value to be yielded) /// 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) /// An iterator over the range [start, stop)
#[deriving(Clone, Copy)] #[derive(Clone, Copy)]
#[unstable = "may be refactored due to numerics reform or ops reform"] #[unstable = "may be refactored due to numerics reform or ops reform"]
pub struct Range<A> { pub struct Range<A> {
state: A, state: A,
@ -2565,7 +2565,7 @@ impl<A: Int + ToPrimitive> DoubleEndedIterator for Range<A> {
} }
/// An iterator over the range [start, stop] /// An iterator over the range [start, stop]
#[deriving(Clone)] #[derive(Clone)]
#[unstable = "may be refactored due to numerics reform or ops reform"] #[unstable = "may be refactored due to numerics reform or ops reform"]
pub struct RangeInclusive<A> { pub struct RangeInclusive<A> {
range: Range<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. /// 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"] #[unstable = "may be refactored due to numerics reform or ops reform"]
pub struct RangeStep<A> { pub struct RangeStep<A> {
state: 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. /// 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"] #[unstable = "may be refactored due to numerics reform or ops reform"]
pub struct RangeStepInclusive<A> { pub struct RangeStepInclusive<A> {
state: A, state: A,
@ -2775,7 +2775,7 @@ step_impl_no_between!(u64 i64);
/// An iterator that repeats an element endlessly /// An iterator that repeats an element endlessly
#[deriving(Clone)] #[derive(Clone)]
#[stable] #[stable]
pub struct Repeat<A> { pub struct Repeat<A> {
element: 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 example, `S<&'static int>` is a subtype of `S<&'a int>`
/// for some lifetime `'a`, but not the other way around). /// for some lifetime `'a`, but not the other way around).
#[lang="covariant_type"] #[lang="covariant_type"]
#[deriving(PartialEq, Eq, PartialOrd, Ord)] #[derive(PartialEq, Eq, PartialOrd, Ord)]
pub struct CovariantType<Sized? T>; pub struct CovariantType<Sized? T>;
impl<Sized? T> Copy for CovariantType<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 /// function requires arguments of type `T`, it must also accept
/// arguments of type `U`, hence such a conversion is safe. /// arguments of type `U`, hence such a conversion is safe.
#[lang="contravariant_type"] #[lang="contravariant_type"]
#[deriving(PartialEq, Eq, PartialOrd, Ord)] #[derive(PartialEq, Eq, PartialOrd, Ord)]
pub struct ContravariantType<Sized? T>; pub struct ContravariantType<Sized? T>;
impl<Sized? T> Copy for ContravariantType<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 /// never written, but in fact `Cell` uses unsafe code to achieve
/// interior mutability. /// interior mutability.
#[lang="invariant_type"] #[lang="invariant_type"]
#[deriving(PartialEq, Eq, PartialOrd, Ord)] #[derive(PartialEq, Eq, PartialOrd, Ord)]
pub struct InvariantType<Sized? T>; pub struct InvariantType<Sized? T>;
impl<Sized? T> Copy for InvariantType<T> {} impl<Sized? T> Copy for InvariantType<T> {}
@ -235,7 +235,7 @@ pub mod marker {
/// For more information about variance, refer to this Wikipedia /// For more information about variance, refer to this Wikipedia
/// article <http://en.wikipedia.org/wiki/Variance_%28computer_science%29>. /// article <http://en.wikipedia.org/wiki/Variance_%28computer_science%29>.
#[lang="covariant_lifetime"] #[lang="covariant_lifetime"]
#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct CovariantLifetime<'a>; pub struct CovariantLifetime<'a>;
/// As `ContravariantType`, but for lifetime parameters. Using /// As `ContravariantType`, but for lifetime parameters. Using
@ -251,7 +251,7 @@ pub mod marker {
/// For more information about variance, refer to this Wikipedia /// For more information about variance, refer to this Wikipedia
/// article <http://en.wikipedia.org/wiki/Variance_%28computer_science%29>. /// article <http://en.wikipedia.org/wiki/Variance_%28computer_science%29>.
#[lang="contravariant_lifetime"] #[lang="contravariant_lifetime"]
#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct ContravariantLifetime<'a>; pub struct ContravariantLifetime<'a>;
/// As `InvariantType`, but for lifetime parameters. Using /// As `InvariantType`, but for lifetime parameters. Using
@ -262,7 +262,7 @@ pub mod marker {
/// and this pointer is itself stored in an inherently mutable /// and this pointer is itself stored in an inherently mutable
/// location (such as a `Cell`). /// location (such as a `Cell`).
#[lang="invariant_lifetime"] #[lang="invariant_lifetime"]
#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct InvariantLifetime<'a>; pub struct InvariantLifetime<'a>;
/// A type which is considered "not sendable", meaning that it cannot /// 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 /// typically embedded in other types, such as `Gc`, to ensure that
/// their instances remain thread-local. /// their instances remain thread-local.
#[lang="no_send_bound"] #[lang="no_send_bound"]
#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct NoSend; pub struct NoSend;
/// A type which is considered "not POD", meaning that it is not /// A type which is considered "not POD", meaning that it is not
/// implicitly copyable. This is typically embedded in other types to /// implicitly copyable. This is typically embedded in other types to
/// ensure that they are never copied, even if they lack a destructor. /// ensure that they are never copied, even if they lack a destructor.
#[lang="no_copy_bound"] #[lang="no_copy_bound"]
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)] #[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
#[allow(missing_copy_implementations)] #[allow(missing_copy_implementations)]
pub struct NoCopy; pub struct NoCopy;
@ -285,13 +285,13 @@ pub mod marker {
/// its contents are not threadsafe, hence they cannot be /// its contents are not threadsafe, hence they cannot be
/// shared between tasks. /// shared between tasks.
#[lang="no_sync_bound"] #[lang="no_sync_bound"]
#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct NoSync; pub struct NoSync;
/// A type which is considered managed by the GC. This is typically /// A type which is considered managed by the GC. This is typically
/// embedded in other types. /// embedded in other types.
#[lang="managed_bound"] #[lang="managed_bound"]
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)] #[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
#[allow(missing_copy_implementations)] #[allow(missing_copy_implementations)]
pub struct Managed; 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 /// A wrapper type for raw pointers and integers that will never be
/// NULL or 0 that might allow certain optimizations. /// NULL or 0 that might allow certain optimizations.
#[lang="non_zero"] #[lang="non_zero"]
#[deriving(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Show)] #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Show)]
#[experimental] #[experimental]
pub struct NonZero<T: Zeroable>(T); pub struct NonZero<T: Zeroable>(T);

View File

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

View File

@ -29,7 +29,7 @@
//! //!
//! use std::ops::{Add, Sub}; //! use std::ops::{Add, Sub};
//! //!
//! #[deriving(Show)] //! #[derive(Show)]
//! struct Point { //! struct Point {
//! x: int, //! x: int,
//! y: int //! y: int
@ -103,7 +103,7 @@ pub trait Drop {
/// ///
/// use std::ops::Add; /// use std::ops::Add;
/// ///
/// #[deriving(Copy)] /// #[derive(Copy)]
/// struct Foo; /// struct Foo;
/// ///
/// impl Add for 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; /// use std::ops::Sub;
/// ///
/// #[deriving(Copy)] /// #[derive(Copy)]
/// struct Foo; /// struct Foo;
/// ///
/// impl Sub for 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; /// use std::ops::Mul;
/// ///
/// #[deriving(Copy)] /// #[derive(Copy)]
/// struct Foo; /// struct Foo;
/// ///
/// impl Mul for 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; /// use std::ops::Div;
/// ///
/// #[deriving(Copy)] /// #[derive(Copy)]
/// struct Foo; /// struct Foo;
/// ///
/// impl Div for 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; /// use std::ops::Rem;
/// ///
/// #[deriving(Copy)] /// #[derive(Copy)]
/// struct Foo; /// struct Foo;
/// ///
/// impl Rem for 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; /// use std::ops::BitAnd;
/// ///
/// #[deriving(Copy)] /// #[derive(Copy)]
/// struct Foo; /// struct Foo;
/// ///
/// impl BitAnd for 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; /// use std::ops::BitOr;
/// ///
/// #[deriving(Copy)] /// #[derive(Copy)]
/// struct Foo; /// struct Foo;
/// ///
/// impl BitOr for 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; /// use std::ops::BitXor;
/// ///
/// #[deriving(Copy)] /// #[derive(Copy)]
/// struct Foo; /// struct Foo;
/// ///
/// impl BitXor for 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; /// use std::ops::Shl;
/// ///
/// #[deriving(Copy)] /// #[derive(Copy)]
/// struct Foo; /// struct Foo;
/// ///
/// impl Shl<Foo> for 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; /// use std::ops::Shr;
/// ///
/// #[deriving(Copy)] /// #[derive(Copy)]
/// struct Foo; /// struct Foo;
/// ///
/// impl Shr<Foo> for Foo { /// impl Shr<Foo> for Foo {
@ -739,7 +739,7 @@ pub trait Index<Sized? Index, Sized? Result> for Sized? {
/// ///
/// use std::ops::Index; /// use std::ops::Index;
/// ///
/// #[deriving(Copy)] /// #[derive(Copy)]
/// struct Foo; /// struct Foo;
/// ///
/// impl Index<Foo> for Foo { /// impl Index<Foo> for Foo {
@ -786,7 +786,7 @@ pub trait IndexMut<Sized? Index, Sized? Result> for Sized? {
/// ///
/// use std::ops::IndexMut; /// use std::ops::IndexMut;
/// ///
/// #[deriving(Copy)] /// #[derive(Copy)]
/// struct Foo; /// struct Foo;
/// ///
/// impl IndexMut<Foo> for Foo { /// impl IndexMut<Foo> for Foo {
@ -822,7 +822,7 @@ pub trait IndexMut<Sized? Index> for Sized? {
/// ```ignore /// ```ignore
/// use std::ops::Slice; /// use std::ops::Slice;
/// ///
/// #[deriving(Copy)] /// #[derive(Copy)]
/// struct Foo; /// struct Foo;
/// ///
/// impl Slice<Foo, Foo> for Foo { /// impl Slice<Foo, Foo> for Foo {
@ -871,7 +871,7 @@ pub trait Slice<Sized? Idx, Sized? Result> for Sized? {
/// ```ignore /// ```ignore
/// use std::ops::SliceMut; /// use std::ops::SliceMut;
/// ///
/// #[deriving(Copy)] /// #[derive(Copy)]
/// struct Foo; /// struct Foo;
/// ///
/// impl SliceMut<Foo, Foo> for Foo { /// impl SliceMut<Foo, Foo> for Foo {
@ -911,12 +911,12 @@ pub trait SliceMut<Sized? Idx, Sized? Result> for Sized? {
/// An unbounded range. /// An unbounded range.
#[deriving(Copy)] #[derive(Copy)]
#[lang="full_range"] #[lang="full_range"]
pub struct FullRange; pub struct FullRange;
/// A (half-open) range which is bounded at both ends. /// A (half-open) range which is bounded at both ends.
#[deriving(Copy)] #[derive(Copy)]
#[lang="range"] #[lang="range"]
pub struct Range<Idx> { pub struct Range<Idx> {
/// The lower bound of the range (inclusive). /// 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> {} impl<Idx: Clone + Step> ExactSizeIterator for Range<Idx> {}
/// A range which is only bounded below. /// A range which is only bounded below.
#[deriving(Copy)] #[derive(Copy)]
#[lang="range_from"] #[lang="range_from"]
pub struct RangeFrom<Idx> { pub struct RangeFrom<Idx> {
/// The lower bound of the range (inclusive). /// 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. /// A range which is only bounded above.
#[deriving(Copy)] #[derive(Copy)]
#[lang="range_to"] #[lang="range_to"]
pub struct RangeTo<Idx> { pub struct RangeTo<Idx> {
/// The upper bound of the range (exclusive). /// The upper bound of the range (exclusive).

View File

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

View File

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

View File

@ -30,7 +30,7 @@
//! defined and used like so: //! defined and used like so:
//! //!
//! ``` //! ```
//! #[deriving(Show)] //! #[derive(Show)]
//! enum Version { Version1, Version2 } //! enum Version { Version1, Version2 }
//! //!
//! fn parse_version(header: &[u8]) -> Result<Version, &'static str> { //! fn parse_version(header: &[u8]) -> Result<Version, &'static str> {
@ -243,7 +243,7 @@ use slice;
/// `Result` is a type that represents either success (`Ok`) or failure (`Err`). /// `Result` is a type that represents either success (`Ok`) or failure (`Err`).
/// ///
/// See the [`std::result`](index.html) module documentation for details. /// 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] #[must_use]
#[stable] #[stable]
pub enum Result<T, E> { pub enum Result<T, E> {

View File

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

View File

@ -907,7 +907,7 @@ pub struct Split<'a, T:'a, P> where P: FnMut(&T) -> bool {
finished: bool finished: bool
} }
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` // FIXME(#19839) Remove in favor of `#[derive(Clone)]`
#[stable] #[stable]
impl<'a, T, P> Clone for Split<'a, T, P> where P: Clone + FnMut(&T) -> bool { impl<'a, T, P> Clone for Split<'a, T, P> where P: Clone + FnMut(&T) -> bool {
fn clone(&self) -> Split<'a, T, P> { 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] } forward_iterator! { RSplitNMut: T, &'a mut [T] }
/// An iterator over overlapping subslices of length `size`. /// An iterator over overlapping subslices of length `size`.
#[deriving(Clone)] #[derive(Clone)]
#[experimental = "needs review"] #[experimental = "needs review"]
pub struct Windows<'a, T:'a> { pub struct Windows<'a, T:'a> {
v: &'a [T], 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 /// When the slice len is not evenly divided by the chunk size, the last slice
/// of the iteration will be the remainder. /// of the iteration will be the remainder.
#[deriving(Clone)] #[derive(Clone)]
#[experimental = "needs review"] #[experimental = "needs review"]
pub struct Chunks<'a, T:'a> { pub struct Chunks<'a, T:'a> {
v: &'a [T], v: &'a [T],

View File

@ -147,7 +147,7 @@ Section: Creating a string
*/ */
/// Errors which can occur when attempting to interpret a byte slice as a `str`. /// 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 { pub enum Utf8Error {
/// An invalid byte was detected at the byte offset given. /// 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 /// Iterator for the char (representing *Unicode Scalar Values*) of a string
/// ///
/// Created with the method `.chars()`. /// Created with the method `.chars()`.
#[deriving(Clone, Copy)] #[derive(Clone, Copy)]
pub struct Chars<'a> { pub struct Chars<'a> {
iter: slice::Iter<'a, u8> 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. /// External iterator for a string's characters and their byte offsets.
/// Use with the `std::iter` module. /// Use with the `std::iter` module.
#[deriving(Clone)] #[derive(Clone)]
pub struct CharIndices<'a> { pub struct CharIndices<'a> {
front_offset: uint, front_offset: uint,
iter: Chars<'a>, iter: Chars<'a>,
@ -409,13 +409,13 @@ impl<'a> DoubleEndedIterator for CharIndices<'a> {
/// ///
/// Created with `StrExt::bytes` /// Created with `StrExt::bytes`
#[stable] #[stable]
#[deriving(Clone)] #[derive(Clone)]
pub struct Bytes<'a>(Map<&'a u8, u8, slice::Iter<'a, u8>, BytesDeref>); pub struct Bytes<'a>(Map<&'a u8, u8, slice::Iter<'a, u8>, BytesDeref>);
delegate_iter!{exact u8 in Bytes<'a>} delegate_iter!{exact u8 in Bytes<'a>}
/// A temporary fn new type that ensures that the `Bytes` iterator /// A temporary fn new type that ensures that the `Bytes` iterator
/// is cloneable. /// is cloneable.
#[deriving(Copy, Clone)] #[derive(Copy, Clone)]
struct BytesDeref; struct BytesDeref;
impl<'a> Fn(&'a u8) -> u8 for 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`. /// An iterator over the substrings of a string, separated by `sep`.
#[deriving(Clone)] #[derive(Clone)]
#[deprecated = "Type is now named `Split` or `SplitTerminator`"] #[deprecated = "Type is now named `Split` or `SplitTerminator`"]
pub struct CharSplits<'a, Sep> { pub struct CharSplits<'a, Sep> {
/// The slice remaining to be iterated /// 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`, /// An iterator over the substrings of a string, separated by `sep`,
/// splitting at most `count` times. /// splitting at most `count` times.
#[deriving(Clone)] #[derive(Clone)]
#[deprecated = "Type is now named `SplitN` or `RSplitN`"] #[deprecated = "Type is now named `SplitN` or `RSplitN`"]
pub struct CharSplitsN<'a, Sep> { pub struct CharSplitsN<'a, Sep> {
iter: CharSplits<'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 /// The internal state of an iterator that searches for matches of a substring
/// within a larger string using naive search /// within a larger string using naive search
#[deriving(Clone)] #[derive(Clone)]
struct NaiveSearcher { struct NaiveSearcher {
position: uint position: uint
} }
@ -590,7 +590,7 @@ impl NaiveSearcher {
/// The internal state of an iterator that searches for matches of a substring /// The internal state of an iterator that searches for matches of a substring
/// within a larger string using two-way search /// within a larger string using two-way search
#[deriving(Clone)] #[derive(Clone)]
struct TwoWaySearcher { struct TwoWaySearcher {
// constants // constants
crit_pos: uint, crit_pos: uint,
@ -827,7 +827,7 @@ impl TwoWaySearcher {
/// The internal state of an iterator that searches for matches of a substring /// The internal state of an iterator that searches for matches of a substring
/// within a larger string using a dynamically chosen search algorithm /// within a larger string using a dynamically chosen search algorithm
#[deriving(Clone)] #[derive(Clone)]
enum Searcher { enum Searcher {
Naive(NaiveSearcher), Naive(NaiveSearcher),
TwoWay(TwoWaySearcher), TwoWay(TwoWaySearcher),
@ -855,7 +855,7 @@ impl Searcher {
/// An iterator over the start and end indices of the matches of a /// An iterator over the start and end indices of the matches of a
/// substring within a larger string /// substring within a larger string
#[deriving(Clone)] #[derive(Clone)]
pub struct MatchIndices<'a> { pub struct MatchIndices<'a> {
// constants // constants
haystack: &'a str, haystack: &'a str,
@ -865,7 +865,7 @@ pub struct MatchIndices<'a> {
/// An iterator over the substrings of a string separated by a given /// An iterator over the substrings of a string separated by a given
/// search string /// search string
#[deriving(Clone)] #[derive(Clone)]
#[unstable = "Type might get removed"] #[unstable = "Type might get removed"]
pub struct SplitStr<'a> { pub struct SplitStr<'a> {
it: MatchIndices<'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 /// 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 /// the next `char` in a string. This can be used as a data structure
/// for iterating over the UTF-8 bytes of a string. /// for iterating over the UTF-8 bytes of a string.
#[deriving(Copy)] #[derive(Copy)]
#[unstable = "naming is uncertain with container conventions"] #[unstable = "naming is uncertain with container conventions"]
pub struct CharRange { pub struct CharRange {
/// Current `char` /// Current `char`
@ -1249,25 +1249,25 @@ impl<'a, Sized? S> Str for &'a S where S: Str {
} }
/// Return type of `StrExt::split` /// Return type of `StrExt::split`
#[deriving(Clone)] #[derive(Clone)]
#[stable] #[stable]
pub struct Split<'a, P>(CharSplits<'a, P>); pub struct Split<'a, P>(CharSplits<'a, P>);
delegate_iter!{pattern &'a str in Split<'a, P>} delegate_iter!{pattern &'a str in Split<'a, P>}
/// Return type of `StrExt::split_terminator` /// Return type of `StrExt::split_terminator`
#[deriving(Clone)] #[derive(Clone)]
#[unstable = "might get removed in favour of a constructor method on Split"] #[unstable = "might get removed in favour of a constructor method on Split"]
pub struct SplitTerminator<'a, P>(CharSplits<'a, P>); pub struct SplitTerminator<'a, P>(CharSplits<'a, P>);
delegate_iter!{pattern &'a str in SplitTerminator<'a, P>} delegate_iter!{pattern &'a str in SplitTerminator<'a, P>}
/// Return type of `StrExt::splitn` /// Return type of `StrExt::splitn`
#[deriving(Clone)] #[derive(Clone)]
#[stable] #[stable]
pub struct SplitN<'a, P>(CharSplitsN<'a, P>); pub struct SplitN<'a, P>(CharSplitsN<'a, P>);
delegate_iter!{pattern forward &'a str in SplitN<'a, P>} delegate_iter!{pattern forward &'a str in SplitN<'a, P>}
/// Return type of `StrExt::rsplitn` /// Return type of `StrExt::rsplitn`
#[deriving(Clone)] #[derive(Clone)]
#[stable] #[stable]
pub struct RSplitN<'a, P>(CharSplitsN<'a, P>); pub struct RSplitN<'a, P>(CharSplitsN<'a, P>);
delegate_iter!{pattern forward &'a str in RSplitN<'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::Bencher;
use test; use test;
#[deriving(PartialEq, Show)] #[derive(PartialEq, Show)]
struct Test; struct Test;
static TEST: &'static str = "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 /// 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. /// to emit. These are emitted as a stream by the `Parser` class.
#[deriving(Copy, PartialEq)] #[derive(Copy, PartialEq)]
pub enum Piece<'a> { pub enum Piece<'a> {
/// A literal string which should directly be emitted /// A literal string which should directly be emitted
String(&'a str), String(&'a str),
@ -47,7 +47,7 @@ pub enum Piece<'a> {
} }
/// Representation of an argument specification. /// Representation of an argument specification.
#[deriving(Copy, PartialEq)] #[derive(Copy, PartialEq)]
pub struct Argument<'a> { pub struct Argument<'a> {
/// Where to find this argument /// Where to find this argument
pub position: Position<'a>, pub position: Position<'a>,
@ -56,7 +56,7 @@ pub struct Argument<'a> {
} }
/// Specification for the formatting of an argument in the format string. /// Specification for the formatting of an argument in the format string.
#[deriving(Copy, PartialEq)] #[derive(Copy, PartialEq)]
pub struct FormatSpec<'a> { pub struct FormatSpec<'a> {
/// Optionally specified character to fill alignment with /// Optionally specified character to fill alignment with
pub fill: Option<char>, pub fill: Option<char>,
@ -75,7 +75,7 @@ pub struct FormatSpec<'a> {
} }
/// Enum describing where an argument for a format can be located. /// Enum describing where an argument for a format can be located.
#[deriving(Copy, PartialEq)] #[derive(Copy, PartialEq)]
pub enum Position<'a> { pub enum Position<'a> {
/// The argument will be in the next position. This is the default. /// The argument will be in the next position. This is the default.
ArgumentNext, ArgumentNext,
@ -86,7 +86,7 @@ pub enum Position<'a> {
} }
/// Enum of alignments which are supported. /// Enum of alignments which are supported.
#[deriving(Copy, PartialEq)] #[derive(Copy, PartialEq)]
pub enum Alignment { pub enum Alignment {
/// The value will be aligned to the left. /// The value will be aligned to the left.
AlignLeft, AlignLeft,
@ -100,7 +100,7 @@ pub enum Alignment {
/// Various flags which can be applied to format strings. The meaning of these /// Various flags which can be applied to format strings. The meaning of these
/// flags is defined by the formatters themselves. /// flags is defined by the formatters themselves.
#[deriving(Copy, PartialEq)] #[derive(Copy, PartialEq)]
pub enum Flag { pub enum Flag {
/// A `+` will be used to denote positive numbers. /// A `+` will be used to denote positive numbers.
FlagSignPlus, FlagSignPlus,
@ -116,7 +116,7 @@ pub enum Flag {
/// A count is used for the precision and width parameters of an integer, and /// A count is used for the precision and width parameters of an integer, and
/// can reference either an argument or a literal integer. /// can reference either an argument or a literal integer.
#[deriving(Copy, PartialEq)] #[derive(Copy, PartialEq)]
pub enum Count<'a> { pub enum Count<'a> {
/// The count is specified explicitly. /// The count is specified explicitly.
CountIs(uint), CountIs(uint),

View File

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

View File

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

View File

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

View File

@ -232,7 +232,7 @@ struct DefaultLogger {
} }
/// Wraps the log level with fmt implementations. /// Wraps the log level with fmt implementations.
#[deriving(Copy, PartialEq, PartialOrd)] #[derive(Copy, PartialEq, PartialOrd)]
pub struct LogLevel(pub u32); pub struct LogLevel(pub u32);
impl fmt::Show for LogLevel { 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 /// A LogRecord is created by the logging macros, and passed as the only
/// argument to Loggers. /// argument to Loggers.
#[deriving(Show)] #[derive(Show)]
pub struct LogRecord<'a> { pub struct LogRecord<'a> {
/// The module path of where the LogRecord originated. /// The module path of where the LogRecord originated.
@ -339,7 +339,7 @@ pub struct LogRecord<'a> {
} }
#[doc(hidden)] #[doc(hidden)]
#[deriving(Copy)] #[derive(Copy)]
pub struct LogLocation { pub struct LogLocation {
pub module_path: &'static str, pub module_path: &'static str,
pub file: &'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 /// [1]: D. J. Bernstein, [*ChaCha, a variant of
/// Salsa20*](http://cr.yp.to/chacha.html) /// Salsa20*](http://cr.yp.to/chacha.html)
#[deriving(Copy)] #[derive(Copy)]
pub struct ChaChaRng { pub struct ChaChaRng {
buffer: [u32; STATE_WORDS], // Internal buffer of output buffer: [u32; STATE_WORDS], // Internal buffer of output
state: [u32; STATE_WORDS], // Initial state state: [u32; STATE_WORDS], // Initial state

View File

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

View File

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

View File

@ -28,7 +28,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample};
/// Generate Normal Random /// Generate Normal Random
/// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield /// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
/// College, Oxford /// College, Oxford
#[deriving(Copy)] #[derive(Copy)]
pub struct StandardNormal(pub f64); pub struct StandardNormal(pub f64);
impl Rand for StandardNormal { impl Rand for StandardNormal {
@ -84,7 +84,7 @@ impl Rand for StandardNormal {
/// let v = normal.ind_sample(&mut rand::thread_rng()); /// let v = normal.ind_sample(&mut rand::thread_rng());
/// println!("{} is from a N(2, 9) distribution", v) /// println!("{} is from a N(2, 9) distribution", v)
/// ``` /// ```
#[deriving(Copy)] #[derive(Copy)]
pub struct Normal { pub struct Normal {
mean: f64, mean: f64,
std_dev: f64, std_dev: f64,
@ -132,7 +132,7 @@ impl IndependentSample<f64> for Normal {
/// let v = log_normal.ind_sample(&mut rand::thread_rng()); /// let v = log_normal.ind_sample(&mut rand::thread_rng());
/// println!("{} is from an ln N(2, 9) distribution", v) /// println!("{} is from an ln N(2, 9) distribution", v)
/// ``` /// ```
#[deriving(Copy)] #[derive(Copy)]
pub struct LogNormal { pub struct LogNormal {
norm: Normal 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 /// [1]: Bob Jenkins, [*ISAAC: A fast cryptographic random number
/// generator*](http://www.burtleburtle.net/bob/rand/isaacafa.html) /// generator*](http://www.burtleburtle.net/bob/rand/isaacafa.html)
#[deriving(Copy)] #[derive(Copy)]
pub struct IsaacRng { pub struct IsaacRng {
cnt: u32, cnt: u32,
rsl: [u32; RAND_SIZE_UINT], 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 /// [1]: Bob Jenkins, [*ISAAC: A fast cryptographic random number
/// generator*](http://www.burtleburtle.net/bob/rand/isaacafa.html) /// generator*](http://www.burtleburtle.net/bob/rand/isaacafa.html)
#[deriving(Copy)] #[derive(Copy)]
pub struct Isaac64Rng { pub struct Isaac64Rng {
cnt: uint, cnt: uint,
rsl: [u64; RAND_SIZE_64], 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 /// Reseed an RNG using a `Default` instance. This reseeds by
/// replacing the RNG with the result of a `Default::default` call. /// replacing the RNG with the result of a `Default::default` call.
#[deriving(Copy)] #[derive(Copy)]
pub struct ReseedWithDefault; pub struct ReseedWithDefault;
impl<R: Rng + Default> Reseeder<R> for ReseedWithDefault { impl<R: Rng + Default> Reseeder<R> for ReseedWithDefault {

View File

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

View File

@ -25,7 +25,7 @@ use parse::{
type InstIdx = uint; type InstIdx = uint;
#[deriving(Show, Clone)] #[derive(Show, Clone)]
pub enum Inst { pub enum Inst {
// When a Match instruction is executed, the current thread is successful. // When a Match instruction is executed, the current thread is successful.
Match, Match,
@ -78,7 +78,7 @@ pub enum Inst {
/// All of the data in a compiled expression is wrapped in "MaybeStatic" or /// 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. /// "MaybeOwned" types so that a `Program` can be represented as static data.
/// (This makes it convenient and efficient for use with the `regex!` macro.) /// (This makes it convenient and efficient for use with the `regex!` macro.)
#[deriving(Clone)] #[derive(Clone)]
pub struct Program { pub struct Program {
/// A sequence of instructions. /// A sequence of instructions.
pub insts: Vec<Inst>, 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 /// Note that this representation prevents one from reproducing the regex as
/// it was typed. (But it could be used to reproduce an equivalent regex.) /// it was typed. (But it could be used to reproduce an equivalent regex.)
#[deriving(Show, Clone)] #[derive(Show, Clone)]
pub enum Ast { pub enum Ast {
Nothing, Nothing,
Literal(char, Flags), Literal(char, Flags),
@ -69,14 +69,14 @@ pub enum Ast {
Rep(Box<Ast>, Repeater, Greed), Rep(Box<Ast>, Repeater, Greed),
} }
#[deriving(Show, PartialEq, Clone)] #[derive(Show, PartialEq, Clone)]
pub enum Repeater { pub enum Repeater {
ZeroOne, ZeroOne,
ZeroMore, ZeroMore,
OneMore, OneMore,
} }
#[deriving(Copy, Show, Clone)] #[derive(Copy, Show, Clone)]
pub enum Greed { pub enum Greed {
Greedy, Greedy,
Ungreedy, Ungreedy,
@ -103,7 +103,7 @@ impl Greed {
/// constructing an abstract syntax tree. Its central purpose is to facilitate /// constructing an abstract syntax tree. Its central purpose is to facilitate
/// parsing groups and alternations while also maintaining a stack of flag /// parsing groups and alternations while also maintaining a stack of flag
/// state. /// state.
#[deriving(Show)] #[derive(Show)]
enum BuildAst { enum BuildAst {
Expr(Ast), Expr(Ast),
Paren(Flags, uint, String), // '(' 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. /// makes it much faster when searching text.
/// More details about the `regex!` macro can be found in the `regex` crate /// More details about the `regex!` macro can be found in the `regex` crate
/// documentation. /// documentation.
#[deriving(Clone)] #[derive(Clone)]
pub enum Regex { pub enum Regex {
// The representation of `Regex` is exported to support the `regex!` // The representation of `Regex` is exported to support the `regex!`
// syntax extension. Do not rely on it. // syntax extension. Do not rely on it.
@ -117,7 +117,7 @@ pub enum Regex {
Native(ExNative), Native(ExNative),
} }
#[deriving(Clone)] #[derive(Clone)]
#[doc(hidden)] #[doc(hidden)]
pub struct ExDynamic { pub struct ExDynamic {
original: String, original: String,
@ -127,7 +127,7 @@ pub struct ExDynamic {
} }
#[doc(hidden)] #[doc(hidden)]
#[deriving(Copy)] #[derive(Copy)]
pub struct ExNative { pub struct ExNative {
#[doc(hidden)] #[doc(hidden)]
pub original: &'static str, pub original: &'static str,
@ -540,7 +540,7 @@ impl Regex {
} }
#[deriving(Clone)] #[derive(Clone)]
pub enum NamesIter<'a> { pub enum NamesIter<'a> {
NamesIterNative(::std::slice::Iter<'a, Option<&'static str>>), NamesIterNative(::std::slice::Iter<'a, Option<&'static str>>),
NamesIterDynamic(::std::slice::Iter<'a, Option<String>>) 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 /// `'r` is the lifetime of the compiled expression and `'t` is the lifetime
/// of the string being split. /// of the string being split.
#[deriving(Clone)] #[derive(Clone)]
pub struct RegexSplits<'r, 't> { pub struct RegexSplits<'r, 't> {
finder: FindMatches<'r, 't>, finder: FindMatches<'r, 't>,
last: uint, 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 /// `'r` is the lifetime of the compiled expression and `'t` is the lifetime
/// of the string being split. /// of the string being split.
#[deriving(Clone)] #[derive(Clone)]
pub struct RegexSplitsN<'r, 't> { pub struct RegexSplitsN<'r, 't> {
splits: RegexSplits<'r, 't>, splits: RegexSplits<'r, 't>,
cur: uint, cur: uint,
@ -801,7 +801,7 @@ impl<'t> Captures<'t> {
/// expression. /// expression.
/// ///
/// `'t` is the lifetime of the matched text. /// `'t` is the lifetime of the matched text.
#[deriving(Clone)] #[derive(Clone)]
pub struct SubCaptures<'t> { pub struct SubCaptures<'t> {
idx: uint, idx: uint,
caps: &'t Captures<'t>, 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. /// Positions are byte indices in terms of the original string matched.
/// ///
/// `'t` is the lifetime of the matched text. /// `'t` is the lifetime of the matched text.
#[deriving(Clone)] #[derive(Clone)]
pub struct SubCapturesPos<'t> { pub struct SubCapturesPos<'t> {
idx: uint, idx: uint,
caps: &'t Captures<'t>, 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 /// `'r` is the lifetime of the compiled expression and `'t` is the lifetime
/// of the matched string. /// of the matched string.
#[deriving(Clone)] #[derive(Clone)]
pub struct FindCaptures<'r, 't> { pub struct FindCaptures<'r, 't> {
re: &'r Regex, re: &'r Regex,
search: &'t str, 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 /// `'r` is the lifetime of the compiled expression and `'t` is the lifetime
/// of the matched string. /// of the matched string.
#[deriving(Clone)] #[derive(Clone)]
pub struct FindMatches<'r, 't> { pub struct FindMatches<'r, 't> {
re: &'r Regex, re: &'r Regex,
search: &'t str, search: &'t str,

View File

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

View File

@ -57,7 +57,7 @@ declare_lint! {
"suggest using `loop { }` instead of `while true { }`" "suggest using `loop { }` instead of `while true { }`"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct WhileTrue; pub struct WhileTrue;
impl LintPass for WhileTrue { impl LintPass for WhileTrue {
@ -83,7 +83,7 @@ declare_lint! {
"detects unnecessary type casts that can be removed" "detects unnecessary type casts that can be removed"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct UnusedCasts; pub struct UnusedCasts;
impl LintPass for UnusedCasts { impl LintPass for UnusedCasts {
@ -125,7 +125,7 @@ declare_lint! {
"shift exceeds the type's number of bits" "shift exceeds the type's number of bits"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct TypeLimits { pub struct TypeLimits {
/// Id of the last visited negated expression /// Id of the last visited negated expression
negated_expr_id: ast::NodeId, 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; pub struct ImproperCTypes;
impl LintPass for ImproperCTypes { impl LintPass for ImproperCTypes {
@ -485,7 +485,7 @@ declare_lint! {
"use of owned (Box type) heap memory" "use of owned (Box type) heap memory"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct BoxPointers; pub struct BoxPointers;
impl BoxPointers { impl BoxPointers {
@ -625,7 +625,7 @@ declare_lint! {
"detects attributes that were not used by the compiler" "detects attributes that were not used by the compiler"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct UnusedAttributes; pub struct UnusedAttributes;
impl LintPass for UnusedAttributes { impl LintPass for UnusedAttributes {
@ -709,7 +709,7 @@ declare_lint! {
"path statements with no effect" "path statements with no effect"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct PathStatements; pub struct PathStatements;
impl LintPass for PathStatements { impl LintPass for PathStatements {
@ -743,7 +743,7 @@ declare_lint! {
"unused result of an expression in a statement" "unused result of an expression in a statement"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct UnusedResults; pub struct UnusedResults;
impl LintPass for UnusedResults { impl LintPass for UnusedResults {
@ -811,7 +811,7 @@ declare_lint! {
"types, variants, traits and type parameters should have camel case names" "types, variants, traits and type parameters should have camel case names"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct NonCamelCaseTypes; pub struct NonCamelCaseTypes;
impl NonCamelCaseTypes { impl NonCamelCaseTypes {
@ -884,7 +884,7 @@ impl LintPass for NonCamelCaseTypes {
} }
} }
#[deriving(PartialEq)] #[derive(PartialEq)]
enum MethodContext { enum MethodContext {
TraitDefaultImpl, TraitDefaultImpl,
TraitImpl, TraitImpl,
@ -934,7 +934,7 @@ declare_lint! {
"methods, functions, lifetime parameters and modules should have snake case names" "methods, functions, lifetime parameters and modules should have snake case names"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct NonSnakeCase; pub struct NonSnakeCase;
impl NonSnakeCase { impl NonSnakeCase {
@ -1047,7 +1047,7 @@ declare_lint! {
"static constants should have uppercase identifiers" "static constants should have uppercase identifiers"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct NonUpperCaseGlobals; pub struct NonUpperCaseGlobals;
impl LintPass for NonUpperCaseGlobals { impl LintPass for NonUpperCaseGlobals {
@ -1100,7 +1100,7 @@ declare_lint! {
"`if`, `match`, `while` and `return` do not need parentheses" "`if`, `match`, `while` and `return` do not need parentheses"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct UnusedParens; pub struct UnusedParens;
impl UnusedParens { impl UnusedParens {
@ -1194,7 +1194,7 @@ declare_lint! {
"unnecessary braces around an imported item" "unnecessary braces around an imported item"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct UnusedImportBraces; pub struct UnusedImportBraces;
impl LintPass for UnusedImportBraces { impl LintPass for UnusedImportBraces {
@ -1233,7 +1233,7 @@ declare_lint! {
"using `Struct { x: x }` instead of `Struct { x }`" "using `Struct { x: x }` instead of `Struct { x }`"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct NonShorthandFieldPatterns; pub struct NonShorthandFieldPatterns;
impl LintPass for NonShorthandFieldPatterns { impl LintPass for NonShorthandFieldPatterns {
@ -1266,7 +1266,7 @@ declare_lint! {
"unnecessary use of an `unsafe` block" "unnecessary use of an `unsafe` block"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct UnusedUnsafe; pub struct UnusedUnsafe;
impl LintPass for UnusedUnsafe { impl LintPass for UnusedUnsafe {
@ -1291,7 +1291,7 @@ declare_lint! {
"usage of an `unsafe` block" "usage of an `unsafe` block"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct UnsafeBlocks; pub struct UnsafeBlocks;
impl LintPass for UnsafeBlocks { impl LintPass for UnsafeBlocks {
@ -1315,7 +1315,7 @@ declare_lint! {
"detect mut variables which don't need to be mutable" "detect mut variables which don't need to be mutable"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct UnusedMut; pub struct UnusedMut;
impl UnusedMut { impl UnusedMut {
@ -1384,7 +1384,7 @@ declare_lint! {
"detects unnecessary allocations that can be eliminated" "detects unnecessary allocations that can be eliminated"
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct UnusedAllocation; pub struct UnusedAllocation;
impl LintPass for UnusedAllocation { impl LintPass for UnusedAllocation {
@ -1575,7 +1575,7 @@ impl LintPass for MissingDoc {
} }
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct MissingCopyImplementations; pub struct MissingCopyImplementations;
impl LintPass for MissingCopyImplementations { impl LintPass for MissingCopyImplementations {
@ -1646,7 +1646,7 @@ declare_lint! {
/// Checks for use of items with `#[deprecated]`, `#[experimental]` and /// Checks for use of items with `#[deprecated]`, `#[experimental]` and
/// `#[unstable]` attributes, or no stability attribute. /// `#[unstable]` attributes, or no stability attribute.
#[deriving(Copy)] #[derive(Copy)]
pub struct Stability; pub struct Stability;
impl Stability { impl Stability {
@ -1857,7 +1857,7 @@ declare_lint!{
/// Does nothing as a lint pass, but registers some `Lint`s /// Does nothing as a lint pass, but registers some `Lint`s
/// which are used by other parts of the compiler. /// which are used by other parts of the compiler.
#[deriving(Copy)] #[derive(Copy)]
pub struct HardwiredLints; pub struct HardwiredLints;
impl LintPass for HardwiredLints { impl LintPass for HardwiredLints {

View File

@ -42,7 +42,7 @@ use syntax::ast;
pub use lint::context::{Context, LintStore, raw_emit_lint, check_crate, gather_attrs}; pub use lint::context::{Context, LintStore, raw_emit_lint, check_crate, gather_attrs};
/// Specification of a single lint. /// Specification of a single lint.
#[deriving(Copy)] #[derive(Copy)]
pub struct Lint { pub struct Lint {
/// A string identifier for the lint. /// A string identifier for the lint.
/// ///
@ -174,7 +174,7 @@ pub trait LintPass {
pub type LintPassObject = Box<LintPass + 'static>; pub type LintPassObject = Box<LintPass + 'static>;
/// Identifies a lint known to the compiler. /// Identifies a lint known to the compiler.
#[deriving(Clone, Copy)] #[derive(Clone, Copy)]
pub struct LintId { pub struct LintId {
// Identity is based on pointer equality of this field. // Identity is based on pointer equality of this field.
lint: &'static Lint, lint: &'static Lint,
@ -210,7 +210,7 @@ impl LintId {
} }
/// Setting for how to handle a lint. /// Setting for how to handle a lint.
#[deriving(Clone, Copy, PartialEq, PartialOrd, Eq, Ord)] #[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord)]
pub enum Level { pub enum Level {
Allow, Warn, Deny, Forbid Allow, Warn, Deny, Forbid
} }
@ -239,7 +239,7 @@ impl Level {
} }
/// How a lint level was set. /// How a lint level was set.
#[deriving(Clone, Copy, PartialEq, Eq)] #[derive(Clone, Copy, PartialEq, Eq)]
pub enum LintSource { pub enum LintSource {
/// Lint is at the default level as declared /// Lint is at the default level as declared
/// in rustc or a plugin. /// 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; pub const tag_items_data_item_reexport_name: uint = 0x3a;
// used to encode crate_ctxt side tables // used to encode crate_ctxt side tables
#[deriving(Copy, PartialEq)] #[derive(Copy, PartialEq)]
#[repr(uint)] #[repr(uint)]
pub enum astencode_tag { // Reserves 0x40 -- 0x5f pub enum astencode_tag { // Reserves 0x40 -- 0x5f
tag_ast = 0x40, 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; pub const tag_items_data_item_repr: uint = 0x93;
#[deriving(Clone, Show)] #[derive(Clone, Show)]
pub struct LinkMeta { pub struct LinkMeta {
pub crate_name: String, pub crate_name: String,
pub crate_hash: Svh, pub crate_hash: Svh,

View File

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

View File

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

View File

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

View File

@ -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)[]); rbml_w.wr_tagged_str(tag_def_id, def_to_string(id)[]);
} }
#[deriving(Clone)] #[derive(Clone)]
struct entry<T> { struct entry<T> {
val: T, val: T,
pos: u64 pos: u64

View File

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

View File

@ -43,7 +43,7 @@ use syntax::parse::token;
// def-id will depend on where it originated from. Therefore, the conversion // 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 // function is given an indicator of the source of the def-id. See
// astencode.rs for more information. // astencode.rs for more information.
#[deriving(Copy, Show)] #[derive(Copy, Show)]
pub enum DefIdSource { pub enum DefIdSource {
// Identifies a struct, trait, enum, etc. // Identifies a struct, trait, enum, etc.
NominalType, NominalType,

View File

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

View File

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

View File

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

View File

@ -102,7 +102,7 @@ pub struct MatchCheckCtxt<'a, 'tcx: 'a> {
pub param_env: ParameterEnvironment<'a, 'tcx>, pub param_env: ParameterEnvironment<'a, 'tcx>,
} }
#[deriving(Clone, PartialEq)] #[derive(Clone, PartialEq)]
pub enum Constructor { pub enum Constructor {
/// The constructor of all patterns that don't vary by constructor, /// The constructor of all patterns that don't vary by constructor,
/// e.g. struct patterns and fixed-length arrays. /// e.g. struct patterns and fixed-length arrays.
@ -119,14 +119,14 @@ pub enum Constructor {
SliceWithSubslice(uint, uint) SliceWithSubslice(uint, uint)
} }
#[deriving(Clone, PartialEq)] #[derive(Clone, PartialEq)]
enum Usefulness { enum Usefulness {
Useful, Useful,
UsefulWithWitness(Vec<P<Pat>>), UsefulWithWitness(Vec<P<Pat>>),
NotUseful NotUseful
} }
#[deriving(Copy)] #[derive(Copy)]
enum WitnessPreference { enum WitnessPreference {
ConstructWitness, ConstructWitness,
LeaveOutWitness LeaveOutWitness

View File

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

View File

@ -62,7 +62,7 @@ use std::rc::Rc;
// - Non-constants: everything else. // - Non-constants: everything else.
// //
#[deriving(Copy)] #[derive(Copy)]
pub enum constness { pub enum constness {
integral_const, integral_const,
general_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 // FIXME (#33): this doesn't handle big integer/float literals correctly
// (nor does the rest of our literal handling). // (nor does the rest of our literal handling).
#[deriving(Clone, PartialEq)] #[derive(Clone, PartialEq)]
pub enum const_val { pub enum const_val {
const_float(f64), const_float(f64),
const_int(i64), const_int(i64),

View File

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

View File

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

View File

@ -23,7 +23,7 @@ use syntax::codemap::Span;
use syntax::visit; use syntax::visit;
use syntax::visit::Visitor; use syntax::visit::Visitor;
#[deriving(Copy, PartialEq)] #[derive(Copy, PartialEq)]
enum UnsafeContext { enum UnsafeContext {
SafeContext, SafeContext,
UnsafeFn, UnsafeFn,

View File

@ -95,7 +95,7 @@ pub trait Delegate<'tcx> {
mode: MutateMode); mode: MutateMode);
} }
#[deriving(Copy, PartialEq, Show)] #[derive(Copy, PartialEq, Show)]
pub enum LoanCause { pub enum LoanCause {
ClosureCapture(Span), ClosureCapture(Span),
AddrOf, AddrOf,
@ -107,20 +107,20 @@ pub enum LoanCause {
MatchDiscriminant MatchDiscriminant
} }
#[deriving(Copy, PartialEq, Show)] #[derive(Copy, PartialEq, Show)]
pub enum ConsumeMode { pub enum ConsumeMode {
Copy, // reference to x where x has a type that copies Copy, // reference to x where x has a type that copies
Move(MoveReason), // reference to x where x has a type that moves Move(MoveReason), // reference to x where x has a type that moves
} }
#[deriving(Copy, PartialEq, Show)] #[derive(Copy, PartialEq, Show)]
pub enum MoveReason { pub enum MoveReason {
DirectRefMove, DirectRefMove,
PatBindingMove, PatBindingMove,
CaptureMove, CaptureMove,
} }
#[deriving(Copy, PartialEq, Show)] #[derive(Copy, PartialEq, Show)]
pub enum MatchMode { pub enum MatchMode {
NonBindingMatch, NonBindingMatch,
BorrowingMatch, BorrowingMatch,
@ -128,7 +128,7 @@ pub enum MatchMode {
MovingMatch, MovingMatch,
} }
#[deriving(PartialEq,Show)] #[derive(PartialEq,Show)]
enum TrackMatchMode<T> { enum TrackMatchMode<T> {
Unknown, Unknown,
Definite(MatchMode), Definite(MatchMode),
@ -197,14 +197,14 @@ impl<T> TrackMatchMode<T> {
} }
} }
#[deriving(Copy, PartialEq, Show)] #[derive(Copy, PartialEq, Show)]
pub enum MutateMode { pub enum MutateMode {
Init, Init,
JustWrite, // x = y JustWrite, // x = y
WriteAndRead, // x += y WriteAndRead, // x += y
} }
#[deriving(Copy)] #[derive(Copy)]
enum OverloadedCallType { enum OverloadedCallType {
FnOverloadedCall, FnOverloadedCall,
FnMutOverloadedCall, FnMutOverloadedCall,

View File

@ -14,7 +14,7 @@ use syntax::ast;
use self::SimplifiedType::*; use self::SimplifiedType::*;
/// See `simplify_type /// See `simplify_type
#[deriving(Clone, Copy, PartialEq, Eq, Hash)] #[derive(Clone, Copy, PartialEq, Eq, Hash)]
pub enum SimplifiedType { pub enum SimplifiedType {
BoolSimplifiedType, BoolSimplifiedType,
CharSimplifiedType, 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); pub struct NodeIndex(pub uint);
#[allow(non_upper_case_globals)] #[allow(non_upper_case_globals)]
pub const InvalidNodeIndex: NodeIndex = NodeIndex(uint::MAX); pub const InvalidNodeIndex: NodeIndex = NodeIndex(uint::MAX);
#[deriving(Copy, PartialEq, Show)] #[derive(Copy, PartialEq, Show)]
pub struct EdgeIndex(pub uint); pub struct EdgeIndex(pub uint);
#[allow(non_upper_case_globals)] #[allow(non_upper_case_globals)]
pub const InvalidEdgeIndex: EdgeIndex = EdgeIndex(uint::MAX); pub const InvalidEdgeIndex: EdgeIndex = EdgeIndex(uint::MAX);
// Use a private field here to guarantee no more instances are created: // Use a private field here to guarantee no more instances are created:
#[deriving(Copy, Show)] #[derive(Copy, Show)]
pub struct Direction { repr: uint } pub struct Direction { repr: uint }
#[allow(non_upper_case_globals)] #[allow(non_upper_case_globals)]
pub const Outgoing: Direction = Direction { repr: 0 }; pub const Outgoing: Direction = Direction { repr: 0 };

View File

@ -447,7 +447,7 @@ impl<'tcx> Combineable<'tcx> for ty::FnSig<'tcx> {
} }
} }
#[deriving(Clone)] #[derive(Clone)]
pub struct CombineFields<'a, 'tcx: 'a> { pub struct CombineFields<'a, 'tcx: 'a> {
pub infcx: &'a InferCtxt<'a, 'tcx>, pub infcx: &'a InferCtxt<'a, 'tcx>,
pub a_is_expected: bool, pub a_is_expected: bool,

View File

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

View File

@ -121,7 +121,7 @@ struct ConstraintGraph<'a, 'tcx: 'a> {
node_ids: FnvHashMap<Node, uint>, node_ids: FnvHashMap<Node, uint>,
} }
#[deriving(Clone, Hash, PartialEq, Eq, Show)] #[derive(Clone, Hash, PartialEq, Eq, Show)]
enum Node { enum Node {
RegionVid(ty::RegionVid), RegionVid(ty::RegionVid),
Region(ty::Region), Region(ty::Region),

View File

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

View File

@ -46,7 +46,7 @@ struct Delegate;
type Relation = (RelationDir, ty::TyVid); type Relation = (RelationDir, ty::TyVid);
#[deriving(Copy, PartialEq, Show)] #[derive(Copy, PartialEq, Show)]
pub enum RelationDir { pub enum RelationDir {
SubtypeOf, SupertypeOf, EqTo SubtypeOf, SupertypeOf, EqTo
} }

View File

@ -62,7 +62,7 @@ pub trait UnifyValue<'tcx> : Clone + Repr<'tcx> + PartialEq {
/// to keep the DAG relatively balanced, which helps keep the running /// to keep the DAG relatively balanced, which helps keep the running
/// time of the algorithm under control. For more information, see /// time of the algorithm under control. For more information, see
/// <http://en.wikipedia.org/wiki/Disjoint-set_data_structure>. /// <http://en.wikipedia.org/wiki/Disjoint-set_data_structure>.
#[deriving(PartialEq,Clone)] #[derive(PartialEq,Clone)]
pub enum VarValue<K,V> { pub enum VarValue<K,V> {
Redirect(K), Redirect(K),
Root(V, uint), Root(V, uint),
@ -90,7 +90,7 @@ pub struct Node<K,V> {
pub rank: uint, pub rank: uint,
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct Delegate; pub struct Delegate;
// We can't use V:LatticeValue, much as I would like to, // We can't use V:LatticeValue, much as I would like to,

View File

@ -46,7 +46,7 @@ macro_rules! lets_do_this {
$( $variant:ident, $name:expr, $method:ident; )* $( $variant:ident, $name:expr, $method:ident; )*
) => { ) => {
#[deriving(Copy, FromPrimitive, PartialEq, Eq, Hash)] #[derive(Copy, FromPrimitive, PartialEq, Eq, Hash)]
pub enum LangItem { pub enum LangItem {
$($variant),* $($variant),*
} }

View File

@ -138,10 +138,10 @@ enum LoopKind<'a> {
ForLoop(&'a ast::Pat), ForLoop(&'a ast::Pat),
} }
#[deriving(Copy, PartialEq)] #[derive(Copy, PartialEq)]
struct Variable(uint); struct Variable(uint);
#[deriving(Copy, PartialEq)] #[derive(Copy, PartialEq)]
struct LiveNode(uint); struct LiveNode(uint);
impl Variable { impl Variable {
@ -158,7 +158,7 @@ impl Clone for LiveNode {
} }
} }
#[deriving(Copy, PartialEq, Show)] #[derive(Copy, PartialEq, Show)]
enum LiveNodeKind { enum LiveNodeKind {
FreeVarNode(Span), FreeVarNode(Span),
ExprNode(Span), ExprNode(Span),
@ -244,13 +244,13 @@ struct CaptureInfo {
var_nid: NodeId var_nid: NodeId
} }
#[deriving(Copy, Show)] #[derive(Copy, Show)]
struct LocalInfo { struct LocalInfo {
id: NodeId, id: NodeId,
ident: ast::Ident ident: ast::Ident
} }
#[deriving(Copy, Show)] #[derive(Copy, Show)]
enum VarKind { enum VarKind {
Arg(NodeId, ast::Ident), Arg(NodeId, ast::Ident),
Local(LocalInfo), Local(LocalInfo),
@ -529,7 +529,7 @@ fn visit_expr(ir: &mut IrMaps, expr: &Expr) {
// Actually we compute just a bit more than just liveness, but we use // Actually we compute just a bit more than just liveness, but we use
// the same basic propagation framework in all cases. // the same basic propagation framework in all cases.
#[deriving(Clone, Copy)] #[derive(Clone, Copy)]
struct Users { struct Users {
reader: LiveNode, reader: LiveNode,
writer: LiveNode, writer: LiveNode,
@ -544,7 +544,7 @@ fn invalid_users() -> Users {
} }
} }
#[deriving(Copy)] #[derive(Copy)]
struct Specials { struct Specials {
exit_ln: LiveNode, exit_ln: LiveNode,
fallthrough_ln: LiveNode, fallthrough_ln: LiveNode,

View File

@ -87,7 +87,7 @@ use syntax::parse::token;
use std::cell::RefCell; use std::cell::RefCell;
use std::rc::Rc; use std::rc::Rc;
#[deriving(Clone, PartialEq, Show)] #[derive(Clone, PartialEq, Show)]
pub enum categorization<'tcx> { pub enum categorization<'tcx> {
cat_rvalue(ty::Region), // temporary val, argument is its scope cat_rvalue(ty::Region), // temporary val, argument is its scope
cat_static_item, cat_static_item,
@ -101,7 +101,7 @@ pub enum categorization<'tcx> {
} }
// Represents any kind of upvar // Represents any kind of upvar
#[deriving(Clone, Copy, PartialEq, Show)] #[derive(Clone, Copy, PartialEq, Show)]
pub struct Upvar { pub struct Upvar {
pub id: ty::UpvarId, pub id: ty::UpvarId,
// Unboxed closure kinds are used even for old-style closures for simplicity // Unboxed closure kinds are used even for old-style closures for simplicity
@ -111,7 +111,7 @@ pub struct Upvar {
} }
// different kinds of pointers: // different kinds of pointers:
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] #[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
pub enum PointerKind { pub enum PointerKind {
Unique, Unique,
BorrowedPtr(ty::BorrowKind, ty::Region), BorrowedPtr(ty::BorrowKind, ty::Region),
@ -121,25 +121,25 @@ pub enum PointerKind {
// We use the term "interior" to mean "something reachable from the // We use the term "interior" to mean "something reachable from the
// base without a pointer dereference", e.g. a field // base without a pointer dereference", e.g. a field
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] #[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
pub enum InteriorKind { pub enum InteriorKind {
InteriorField(FieldName), InteriorField(FieldName),
InteriorElement(ElementKind), InteriorElement(ElementKind),
} }
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] #[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
pub enum FieldName { pub enum FieldName {
NamedField(ast::Name), NamedField(ast::Name),
PositionalField(uint) PositionalField(uint)
} }
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] #[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
pub enum ElementKind { pub enum ElementKind {
VecElement, VecElement,
OtherElement, OtherElement,
} }
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] #[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
pub enum MutabilityCategory { pub enum MutabilityCategory {
McImmutable, // Immutable. McImmutable, // Immutable.
McDeclared, // Directly declared as mutable. McDeclared, // Directly declared as mutable.
@ -151,7 +151,7 @@ pub enum MutabilityCategory {
// Upvar categorization can generate a variable number of nested // Upvar categorization can generate a variable number of nested
// derefs. The note allows detecting them without deep pattern // derefs. The note allows detecting them without deep pattern
// matching on the categorization. // matching on the categorization.
#[deriving(Clone, Copy, PartialEq, Show)] #[derive(Clone, Copy, PartialEq, Show)]
pub enum Note { pub enum Note {
NoteClosureEnv(ty::UpvarId), // Deref through closure env NoteClosureEnv(ty::UpvarId), // Deref through closure env
NoteUpvarRef(ty::UpvarId), // Deref through by-ref upvar NoteUpvarRef(ty::UpvarId), // Deref through by-ref upvar
@ -172,7 +172,7 @@ pub enum Note {
// dereference, but its type is the type *before* the dereference // dereference, but its type is the type *before* the dereference
// (`@T`). So use `cmt.ty` to find the type of the value in a consistent // (`@T`). So use `cmt.ty` to find the type of the value in a consistent
// fashion. For more details, see the method `cat_pattern` // fashion. For more details, see the method `cat_pattern`
#[deriving(Clone, PartialEq, Show)] #[derive(Clone, PartialEq, Show)]
pub struct cmt_<'tcx> { pub struct cmt_<'tcx> {
pub id: ast::NodeId, // id of expr/pat producing this value pub id: ast::NodeId, // id of expr/pat producing this value
pub span: Span, // span of same expr/pat pub span: Span, // span of same expr/pat
@ -186,7 +186,7 @@ pub type cmt<'tcx> = Rc<cmt_<'tcx>>;
// We pun on *T to mean both actual deref of a ptr as well // We pun on *T to mean both actual deref of a ptr as well
// as accessing of components: // as accessing of components:
#[deriving(Copy)] #[derive(Copy)]
pub enum deref_kind { pub enum deref_kind {
deref_ptr(PointerKind), deref_ptr(PointerKind),
deref_interior(InteriorKind), deref_interior(InteriorKind),
@ -1296,13 +1296,13 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
} }
} }
#[deriving(Copy)] #[derive(Copy)]
pub enum InteriorSafety { pub enum InteriorSafety {
InteriorUnsafe, InteriorUnsafe,
InteriorSafe InteriorSafe
} }
#[deriving(Copy)] #[derive(Copy)]
pub enum AliasableReason { pub enum AliasableReason {
AliasableBorrowed, AliasableBorrowed,
AliasableClosure(ast::NodeId), // Aliasable due to capture Fn closure env AliasableClosure(ast::NodeId), // Aliasable due to capture Fn closure env

View File

@ -49,7 +49,7 @@ pub type PublicItems = NodeSet;
// FIXME: dox // FIXME: dox
pub type LastPrivateMap = NodeMap<LastPrivate>; pub type LastPrivateMap = NodeMap<LastPrivate>;
#[deriving(Copy, Show)] #[derive(Copy, Show)]
pub enum LastPrivate { pub enum LastPrivate {
LastMod(PrivateDep), LastMod(PrivateDep),
// `use` directives (imports) can refer to two separate definitions in the // `use` directives (imports) can refer to two separate definitions in the
@ -63,14 +63,14 @@ pub enum LastPrivate {
type_used: ImportUse}, type_used: ImportUse},
} }
#[deriving(Copy, Show)] #[derive(Copy, Show)]
pub enum PrivateDep { pub enum PrivateDep {
AllPublic, AllPublic,
DependsOn(ast::DefId), DependsOn(ast::DefId),
} }
// How an import is used. // How an import is used.
#[deriving(Copy, PartialEq, Show)] #[derive(Copy, PartialEq, Show)]
pub enum ImportUse { pub enum ImportUse {
Unused, // The import is not used. Unused, // The import is not used.
Used, // The import is used. Used, // The import is used.

View File

@ -36,7 +36,7 @@ use syntax::visit::{Visitor, FnKind};
/// placate the same deriving in `ty::FreeRegion`, but we may want to /// placate the same deriving in `ty::FreeRegion`, but we may want to
/// actually attach a more meaningful ordering to scopes than the one /// actually attach a more meaningful ordering to scopes than the one
/// generated via deriving here. /// generated via deriving here.
#[deriving(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, RustcEncodable, #[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, RustcEncodable,
RustcDecodable, Show, Copy)] RustcDecodable, Show, Copy)]
pub enum CodeExtent { pub enum CodeExtent {
Misc(ast::NodeId) Misc(ast::NodeId)
@ -116,7 +116,7 @@ pub struct RegionMaps {
terminating_scopes: RefCell<FnvHashSet<CodeExtent>>, terminating_scopes: RefCell<FnvHashSet<CodeExtent>>,
} }
#[deriving(Copy)] #[derive(Copy)]
pub struct Context { pub struct Context {
var_parent: Option<ast::NodeId>, var_parent: Option<ast::NodeId>,

View File

@ -33,7 +33,7 @@ use syntax::visit;
use syntax::visit::Visitor; use syntax::visit::Visitor;
use util::nodemap::NodeMap; use util::nodemap::NodeMap;
#[deriving(Clone, Copy, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show)] #[derive(Clone, Copy, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show)]
pub enum DefRegion { pub enum DefRegion {
DefStaticRegion, DefStaticRegion,
DefEarlyBoundRegion(/* space */ subst::ParamSpace, DefEarlyBoundRegion(/* space */ subst::ParamSpace,

View File

@ -28,7 +28,7 @@ use syntax::codemap::{Span, DUMMY_SP};
/// identify each in-scope parameter by an *index* and a *parameter /// identify each in-scope parameter by an *index* and a *parameter
/// space* (which indices where the parameter is defined; see /// space* (which indices where the parameter is defined; see
/// `ParamSpace`). /// `ParamSpace`).
#[deriving(Clone, PartialEq, Eq, Hash, Show)] #[derive(Clone, PartialEq, Eq, Hash, Show)]
pub struct Substs<'tcx> { pub struct Substs<'tcx> {
pub types: VecPerParamSpace<Ty<'tcx>>, pub types: VecPerParamSpace<Ty<'tcx>>,
pub regions: RegionSubsts, pub regions: RegionSubsts,
@ -37,7 +37,7 @@ pub struct Substs<'tcx> {
/// Represents the values to use when substituting lifetime parameters. /// Represents the values to use when substituting lifetime parameters.
/// If the value is `ErasedRegions`, then this subst is occurring during /// If the value is `ErasedRegions`, then this subst is occurring during
/// trans, and all region parameters will be replaced with `ty::ReStatic`. /// trans, and all region parameters will be replaced with `ty::ReStatic`.
#[deriving(Clone, PartialEq, Eq, Hash, Show)] #[derive(Clone, PartialEq, Eq, Hash, Show)]
pub enum RegionSubsts { pub enum RegionSubsts {
ErasedRegions, ErasedRegions,
NonerasedRegions(VecPerParamSpace<ty::Region>) NonerasedRegions(VecPerParamSpace<ty::Region>)
@ -179,7 +179,7 @@ impl RegionSubsts {
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// ParamSpace // ParamSpace
#[deriving(PartialOrd, Ord, PartialEq, Eq, Copy, #[derive(PartialOrd, Ord, PartialEq, Eq, Copy,
Clone, Hash, RustcEncodable, RustcDecodable, Show)] Clone, Hash, RustcEncodable, RustcDecodable, Show)]
pub enum ParamSpace { pub enum ParamSpace {
TypeSpace, // Type parameters attached to a type definition, trait, or impl TypeSpace, // Type parameters attached to a type definition, trait, or impl
@ -213,7 +213,7 @@ impl ParamSpace {
/// Vector of things sorted by param space. Used to keep /// Vector of things sorted by param space. Used to keep
/// the set of things declared on the type, self, or method /// the set of things declared on the type, self, or method
/// distinct. /// distinct.
#[deriving(PartialEq, Eq, Clone, Hash, RustcEncodable, RustcDecodable)] #[derive(PartialEq, Eq, Clone, Hash, RustcEncodable, RustcDecodable)]
pub struct VecPerParamSpace<T> { pub struct VecPerParamSpace<T> {
// This was originally represented as a tuple with one Vec<T> for // This was originally represented as a tuple with one Vec<T> for
// each variant of ParamSpace, and that remains the abstraction // each variant of ParamSpace, and that remains the abstraction
@ -468,7 +468,7 @@ impl<T> VecPerParamSpace<T> {
} }
} }
#[deriving(Clone)] #[derive(Clone)]
pub struct EnumeratedItems<'a,T:'a> { pub struct EnumeratedItems<'a,T:'a> {
vec: &'a VecPerParamSpace<T>, vec: &'a VecPerParamSpace<T>,
space_index: uint, space_index: uint,

View File

@ -63,7 +63,7 @@ mod util;
/// either identifying an `impl` (e.g., `impl Eq for int`) that /// either identifying an `impl` (e.g., `impl Eq for int`) that
/// provides the required vtable, or else finding a bound that is in /// provides the required vtable, or else finding a bound that is in
/// scope. The eventual result is usually a `Selection` (defined below). /// scope. The eventual result is usually a `Selection` (defined below).
#[deriving(Clone)] #[derive(Clone)]
pub struct Obligation<'tcx, T> { pub struct Obligation<'tcx, T> {
pub cause: ObligationCause<'tcx>, pub cause: ObligationCause<'tcx>,
pub recursion_depth: uint, pub recursion_depth: uint,
@ -74,7 +74,7 @@ pub type PredicateObligation<'tcx> = Obligation<'tcx, ty::Predicate<'tcx>>;
pub type TraitObligation<'tcx> = Obligation<'tcx, ty::PolyTraitPredicate<'tcx>>; pub type TraitObligation<'tcx> = Obligation<'tcx, ty::PolyTraitPredicate<'tcx>>;
/// Why did we incur this obligation? Used for error reporting. /// Why did we incur this obligation? Used for error reporting.
#[deriving(Clone)] #[derive(Clone)]
pub struct ObligationCause<'tcx> { pub struct ObligationCause<'tcx> {
pub span: Span, pub span: Span,
@ -89,7 +89,7 @@ pub struct ObligationCause<'tcx> {
pub code: ObligationCauseCode<'tcx> pub code: ObligationCauseCode<'tcx>
} }
#[deriving(Clone)] #[derive(Clone)]
pub enum ObligationCauseCode<'tcx> { pub enum ObligationCauseCode<'tcx> {
/// Not well classified or should be obvious from span. /// Not well classified or should be obvious from span.
MiscObligation, MiscObligation,
@ -126,7 +126,7 @@ pub enum ObligationCauseCode<'tcx> {
ImplDerivedObligation(DerivedObligationCause<'tcx>), ImplDerivedObligation(DerivedObligationCause<'tcx>),
} }
#[deriving(Clone)] #[derive(Clone)]
pub struct DerivedObligationCause<'tcx> { pub struct DerivedObligationCause<'tcx> {
/// The trait reference of the parent obligation that led to the /// The trait reference of the parent obligation that led to the
/// current obligation. Note that only trait obligations lead to /// current obligation. Note that only trait obligations lead to
@ -144,7 +144,7 @@ pub type TraitObligations<'tcx> = subst::VecPerParamSpace<TraitObligation<'tcx>>
pub type Selection<'tcx> = Vtable<'tcx, PredicateObligation<'tcx>>; pub type Selection<'tcx> = Vtable<'tcx, PredicateObligation<'tcx>>;
#[deriving(Clone,Show)] #[derive(Clone,Show)]
pub enum SelectionError<'tcx> { pub enum SelectionError<'tcx> {
Unimplemented, Unimplemented,
Overflow, Overflow,
@ -158,7 +158,7 @@ pub struct FulfillmentError<'tcx> {
pub code: FulfillmentErrorCode<'tcx> pub code: FulfillmentErrorCode<'tcx>
} }
#[deriving(Clone)] #[derive(Clone)]
pub enum FulfillmentErrorCode<'tcx> { pub enum FulfillmentErrorCode<'tcx> {
CodeSelectionError(SelectionError<'tcx>), CodeSelectionError(SelectionError<'tcx>),
CodeProjectionError(MismatchedProjectionTypes<'tcx>), CodeProjectionError(MismatchedProjectionTypes<'tcx>),
@ -212,7 +212,7 @@ pub type SelectionResult<'tcx, T> = Result<Option<T>, SelectionError<'tcx>>;
/// ### The type parameter `N` /// ### The type parameter `N`
/// ///
/// See explanation on `VtableImplData`. /// See explanation on `VtableImplData`.
#[deriving(Show,Clone)] #[derive(Show,Clone)]
pub enum Vtable<'tcx, N> { pub enum Vtable<'tcx, N> {
/// Vtable identifying a particular impl. /// Vtable identifying a particular impl.
VtableImpl(VtableImplData<'tcx, N>), VtableImpl(VtableImplData<'tcx, N>),
@ -247,21 +247,21 @@ pub enum Vtable<'tcx, N> {
/// is `Obligation`, as one might expect. During trans, however, this /// is `Obligation`, as one might expect. During trans, however, this
/// is `()`, because trans only requires a shallow resolution of an /// is `()`, because trans only requires a shallow resolution of an
/// impl, and nested obligations are satisfied later. /// impl, and nested obligations are satisfied later.
#[deriving(Clone)] #[derive(Clone)]
pub struct VtableImplData<'tcx, N> { pub struct VtableImplData<'tcx, N> {
pub impl_def_id: ast::DefId, pub impl_def_id: ast::DefId,
pub substs: subst::Substs<'tcx>, pub substs: subst::Substs<'tcx>,
pub nested: subst::VecPerParamSpace<N> pub nested: subst::VecPerParamSpace<N>
} }
#[deriving(Show,Clone)] #[derive(Show,Clone)]
pub struct VtableBuiltinData<N> { pub struct VtableBuiltinData<N> {
pub nested: subst::VecPerParamSpace<N> pub nested: subst::VecPerParamSpace<N>
} }
/// A vtable for some object-safe trait `Foo` automatically derived /// A vtable for some object-safe trait `Foo` automatically derived
/// for the object type `Foo`. /// for the object type `Foo`.
#[deriving(PartialEq,Eq,Clone)] #[derive(PartialEq,Eq,Clone)]
pub struct VtableObjectData<'tcx> { pub struct VtableObjectData<'tcx> {
pub object_ty: Ty<'tcx>, pub object_ty: Ty<'tcx>,
} }

View File

@ -36,7 +36,7 @@ pub enum ObjectSafetyViolation<'tcx> {
} }
/// Reasons a method might not be object-safe. /// Reasons a method might not be object-safe.
#[deriving(Copy,Clone,Show)] #[derive(Copy,Clone,Show)]
pub enum MethodViolationCode { pub enum MethodViolationCode {
/// e.g., `fn(self)` /// e.g., `fn(self)`
ByValueSelf, ByValueSelf,

View File

@ -45,7 +45,7 @@ pub enum ProjectionTyError<'tcx> {
TraitSelectionError(SelectionError<'tcx>), TraitSelectionError(SelectionError<'tcx>),
} }
#[deriving(Clone)] #[derive(Clone)]
pub struct MismatchedProjectionTypes<'tcx> { pub struct MismatchedProjectionTypes<'tcx> {
pub err: ty::type_err<'tcx> pub err: ty::type_err<'tcx>
} }

View File

@ -83,7 +83,7 @@ struct TraitObligationStack<'prev, 'tcx: 'prev> {
previous: Option<&'prev TraitObligationStack<'prev, 'tcx>> previous: Option<&'prev TraitObligationStack<'prev, 'tcx>>
} }
#[deriving(Clone)] #[derive(Clone)]
pub struct SelectionCache<'tcx> { pub struct SelectionCache<'tcx> {
hashmap: RefCell<HashMap<Rc<ty::TraitRef<'tcx>>, hashmap: RefCell<HashMap<Rc<ty::TraitRef<'tcx>>,
SelectionResult<'tcx, SelectionCandidate<'tcx>>>>, SelectionResult<'tcx, SelectionCandidate<'tcx>>>>,
@ -95,7 +95,7 @@ pub enum MethodMatchResult {
MethodDidNotMatch, MethodDidNotMatch,
} }
#[deriving(Copy, Show)] #[derive(Copy, Show)]
pub enum MethodMatchedData { pub enum MethodMatchedData {
// In the case of a precise match, we don't really need to store // In the case of a precise match, we don't really need to store
// how the match was found. So don't. // how the match was found. So don't.
@ -130,7 +130,7 @@ pub enum MethodMatchedData {
/// matching where clause. Part of the reason for this is that where /// matching where clause. Part of the reason for this is that where
/// clauses can give additional information (like, the types of output /// clauses can give additional information (like, the types of output
/// parameters) that would have to be inferred from the impl. /// parameters) that would have to be inferred from the impl.
#[deriving(PartialEq,Eq,Show,Clone)] #[derive(PartialEq,Eq,Show,Clone)]
enum SelectionCandidate<'tcx> { enum SelectionCandidate<'tcx> {
BuiltinCandidate(ty::BuiltinBound), BuiltinCandidate(ty::BuiltinBound),
ParamCandidate(ty::PolyTraitRef<'tcx>), ParamCandidate(ty::PolyTraitRef<'tcx>),
@ -171,7 +171,7 @@ enum BuiltinBoundConditions<'tcx> {
AmbiguousBuiltin AmbiguousBuiltin
} }
#[deriving(Show)] #[derive(Show)]
enum EvaluationResult<'tcx> { enum EvaluationResult<'tcx> {
EvaluatedToOk, EvaluatedToOk,
EvaluatedToAmbig, EvaluatedToAmbig,

View File

@ -108,13 +108,13 @@ pub struct CrateAnalysis<'tcx> {
pub glob_map: Option<GlobMap>, pub glob_map: Option<GlobMap>,
} }
#[deriving(Copy, PartialEq, Eq, Hash)] #[derive(Copy, PartialEq, Eq, Hash)]
pub struct field<'tcx> { pub struct field<'tcx> {
pub name: ast::Name, pub name: ast::Name,
pub mt: mt<'tcx> pub mt: mt<'tcx>
} }
#[deriving(Clone, Copy, Show)] #[derive(Clone, Copy, Show)]
pub enum ImplOrTraitItemContainer { pub enum ImplOrTraitItemContainer {
TraitContainer(ast::DefId), TraitContainer(ast::DefId),
ImplContainer(ast::DefId), ImplContainer(ast::DefId),
@ -129,7 +129,7 @@ impl ImplOrTraitItemContainer {
} }
} }
#[deriving(Clone, Show)] #[derive(Clone, Show)]
pub enum ImplOrTraitItem<'tcx> { pub enum ImplOrTraitItem<'tcx> {
MethodTraitItem(Rc<Method<'tcx>>), MethodTraitItem(Rc<Method<'tcx>>),
TypeTraitItem(Rc<AssociatedType>), TypeTraitItem(Rc<AssociatedType>),
@ -174,7 +174,7 @@ impl<'tcx> ImplOrTraitItem<'tcx> {
} }
} }
#[deriving(Clone, Copy, Show)] #[derive(Clone, Copy, Show)]
pub enum ImplOrTraitItemId { pub enum ImplOrTraitItemId {
MethodTraitItemId(ast::DefId), MethodTraitItemId(ast::DefId),
TypeTraitItemId(ast::DefId), TypeTraitItemId(ast::DefId),
@ -189,7 +189,7 @@ impl ImplOrTraitItemId {
} }
} }
#[deriving(Clone, Show)] #[derive(Clone, Show)]
pub struct Method<'tcx> { pub struct Method<'tcx> {
pub name: ast::Name, pub name: ast::Name,
pub generics: ty::Generics<'tcx>, pub generics: ty::Generics<'tcx>,
@ -233,7 +233,7 @@ impl<'tcx> Method<'tcx> {
} }
} }
#[deriving(Clone, Copy, Show)] #[derive(Clone, Copy, Show)]
pub struct AssociatedType { pub struct AssociatedType {
pub name: ast::Name, pub name: ast::Name,
pub vis: ast::Visibility, pub vis: ast::Visibility,
@ -241,13 +241,13 @@ pub struct AssociatedType {
pub container: ImplOrTraitItemContainer, pub container: ImplOrTraitItemContainer,
} }
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] #[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
pub struct mt<'tcx> { pub struct mt<'tcx> {
pub ty: Ty<'tcx>, pub ty: Ty<'tcx>,
pub mutbl: ast::Mutability, pub mutbl: ast::Mutability,
} }
#[deriving(Clone, Copy, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show)] #[derive(Clone, Copy, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show)]
pub enum TraitStore { pub enum TraitStore {
/// Box<Trait> /// Box<Trait>
UniqTraitStore, UniqTraitStore,
@ -255,7 +255,7 @@ pub enum TraitStore {
RegionTraitStore(Region, ast::Mutability), RegionTraitStore(Region, ast::Mutability),
} }
#[deriving(Clone, Copy, Show)] #[derive(Clone, Copy, Show)]
pub struct field_ty { pub struct field_ty {
pub name: Name, pub name: Name,
pub id: DefId, pub id: DefId,
@ -265,26 +265,26 @@ pub struct field_ty {
// Contains information needed to resolve types and (in the future) look up // Contains information needed to resolve types and (in the future) look up
// the types of AST nodes. // the types of AST nodes.
#[deriving(Copy, PartialEq, Eq, Hash)] #[derive(Copy, PartialEq, Eq, Hash)]
pub struct creader_cache_key { pub struct creader_cache_key {
pub cnum: CrateNum, pub cnum: CrateNum,
pub pos: uint, pub pos: uint,
pub len: uint pub len: uint
} }
#[deriving(Copy)] #[derive(Copy)]
pub enum ast_ty_to_ty_cache_entry<'tcx> { pub enum ast_ty_to_ty_cache_entry<'tcx> {
atttce_unresolved, /* not resolved yet */ atttce_unresolved, /* not resolved yet */
atttce_resolved(Ty<'tcx>) /* resolved to a type, irrespective of region */ atttce_resolved(Ty<'tcx>) /* resolved to a type, irrespective of region */
} }
#[deriving(Clone, PartialEq, RustcDecodable, RustcEncodable)] #[derive(Clone, PartialEq, RustcDecodable, RustcEncodable)]
pub struct ItemVariances { pub struct ItemVariances {
pub types: VecPerParamSpace<Variance>, pub types: VecPerParamSpace<Variance>,
pub regions: VecPerParamSpace<Variance>, pub regions: VecPerParamSpace<Variance>,
} }
#[deriving(Clone, PartialEq, RustcDecodable, RustcEncodable, Show, Copy)] #[derive(Clone, PartialEq, RustcDecodable, RustcEncodable, Show, Copy)]
pub enum Variance { pub enum Variance {
Covariant, // T<A> <: T<B> iff A <: B -- e.g., function return type Covariant, // T<A> <: T<B> iff A <: B -- e.g., function return type
Invariant, // T<A> <: T<B> iff B == A -- e.g., type of mutable cell Invariant, // T<A> <: T<B> iff B == A -- e.g., type of mutable cell
@ -292,14 +292,14 @@ pub enum Variance {
Bivariant, // T<A> <: T<B> -- e.g., unused type parameter Bivariant, // T<A> <: T<B> -- e.g., unused type parameter
} }
#[deriving(Clone, Show)] #[derive(Clone, Show)]
pub enum AutoAdjustment<'tcx> { pub enum AutoAdjustment<'tcx> {
AdjustAddEnv(ast::DefId, ty::TraitStore), AdjustAddEnv(ast::DefId, ty::TraitStore),
AdjustReifyFnPointer(ast::DefId), // go from a fn-item type to a fn-pointer type AdjustReifyFnPointer(ast::DefId), // go from a fn-item type to a fn-pointer type
AdjustDerefRef(AutoDerefRef<'tcx>) AdjustDerefRef(AutoDerefRef<'tcx>)
} }
#[deriving(Clone, PartialEq, Show)] #[derive(Clone, PartialEq, Show)]
pub enum UnsizeKind<'tcx> { pub enum UnsizeKind<'tcx> {
// [T, ..n] -> [T], the uint field is n. // [T, ..n] -> [T], the uint field is n.
UnsizeLength(uint), UnsizeLength(uint),
@ -309,13 +309,13 @@ pub enum UnsizeKind<'tcx> {
UnsizeVtable(TyTrait<'tcx>, /* the self type of the trait */ Ty<'tcx>) UnsizeVtable(TyTrait<'tcx>, /* the self type of the trait */ Ty<'tcx>)
} }
#[deriving(Clone, Show)] #[derive(Clone, Show)]
pub struct AutoDerefRef<'tcx> { pub struct AutoDerefRef<'tcx> {
pub autoderefs: uint, pub autoderefs: uint,
pub autoref: Option<AutoRef<'tcx>> pub autoref: Option<AutoRef<'tcx>>
} }
#[deriving(Clone, PartialEq, Show)] #[derive(Clone, PartialEq, Show)]
pub enum AutoRef<'tcx> { pub enum AutoRef<'tcx> {
/// Convert from T to &T /// Convert from T to &T
/// The third field allows us to wrap other AutoRef adjustments. /// The third field allows us to wrap other AutoRef adjustments.
@ -432,13 +432,13 @@ pub fn type_of_adjust<'tcx>(cx: &ctxt<'tcx>, adj: &AutoAdjustment<'tcx>) -> Opti
} }
} }
#[deriving(Clone, Copy, RustcEncodable, RustcDecodable, PartialEq, PartialOrd, Show)] #[derive(Clone, Copy, RustcEncodable, RustcDecodable, PartialEq, PartialOrd, Show)]
pub struct param_index { pub struct param_index {
pub space: subst::ParamSpace, pub space: subst::ParamSpace,
pub index: uint pub index: uint
} }
#[deriving(Clone, Show)] #[derive(Clone, Show)]
pub enum MethodOrigin<'tcx> { pub enum MethodOrigin<'tcx> {
// fully statically resolved method // fully statically resolved method
MethodStatic(ast::DefId), MethodStatic(ast::DefId),
@ -456,7 +456,7 @@ pub enum MethodOrigin<'tcx> {
// details for a method invoked with a receiver whose type is a type parameter // details for a method invoked with a receiver whose type is a type parameter
// with a bounded trait. // with a bounded trait.
#[deriving(Clone, Show)] #[derive(Clone, Show)]
pub struct MethodParam<'tcx> { pub struct MethodParam<'tcx> {
// the precise trait reference that occurs as a bound -- this may // the precise trait reference that occurs as a bound -- this may
// be a supertrait of what the user actually typed. Note that it // be a supertrait of what the user actually typed. Note that it
@ -469,7 +469,7 @@ pub struct MethodParam<'tcx> {
} }
// details for a method invoked with a receiver whose type is an object // details for a method invoked with a receiver whose type is an object
#[deriving(Clone, Show)] #[derive(Clone, Show)]
pub struct MethodObject<'tcx> { pub struct MethodObject<'tcx> {
// the (super)trait containing the method to be invoked // the (super)trait containing the method to be invoked
pub trait_ref: Rc<ty::TraitRef<'tcx>>, pub trait_ref: Rc<ty::TraitRef<'tcx>>,
@ -487,7 +487,7 @@ pub struct MethodObject<'tcx> {
pub real_index: uint, pub real_index: uint,
} }
#[deriving(Clone)] #[derive(Clone)]
pub struct MethodCallee<'tcx> { pub struct MethodCallee<'tcx> {
pub origin: MethodOrigin<'tcx>, pub origin: MethodOrigin<'tcx>,
pub ty: Ty<'tcx>, pub ty: Ty<'tcx>,
@ -506,13 +506,13 @@ pub struct MethodCallee<'tcx> {
/// needed to add to the side tables. Thus to disambiguate /// needed to add to the side tables. Thus to disambiguate
/// we also keep track of whether there's an adjustment in /// we also keep track of whether there's an adjustment in
/// our key. /// our key.
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] #[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
pub struct MethodCall { pub struct MethodCall {
pub expr_id: ast::NodeId, pub expr_id: ast::NodeId,
pub adjustment: ExprAdjustment pub adjustment: ExprAdjustment
} }
#[deriving(Clone, PartialEq, Eq, Hash, Show, RustcEncodable, RustcDecodable, Copy)] #[derive(Clone, PartialEq, Eq, Hash, Show, RustcEncodable, RustcDecodable, Copy)]
pub enum ExprAdjustment { pub enum ExprAdjustment {
NoAdjustment, NoAdjustment,
AutoDeref(uint), AutoDeref(uint),
@ -551,7 +551,7 @@ pub type vtable_param_res<'tcx> = Vec<vtable_origin<'tcx>>;
// Resolutions for bounds of all parameters, left to right, for a given path. // Resolutions for bounds of all parameters, left to right, for a given path.
pub type vtable_res<'tcx> = VecPerParamSpace<vtable_param_res<'tcx>>; pub type vtable_res<'tcx> = VecPerParamSpace<vtable_param_res<'tcx>>;
#[deriving(Clone)] #[derive(Clone)]
pub enum vtable_origin<'tcx> { pub enum vtable_origin<'tcx> {
/* /*
Statically known vtable. def_id gives the impl item Statically known vtable. def_id gives the impl item
@ -596,7 +596,7 @@ pub type ObjectCastMap<'tcx> = RefCell<NodeMap<ty::PolyTraitRef<'tcx>>>;
/// will push one or more such restriction into the /// will push one or more such restriction into the
/// `transmute_restrictions` vector during `intrinsicck`. They are /// `transmute_restrictions` vector during `intrinsicck`. They are
/// then checked during `trans` by the fn `check_intrinsics`. /// then checked during `trans` by the fn `check_intrinsics`.
#[deriving(Copy)] #[derive(Copy)]
pub struct TransmuteRestriction<'tcx> { pub struct TransmuteRestriction<'tcx> {
/// The span whence the restriction comes. /// The span whence the restriction comes.
pub span: Span, pub span: Span,
@ -858,7 +858,7 @@ macro_rules! sty_debug_print {
// variable names. // variable names.
mod inner { mod inner {
use middle::ty; use middle::ty;
#[deriving(Copy)] #[derive(Copy)]
struct DebugStat { struct DebugStat {
total: uint, total: uint,
region_infer: uint, region_infer: uint,
@ -926,7 +926,7 @@ impl<'tcx> ctxt<'tcx> {
} }
} }
#[deriving(Show)] #[derive(Show)]
pub struct TyS<'tcx> { pub struct TyS<'tcx> {
pub sty: sty<'tcx>, pub sty: sty<'tcx>,
pub flags: TypeFlags, pub flags: TypeFlags,
@ -1032,14 +1032,14 @@ pub fn type_escapes_depth(ty: Ty, depth: u32) -> bool {
ty.region_depth > depth ty.region_depth > depth
} }
#[deriving(Clone, PartialEq, Eq, Hash, Show)] #[derive(Clone, PartialEq, Eq, Hash, Show)]
pub struct BareFnTy<'tcx> { pub struct BareFnTy<'tcx> {
pub unsafety: ast::Unsafety, pub unsafety: ast::Unsafety,
pub abi: abi::Abi, pub abi: abi::Abi,
pub sig: PolyFnSig<'tcx>, pub sig: PolyFnSig<'tcx>,
} }
#[deriving(Clone, PartialEq, Eq, Hash, Show)] #[derive(Clone, PartialEq, Eq, Hash, Show)]
pub struct ClosureTy<'tcx> { pub struct ClosureTy<'tcx> {
pub unsafety: ast::Unsafety, pub unsafety: ast::Unsafety,
pub onceness: ast::Onceness, pub onceness: ast::Onceness,
@ -1049,7 +1049,7 @@ pub struct ClosureTy<'tcx> {
pub abi: abi::Abi, pub abi: abi::Abi,
} }
#[deriving(Clone, Copy, PartialEq, Eq, Hash)] #[derive(Clone, Copy, PartialEq, Eq, Hash)]
pub enum FnOutput<'tcx> { pub enum FnOutput<'tcx> {
FnConverging(Ty<'tcx>), FnConverging(Ty<'tcx>),
FnDiverging FnDiverging
@ -1070,7 +1070,7 @@ impl<'tcx> FnOutput<'tcx> {
/// - `inputs` is the list of arguments and their modes. /// - `inputs` is the list of arguments and their modes.
/// - `output` is the return type. /// - `output` is the return type.
/// - `variadic` indicates whether this is a varidic function. (only true for foreign fns) /// - `variadic` indicates whether this is a varidic function. (only true for foreign fns)
#[deriving(Clone, PartialEq, Eq, Hash)] #[derive(Clone, PartialEq, Eq, Hash)]
pub struct FnSig<'tcx> { pub struct FnSig<'tcx> {
pub inputs: Vec<Ty<'tcx>>, pub inputs: Vec<Ty<'tcx>>,
pub output: FnOutput<'tcx>, pub output: FnOutput<'tcx>,
@ -1079,7 +1079,7 @@ pub struct FnSig<'tcx> {
pub type PolyFnSig<'tcx> = Binder<FnSig<'tcx>>; pub type PolyFnSig<'tcx> = Binder<FnSig<'tcx>>;
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] #[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
pub struct ParamTy { pub struct ParamTy {
pub space: subst::ParamSpace, pub space: subst::ParamSpace,
pub idx: u32, pub idx: u32,
@ -1125,7 +1125,7 @@ pub struct ParamTy {
/// is the outer fn. /// is the outer fn.
/// ///
/// [dbi]: http://en.wikipedia.org/wiki/De_Bruijn_index /// [dbi]: http://en.wikipedia.org/wiki/De_Bruijn_index
#[deriving(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show, Copy)] #[derive(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show, Copy)]
pub struct DebruijnIndex { pub struct DebruijnIndex {
// We maintain the invariant that this is never 0. So 1 indicates // We maintain the invariant that this is never 0. So 1 indicates
// the innermost binder. To ensure this, create with `DebruijnIndex::new`. // the innermost binder. To ensure this, create with `DebruijnIndex::new`.
@ -1133,7 +1133,7 @@ pub struct DebruijnIndex {
} }
/// Representation of regions: /// Representation of regions:
#[deriving(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show, Copy)] #[derive(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show, Copy)]
pub enum Region { pub enum Region {
// Region bound in a type or fn declaration which will be // Region bound in a type or fn declaration which will be
// substituted 'early' -- that is, at the same time when type // substituted 'early' -- that is, at the same time when type
@ -1174,13 +1174,13 @@ pub enum Region {
/// Upvars do not get their own node-id. Instead, we use the pair of /// Upvars do not get their own node-id. Instead, we use the pair of
/// the original var id (that is, the root variable that is referenced /// the original var id (that is, the root variable that is referenced
/// by the upvar) and the id of the closure expression. /// by the upvar) and the id of the closure expression.
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)] #[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
pub struct UpvarId { pub struct UpvarId {
pub var_id: ast::NodeId, pub var_id: ast::NodeId,
pub closure_expr_id: ast::NodeId, pub closure_expr_id: ast::NodeId,
} }
#[deriving(Clone, PartialEq, Eq, Hash, Show, RustcEncodable, RustcDecodable, Copy)] #[derive(Clone, PartialEq, Eq, Hash, Show, RustcEncodable, RustcDecodable, Copy)]
pub enum BorrowKind { pub enum BorrowKind {
/// Data must be immutable and is aliasable. /// Data must be immutable and is aliasable.
ImmBorrow, ImmBorrow,
@ -1273,7 +1273,7 @@ pub enum BorrowKind {
/// - Through mutation, the borrowed upvars can actually escape /// - Through mutation, the borrowed upvars can actually escape
/// the closure, so sometimes it is necessary for them to be larger /// the closure, so sometimes it is necessary for them to be larger
/// than the closure lifetime itself. /// than the closure lifetime itself.
#[deriving(PartialEq, Clone, RustcEncodable, RustcDecodable, Show, Copy)] #[derive(PartialEq, Clone, RustcEncodable, RustcDecodable, Show, Copy)]
pub struct UpvarBorrow { pub struct UpvarBorrow {
pub kind: BorrowKind, pub kind: BorrowKind,
pub region: ty::Region, pub region: ty::Region,
@ -1298,7 +1298,7 @@ impl Region {
} }
} }
#[deriving(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, #[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash,
RustcEncodable, RustcDecodable, Show, Copy)] RustcEncodable, RustcDecodable, Show, Copy)]
/// A "free" region `fr` can be interpreted as "some region /// A "free" region `fr` can be interpreted as "some region
/// at least as big as the scope `fr.scope`". /// at least as big as the scope `fr.scope`".
@ -1307,7 +1307,7 @@ pub struct FreeRegion {
pub bound_region: BoundRegion pub bound_region: BoundRegion
} }
#[deriving(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, #[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash,
RustcEncodable, RustcDecodable, Show, Copy)] RustcEncodable, RustcDecodable, Show, Copy)]
pub enum BoundRegion { pub enum BoundRegion {
/// An anonymous region parameter for a given fn (&T) /// An anonymous region parameter for a given fn (&T)
@ -1329,7 +1329,7 @@ pub enum BoundRegion {
// NB: If you change this, you'll probably want to change the corresponding // NB: If you change this, you'll probably want to change the corresponding
// AST structure in libsyntax/ast.rs as well. // AST structure in libsyntax/ast.rs as well.
#[deriving(Clone, PartialEq, Eq, Hash, Show)] #[derive(Clone, PartialEq, Eq, Hash, Show)]
pub enum sty<'tcx> { pub enum sty<'tcx> {
ty_bool, ty_bool,
ty_char, ty_char,
@ -1377,7 +1377,7 @@ pub enum sty<'tcx> {
// on non-useful type error messages) // on non-useful type error messages)
} }
#[deriving(Clone, PartialEq, Eq, Hash, Show)] #[derive(Clone, PartialEq, Eq, Hash, Show)]
pub struct TyTrait<'tcx> { pub struct TyTrait<'tcx> {
pub principal: ty::PolyTraitRef<'tcx>, pub principal: ty::PolyTraitRef<'tcx>,
pub bounds: ExistentialBounds<'tcx>, pub bounds: ExistentialBounds<'tcx>,
@ -1449,7 +1449,7 @@ impl<'tcx> TyTrait<'tcx> {
/// Note that a `TraitRef` introduces a level of region binding, to /// Note that a `TraitRef` introduces a level of region binding, to
/// account for higher-ranked trait bounds like `T : for<'a> Foo<&'a /// account for higher-ranked trait bounds like `T : for<'a> Foo<&'a
/// U>` or higher-ranked object types. /// U>` or higher-ranked object types.
#[deriving(Clone, PartialEq, Eq, Hash, Show)] #[derive(Clone, PartialEq, Eq, Hash, Show)]
pub struct TraitRef<'tcx> { pub struct TraitRef<'tcx> {
pub def_id: DefId, pub def_id: DefId,
pub substs: &'tcx Substs<'tcx>, pub substs: &'tcx Substs<'tcx>,
@ -1487,16 +1487,16 @@ impl<'tcx> PolyTraitRef<'tcx> {
/// erase, or otherwise "discharge" these bound reons, we change the /// erase, or otherwise "discharge" these bound reons, we change the
/// type from `Binder<T>` to just `T` (see /// type from `Binder<T>` to just `T` (see
/// e.g. `liberate_late_bound_regions`). /// e.g. `liberate_late_bound_regions`).
#[deriving(Clone, PartialEq, Eq, Hash, Show)] #[derive(Clone, PartialEq, Eq, Hash, Show)]
pub struct Binder<T>(pub T); pub struct Binder<T>(pub T);
#[deriving(Clone, Copy, PartialEq)] #[derive(Clone, Copy, PartialEq)]
pub enum IntVarValue { pub enum IntVarValue {
IntType(ast::IntTy), IntType(ast::IntTy),
UintType(ast::UintTy), UintType(ast::UintTy),
} }
#[deriving(Clone, Copy, Show)] #[derive(Clone, Copy, Show)]
pub enum terr_vstore_kind { pub enum terr_vstore_kind {
terr_vec, terr_vec,
terr_str, terr_str,
@ -1504,14 +1504,14 @@ pub enum terr_vstore_kind {
terr_trait terr_trait
} }
#[deriving(Clone, Copy, Show)] #[derive(Clone, Copy, Show)]
pub struct expected_found<T> { pub struct expected_found<T> {
pub expected: T, pub expected: T,
pub found: T pub found: T
} }
// Data structures used in type unification // Data structures used in type unification
#[deriving(Clone, Copy, Show)] #[derive(Clone, Copy, Show)]
pub enum type_err<'tcx> { pub enum type_err<'tcx> {
terr_mismatch, terr_mismatch,
terr_unsafety_mismatch(expected_found<ast::Unsafety>), terr_unsafety_mismatch(expected_found<ast::Unsafety>),
@ -1548,7 +1548,7 @@ pub enum type_err<'tcx> {
/// Bounds suitable for a named type parameter like `A` in `fn foo<A>` /// Bounds suitable for a named type parameter like `A` in `fn foo<A>`
/// as well as the existential type parameter in an object type. /// as well as the existential type parameter in an object type.
#[deriving(PartialEq, Eq, Hash, Clone, Show)] #[derive(PartialEq, Eq, Hash, Clone, Show)]
pub struct ParamBounds<'tcx> { pub struct ParamBounds<'tcx> {
pub region_bounds: Vec<ty::Region>, pub region_bounds: Vec<ty::Region>,
pub builtin_bounds: BuiltinBounds, pub builtin_bounds: BuiltinBounds,
@ -1561,7 +1561,7 @@ pub struct ParamBounds<'tcx> {
/// major difference between this case and `ParamBounds` is that /// major difference between this case and `ParamBounds` is that
/// general purpose trait bounds are omitted and there must be /// general purpose trait bounds are omitted and there must be
/// *exactly one* region. /// *exactly one* region.
#[deriving(PartialEq, Eq, Hash, Clone, Show)] #[derive(PartialEq, Eq, Hash, Clone, Show)]
pub struct ExistentialBounds<'tcx> { pub struct ExistentialBounds<'tcx> {
pub region_bound: ty::Region, pub region_bound: ty::Region,
pub builtin_bounds: BuiltinBounds, pub builtin_bounds: BuiltinBounds,
@ -1570,7 +1570,7 @@ pub struct ExistentialBounds<'tcx> {
pub type BuiltinBounds = EnumSet<BuiltinBound>; pub type BuiltinBounds = EnumSet<BuiltinBound>;
#[deriving(Clone, RustcEncodable, PartialEq, Eq, RustcDecodable, Hash, #[derive(Clone, RustcEncodable, PartialEq, Eq, RustcDecodable, Hash,
Show, Copy)] Show, Copy)]
#[repr(uint)] #[repr(uint)]
pub enum BuiltinBound { pub enum BuiltinBound {
@ -1608,27 +1608,27 @@ impl CLike for BuiltinBound {
} }
} }
#[deriving(Clone, Copy, PartialEq, Eq, Hash)] #[derive(Clone, Copy, PartialEq, Eq, Hash)]
pub struct TyVid { pub struct TyVid {
pub index: u32 pub index: u32
} }
#[deriving(Clone, Copy, PartialEq, Eq, Hash)] #[derive(Clone, Copy, PartialEq, Eq, Hash)]
pub struct IntVid { pub struct IntVid {
pub index: u32 pub index: u32
} }
#[deriving(Clone, Copy, PartialEq, Eq, Hash)] #[derive(Clone, Copy, PartialEq, Eq, Hash)]
pub struct FloatVid { pub struct FloatVid {
pub index: u32 pub index: u32
} }
#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)] #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)]
pub struct RegionVid { pub struct RegionVid {
pub index: u32 pub index: u32
} }
#[deriving(Clone, Copy, PartialEq, Eq, Hash)] #[derive(Clone, Copy, PartialEq, Eq, Hash)]
pub enum InferTy { pub enum InferTy {
TyVar(TyVid), TyVar(TyVid),
IntVar(IntVid), IntVar(IntVid),
@ -1645,7 +1645,7 @@ pub enum InferTy {
FreshIntTy(u32), FreshIntTy(u32),
} }
#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)] #[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)]
pub enum UnconstrainedNumeric { pub enum UnconstrainedNumeric {
UnconstrainedFloat, UnconstrainedFloat,
UnconstrainedInt, UnconstrainedInt,
@ -1653,7 +1653,7 @@ pub enum UnconstrainedNumeric {
} }
#[deriving(Clone, RustcEncodable, RustcDecodable, Eq, Hash, Show, Copy)] #[derive(Clone, RustcEncodable, RustcDecodable, Eq, Hash, Show, Copy)]
pub enum InferRegion { pub enum InferRegion {
ReVar(RegionVid), ReVar(RegionVid),
ReSkolemized(u32, BoundRegion) ReSkolemized(u32, BoundRegion)
@ -1728,7 +1728,7 @@ impl fmt::Show for IntVarValue {
} }
} }
#[deriving(Clone, Show)] #[derive(Clone, Show)]
pub struct TypeParameterDef<'tcx> { pub struct TypeParameterDef<'tcx> {
pub name: ast::Name, pub name: ast::Name,
pub def_id: ast::DefId, pub def_id: ast::DefId,
@ -1738,7 +1738,7 @@ pub struct TypeParameterDef<'tcx> {
pub default: Option<Ty<'tcx>>, pub default: Option<Ty<'tcx>>,
} }
#[deriving(RustcEncodable, RustcDecodable, Clone, Show)] #[derive(RustcEncodable, RustcDecodable, Clone, Show)]
pub struct RegionParameterDef { pub struct RegionParameterDef {
pub name: ast::Name, pub name: ast::Name,
pub def_id: ast::DefId, pub def_id: ast::DefId,
@ -1755,7 +1755,7 @@ impl RegionParameterDef {
/// Information about the formal type/lifetime parameters associated /// Information about the formal type/lifetime parameters associated
/// with an item or method. Analogous to ast::Generics. /// with an item or method. Analogous to ast::Generics.
#[deriving(Clone, Show)] #[derive(Clone, Show)]
pub struct Generics<'tcx> { pub struct Generics<'tcx> {
pub types: VecPerParamSpace<TypeParameterDef<'tcx>>, pub types: VecPerParamSpace<TypeParameterDef<'tcx>>,
pub regions: VecPerParamSpace<RegionParameterDef>, pub regions: VecPerParamSpace<RegionParameterDef>,
@ -1787,7 +1787,7 @@ impl<'tcx> Generics<'tcx> {
} }
} }
#[deriving(Clone, PartialEq, Eq, Hash, Show)] #[derive(Clone, PartialEq, Eq, Hash, Show)]
pub enum Predicate<'tcx> { pub enum Predicate<'tcx> {
/// Corresponds to `where Foo : Bar<A,B,C>`. `Foo` here would be /// Corresponds to `where Foo : Bar<A,B,C>`. `Foo` here would be
/// the `Self` type of the trait reference and `A`, `B`, and `C` /// the `Self` type of the trait reference and `A`, `B`, and `C`
@ -1808,7 +1808,7 @@ pub enum Predicate<'tcx> {
Projection(PolyProjectionPredicate<'tcx>), Projection(PolyProjectionPredicate<'tcx>),
} }
#[deriving(Clone, PartialEq, Eq, Hash, Show)] #[derive(Clone, PartialEq, Eq, Hash, Show)]
pub struct TraitPredicate<'tcx> { pub struct TraitPredicate<'tcx> {
pub trait_ref: Rc<TraitRef<'tcx>> pub trait_ref: Rc<TraitRef<'tcx>>
} }
@ -1834,11 +1834,11 @@ impl<'tcx> PolyTraitPredicate<'tcx> {
} }
} }
#[deriving(Clone, PartialEq, Eq, Hash, Show)] #[derive(Clone, PartialEq, Eq, Hash, Show)]
pub struct EquatePredicate<'tcx>(pub Ty<'tcx>, pub Ty<'tcx>); // `0 == 1` pub struct EquatePredicate<'tcx>(pub Ty<'tcx>, pub Ty<'tcx>); // `0 == 1`
pub type PolyEquatePredicate<'tcx> = ty::Binder<EquatePredicate<'tcx>>; pub type PolyEquatePredicate<'tcx> = ty::Binder<EquatePredicate<'tcx>>;
#[deriving(Clone, PartialEq, Eq, Hash, Show)] #[derive(Clone, PartialEq, Eq, Hash, Show)]
pub struct OutlivesPredicate<A,B>(pub A, pub B); // `A : B` pub struct OutlivesPredicate<A,B>(pub A, pub B); // `A : B`
pub type PolyOutlivesPredicate<A,B> = ty::Binder<OutlivesPredicate<A,B>>; pub type PolyOutlivesPredicate<A,B> = ty::Binder<OutlivesPredicate<A,B>>;
pub type PolyRegionOutlivesPredicate = PolyOutlivesPredicate<ty::Region, ty::Region>; pub type PolyRegionOutlivesPredicate = PolyOutlivesPredicate<ty::Region, ty::Region>;
@ -1856,7 +1856,7 @@ pub type PolyTypeOutlivesPredicate<'tcx> = PolyOutlivesPredicate<Ty<'tcx>, ty::R
/// equality between arbitrary types. Processing an instance of Form /// equality between arbitrary types. Processing an instance of Form
/// #2 eventually yields one of these `ProjectionPredicate` /// #2 eventually yields one of these `ProjectionPredicate`
/// instances to normalize the LHS. /// instances to normalize the LHS.
#[deriving(Clone, PartialEq, Eq, Hash, Show)] #[derive(Clone, PartialEq, Eq, Hash, Show)]
pub struct ProjectionPredicate<'tcx> { pub struct ProjectionPredicate<'tcx> {
pub projection_ty: ProjectionTy<'tcx>, pub projection_ty: ProjectionTy<'tcx>,
pub ty: Ty<'tcx>, pub ty: Ty<'tcx>,
@ -1872,7 +1872,7 @@ impl<'tcx> PolyProjectionPredicate<'tcx> {
/// Represents the projection of an associated type. In explicit UFCS /// Represents the projection of an associated type. In explicit UFCS
/// form this would be written `<T as Trait<..>>::N`. /// form this would be written `<T as Trait<..>>::N`.
#[deriving(Clone, PartialEq, Eq, Hash, Show)] #[derive(Clone, PartialEq, Eq, Hash, Show)]
pub struct ProjectionTy<'tcx> { pub struct ProjectionTy<'tcx> {
/// The trait reference `T as Trait<..>`. /// The trait reference `T as Trait<..>`.
pub trait_ref: Rc<ty::TraitRef<'tcx>>, pub trait_ref: Rc<ty::TraitRef<'tcx>>,
@ -2008,7 +2008,7 @@ impl<'tcx> Predicate<'tcx> {
/// `[[], [U:Bar<T>]]`. Now if there were some particular reference /// `[[], [U:Bar<T>]]`. Now if there were some particular reference
/// like `Foo<int,uint>`, then the `GenericBounds` would be `[[], /// like `Foo<int,uint>`, then the `GenericBounds` would be `[[],
/// [uint:Bar<int>]]`. /// [uint:Bar<int>]]`.
#[deriving(Clone, Show)] #[derive(Clone, Show)]
pub struct GenericBounds<'tcx> { pub struct GenericBounds<'tcx> {
pub predicates: VecPerParamSpace<Predicate<'tcx>>, pub predicates: VecPerParamSpace<Predicate<'tcx>>,
} }
@ -2057,7 +2057,7 @@ impl<'tcx> TraitRef<'tcx> {
/// bound lifetime parameters are replaced with free ones, but in the /// bound lifetime parameters are replaced with free ones, but in the
/// future I hope to refine the representation of types so as to make /// future I hope to refine the representation of types so as to make
/// more distinctions clearer. /// more distinctions clearer.
#[deriving(Clone)] #[derive(Clone)]
pub struct ParameterEnvironment<'a, 'tcx:'a> { pub struct ParameterEnvironment<'a, 'tcx:'a> {
pub tcx: &'a ctxt<'tcx>, pub tcx: &'a ctxt<'tcx>,
@ -2205,7 +2205,7 @@ impl<'a, 'tcx> ParameterEnvironment<'a, 'tcx> {
/// stray references in a comment or something). We try to reserve the /// stray references in a comment or something). We try to reserve the
/// "poly" prefix to refer to higher-ranked things, as in /// "poly" prefix to refer to higher-ranked things, as in
/// `PolyTraitRef`. /// `PolyTraitRef`.
#[deriving(Clone, Show)] #[derive(Clone, Show)]
pub struct TypeScheme<'tcx> { pub struct TypeScheme<'tcx> {
pub generics: Generics<'tcx>, pub generics: Generics<'tcx>,
pub ty: Ty<'tcx> pub ty: Ty<'tcx>
@ -2234,13 +2234,13 @@ pub struct TraitDef<'tcx> {
/// Records the substitutions used to translate the polytype for an /// Records the substitutions used to translate the polytype for an
/// item into the monotype of an item reference. /// item into the monotype of an item reference.
#[deriving(Clone)] #[derive(Clone)]
pub struct ItemSubsts<'tcx> { pub struct ItemSubsts<'tcx> {
pub substs: Substs<'tcx>, pub substs: Substs<'tcx>,
} }
/// Records information about each unboxed closure. /// Records information about each unboxed closure.
#[deriving(Clone)] #[derive(Clone)]
pub struct UnboxedClosure<'tcx> { pub struct UnboxedClosure<'tcx> {
/// The type of the unboxed closure. /// The type of the unboxed closure.
pub closure_type: ClosureTy<'tcx>, pub closure_type: ClosureTy<'tcx>,
@ -2248,7 +2248,7 @@ pub struct UnboxedClosure<'tcx> {
pub kind: UnboxedClosureKind, pub kind: UnboxedClosureKind,
} }
#[deriving(Clone, Copy, PartialEq, Eq, Show)] #[derive(Clone, Copy, PartialEq, Eq, Show)]
pub enum UnboxedClosureKind { pub enum UnboxedClosureKind {
FnUnboxedClosureKind, FnUnboxedClosureKind,
FnMutUnboxedClosureKind, FnMutUnboxedClosureKind,
@ -3129,7 +3129,7 @@ pub fn type_is_floating_point(ty: Ty) -> bool {
/// The reason we compute type contents and not kinds is that it is /// The reason we compute type contents and not kinds is that it is
/// easier for me (nmatsakis) to think about what is contained within /// easier for me (nmatsakis) to think about what is contained within
/// a type than to think about what is *not* contained within a type. /// a type than to think about what is *not* contained within a type.
#[deriving(Clone, Copy)] #[derive(Clone, Copy)]
pub struct TypeContents { pub struct TypeContents {
pub bits: u64 pub bits: u64
} }
@ -3733,7 +3733,7 @@ pub fn is_instantiable<'tcx>(cx: &ctxt<'tcx>, r_ty: Ty<'tcx>) -> bool {
/// ///
/// The ordering of the cases is significant. They are sorted so that cmp::max /// The ordering of the cases is significant. They are sorted so that cmp::max
/// will keep the "more erroneous" of two values. /// will keep the "more erroneous" of two values.
#[deriving(Copy, PartialOrd, Ord, Eq, PartialEq, Show)] #[derive(Copy, PartialOrd, Ord, Eq, PartialEq, Show)]
pub enum Representability { pub enum Representability {
Representable, Representable,
ContainsRecursive, ContainsRecursive,
@ -4505,7 +4505,7 @@ pub fn expr_is_lval(tcx: &ctxt, e: &ast::Expr) -> bool {
/// two kinds of rvalues is an artifact of trans which reflects how we will /// two kinds of rvalues is an artifact of trans which reflects how we will
/// generate code for that kind of expression. See trans/expr.rs for more /// generate code for that kind of expression. See trans/expr.rs for more
/// information. /// information.
#[deriving(Copy)] #[derive(Copy)]
pub enum ExprKind { pub enum ExprKind {
LvalueExpr, LvalueExpr,
RvalueDpsExpr, RvalueDpsExpr,
@ -5091,7 +5091,7 @@ pub fn associated_type_parameter_index(cx: &ctxt,
cx.sess.bug("couldn't find associated type parameter index") cx.sess.bug("couldn't find associated type parameter index")
} }
#[deriving(Copy, PartialEq, Eq)] #[derive(Copy, PartialEq, Eq)]
pub struct AssociatedTypeInfo { pub struct AssociatedTypeInfo {
pub def_id: ast::DefId, pub def_id: ast::DefId,
pub index: uint, pub index: uint,
@ -5186,7 +5186,7 @@ pub fn ty_to_def_id(ty: Ty) -> Option<ast::DefId> {
} }
// Enum information // Enum information
#[deriving(Clone)] #[derive(Clone)]
pub struct VariantInfo<'tcx> { pub struct VariantInfo<'tcx> {
pub args: Vec<Ty<'tcx>>, pub args: Vec<Ty<'tcx>>,
pub arg_names: Option<Vec<ast::Ident>>, pub arg_names: Option<Vec<ast::Ident>>,
@ -5277,7 +5277,7 @@ pub fn item_path_str(cx: &ctxt, id: ast::DefId) -> String {
with_path(cx, id, |path| ast_map::path_to_string(path)).to_string() with_path(cx, id, |path| ast_map::path_to_string(path)).to_string()
} }
#[deriving(Copy)] #[derive(Copy)]
pub enum DtorKind { pub enum DtorKind {
NoDtor, NoDtor,
TraitDtor(DefId, bool) TraitDtor(DefId, bool)
@ -5712,7 +5712,7 @@ pub fn tup_fields<'tcx>(v: &[Ty<'tcx>]) -> Vec<field<'tcx>> {
}).collect() }).collect()
} }
#[deriving(Copy, Clone)] #[derive(Copy, Clone)]
pub struct UnboxedClosureUpvar<'tcx> { pub struct UnboxedClosureUpvar<'tcx> {
pub def: def::Def, pub def: def::Def,
pub span: Span, pub span: Span,
@ -6643,7 +6643,7 @@ impl<'a,'tcx> UnboxedClosureTyper<'tcx> for ty::ParameterEnvironment<'a,'tcx> {
/// The category of explicit self. /// The category of explicit self.
#[deriving(Clone, Copy, Eq, PartialEq, Show)] #[derive(Clone, Copy, Eq, PartialEq, Show)]
pub enum ExplicitSelfCategory { pub enum ExplicitSelfCategory {
StaticExplicitSelfCategory, StaticExplicitSelfCategory,
ByValueExplicitSelfCategory, ByValueExplicitSelfCategory,
@ -6712,7 +6712,7 @@ pub fn accumulate_lifetimes_in_type(accumulator: &mut Vec<ty::Region>,
} }
/// A free variable referred to in a function. /// A free variable referred to in a function.
#[deriving(Copy, RustcEncodable, RustcDecodable)] #[derive(Copy, RustcEncodable, RustcDecodable)]
pub struct Freevar { pub struct Freevar {
/// The variable being accessed free. /// The variable being accessed free.
pub def: def::Def, pub def: def::Def,
@ -6989,7 +6989,7 @@ pub fn make_substs_for_receiver_types<'tcx>(tcx: &ty::ctxt<'tcx>,
trait_ref.substs.clone().with_method(meth_tps, meth_regions) trait_ref.substs.clone().with_method(meth_tps, meth_regions)
} }
#[deriving(Copy)] #[derive(Copy)]
pub enum CopyImplementationError { pub enum CopyImplementationError {
FieldDoesNotImplementCopy(ast::Name), FieldDoesNotImplementCopy(ast::Name),
VariantDoesNotImplementCopy(ast::Name), VariantDoesNotImplementCopy(ast::Name),

View File

@ -46,7 +46,7 @@ pub struct Config {
pub uint_type: UintTy, pub uint_type: UintTy,
} }
#[deriving(Clone, Copy, PartialEq)] #[derive(Clone, Copy, PartialEq)]
pub enum OptLevel { pub enum OptLevel {
No, // -O0 No, // -O0
Less, // -O1 Less, // -O1
@ -54,14 +54,14 @@ pub enum OptLevel {
Aggressive // -O3 Aggressive // -O3
} }
#[deriving(Clone, Copy, PartialEq)] #[derive(Clone, Copy, PartialEq)]
pub enum DebugInfoLevel { pub enum DebugInfoLevel {
NoDebugInfo, NoDebugInfo,
LimitedDebugInfo, LimitedDebugInfo,
FullDebugInfo, FullDebugInfo,
} }
#[deriving(Clone, Copy, PartialEq, PartialOrd, Ord, Eq)] #[derive(Clone, Copy, PartialEq, PartialOrd, Ord, Eq)]
pub enum OutputType { pub enum OutputType {
OutputTypeBitcode, OutputTypeBitcode,
OutputTypeAssembly, OutputTypeAssembly,
@ -71,7 +71,7 @@ pub enum OutputType {
OutputTypeDepInfo, OutputTypeDepInfo,
} }
#[deriving(Clone)] #[derive(Clone)]
pub struct Options { pub struct Options {
// The crate config requested for the session, which may be combined // The crate config requested for the session, which may be combined
// with additional crate configurations during the compile process // with additional crate configurations during the compile process
@ -113,7 +113,7 @@ pub struct Options {
pub alt_std_name: Option<String> pub alt_std_name: Option<String>
} }
#[deriving(Clone, PartialEq, Eq)] #[derive(Clone, PartialEq, Eq)]
#[allow(missing_copy_implementations)] #[allow(missing_copy_implementations)]
pub enum PrintRequest { pub enum PrintRequest {
FileNames, FileNames,
@ -137,7 +137,7 @@ impl Input {
} }
} }
#[deriving(Clone)] #[derive(Clone)]
pub struct OutputFilenames { pub struct OutputFilenames {
pub out_directory: Path, pub out_directory: Path,
pub out_filestem: String, pub out_filestem: String,
@ -222,14 +222,14 @@ pub fn basic_options() -> Options {
// users can have their own entry // users can have their own entry
// functions that don't start a // functions that don't start a
// scheduler // scheduler
#[deriving(Copy, PartialEq)] #[derive(Copy, PartialEq)]
pub enum EntryFnType { pub enum EntryFnType {
EntryMain, EntryMain,
EntryStart, EntryStart,
EntryNone, EntryNone,
} }
#[deriving(Copy, PartialEq, PartialOrd, Clone, Ord, Eq, Hash)] #[derive(Copy, PartialEq, PartialOrd, Clone, Ord, Eq, Hash)]
pub enum CrateType { pub enum CrateType {
CrateTypeExecutable, CrateTypeExecutable,
CrateTypeDylib, CrateTypeDylib,
@ -337,7 +337,7 @@ pub fn debugging_opts_map() -> Vec<(&'static str, &'static str, u64)> {
] ]
} }
#[deriving(Clone)] #[derive(Clone)]
pub enum Passes { pub enum Passes {
SomePasses(Vec<String>), SomePasses(Vec<String>),
AllPasses, AllPasses,
@ -365,7 +365,7 @@ impl Passes {
macro_rules! cgoptions { macro_rules! cgoptions {
($($opt:ident : $t:ty = ($init:expr, $parse:ident, $desc:expr)),* ,) => ($($opt:ident : $t:ty = ($init:expr, $parse:ident, $desc:expr)),* ,) =>
( (
#[deriving(Clone)] #[derive(Clone)]
pub struct CodegenOptions { $(pub $opt: $t),* } pub struct CodegenOptions { $(pub $opt: $t),* }
pub fn basic_codegen_options() -> CodegenOptions { pub fn basic_codegen_options() -> CodegenOptions {
@ -674,10 +674,10 @@ pub fn optgroups() -> Vec<getopts::OptGroup> {
.collect() .collect()
} }
#[deriving(Copy, Clone, PartialEq, Eq, Show)] #[derive(Copy, Clone, PartialEq, Eq, Show)]
pub enum OptionStability { Stable, Unstable } pub enum OptionStability { Stable, Unstable }
#[deriving(Clone, PartialEq, Eq)] #[derive(Clone, PartialEq, Eq)]
pub struct RustcOptGroup { pub struct RustcOptGroup {
pub opt_group: getopts::OptGroup, pub opt_group: getopts::OptGroup,
pub stability: OptionStability, pub stability: OptionStability,

View File

@ -10,7 +10,7 @@
use std::slice; use std::slice;
#[deriving(Clone)] #[derive(Clone)]
pub struct SearchPaths { pub struct SearchPaths {
paths: Vec<(PathKind, Path)>, paths: Vec<(PathKind, Path)>,
} }
@ -20,7 +20,7 @@ pub struct Iter<'a> {
iter: slice::Iter<'a, (PathKind, Path)>, iter: slice::Iter<'a, (PathKind, Path)>,
} }
#[deriving(Eq, PartialEq, Clone, Copy)] #[derive(Eq, PartialEq, Clone, Copy)]
pub enum PathKind { pub enum PathKind {
Native, Native,
Crate, Crate,

View File

@ -23,7 +23,7 @@ use syntax::visit::Visitor;
// Useful type to use with `Result<>` indicate that an error has already // Useful type to use with `Result<>` indicate that an error has already
// been reported to the user, so no need to continue checking. // been reported to the user, so no need to continue checking.
#[deriving(Clone, Copy, Show)] #[derive(Clone, Copy, Show)]
pub struct ErrorReported; pub struct ErrorReported;
pub fn time<T, U, F>(do_it: bool, what: &str, u: U, f: F) -> T where pub fn time<T, U, F>(do_it: bool, what: &str, u: U, f: F) -> T where

View File

@ -68,7 +68,7 @@ pub mod DefIdSet {
/// ///
/// This uses FNV hashing, as described here: /// This uses FNV hashing, as described here:
/// http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function /// http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
#[deriving(Clone, Copy, Default)] #[derive(Clone, Copy, Default)]
pub struct FnvHasher; pub struct FnvHasher;
#[allow(missing_copy_implementations)] #[allow(missing_copy_implementations)]

View File

@ -22,7 +22,7 @@ use self::UndoLog::*;
use std::mem; use std::mem;
#[deriving(PartialEq)] #[derive(PartialEq)]
pub enum UndoLog<T,U> { pub enum UndoLog<T,U> {
/// Indicates where a snapshot started. /// Indicates where a snapshot started.
OpenSnapshot, OpenSnapshot,

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