sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rs
This commit is contained in:
parent
8c5bb80d9b
commit
351409a622
231 changed files with 1115 additions and 1115 deletions
|
@ -13,7 +13,7 @@ use std::fmt;
|
|||
use std::str::FromStr;
|
||||
use regex::Regex;
|
||||
|
||||
#[deriving(Clone, PartialEq)]
|
||||
#[derive(Clone, PartialEq)]
|
||||
pub enum Mode {
|
||||
CompileFail,
|
||||
RunFail,
|
||||
|
@ -59,7 +59,7 @@ impl fmt::Show for Mode {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct Config {
|
||||
// The library paths required for running the compiler
|
||||
pub compile_lib_path: String,
|
||||
|
|
|
@ -30,7 +30,7 @@ pub struct ExpectedError {
|
|||
pub static EXPECTED_PATTERN : &'static str =
|
||||
r"//~(?P<follow>\|)?(?P<adjusts>\^*)\s*(?P<kind>\S*)\s*(?P<msg>.*)";
|
||||
|
||||
#[deriving(PartialEq, Show)]
|
||||
#[derive(PartialEq, Show)]
|
||||
enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) }
|
||||
|
||||
// Load any test directives embedded in the file
|
||||
|
|
|
@ -800,6 +800,6 @@ mod tests {
|
|||
}
|
||||
|
||||
// Make sure deriving works with Arc<T>
|
||||
#[deriving(Eq, Ord, PartialEq, PartialOrd, Clone, Show, Default)]
|
||||
#[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Show, Default)]
|
||||
struct Foo { inner: Arc<int> }
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ use std::rt::heap::{allocate, deallocate};
|
|||
// The way arena uses arrays is really deeply awful. The arrays are
|
||||
// allocated, and have capacities reserved, but the fill for the array
|
||||
// will always stay at 0.
|
||||
#[deriving(Clone, PartialEq)]
|
||||
#[derive(Clone, PartialEq)]
|
||||
struct Chunk {
|
||||
data: Rc<RefCell<Vec<u8>>>,
|
||||
fill: Cell<uint>,
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
//! use std::collections::BinaryHeap;
|
||||
//! use std::uint;
|
||||
//!
|
||||
//! #[deriving(Copy, Eq, PartialEq)]
|
||||
//! #[derive(Copy, Eq, PartialEq)]
|
||||
//! struct State {
|
||||
//! cost: uint,
|
||||
//! position: uint,
|
||||
|
@ -162,7 +162,7 @@ use vec::{self, Vec};
|
|||
/// A priority queue implemented with a binary heap.
|
||||
///
|
||||
/// This will be a max-heap.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[stable]
|
||||
pub struct BinaryHeap<T> {
|
||||
data: Vec<T>,
|
||||
|
@ -565,7 +565,7 @@ pub struct Iter <'a, T: 'a> {
|
|||
iter: slice::Iter<'a, T>,
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
|
||||
impl<'a, T> Clone for Iter<'a, T> {
|
||||
fn clone(&self) -> Iter<'a, T> {
|
||||
Iter { iter: self.iter.clone() }
|
||||
|
|
|
@ -1040,7 +1040,7 @@ impl cmp::Eq for Bitv {}
|
|||
|
||||
/// An iterator for `Bitv`.
|
||||
#[stable]
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct Iter<'a> {
|
||||
bitv: &'a Bitv,
|
||||
next_idx: uint,
|
||||
|
@ -1139,7 +1139,7 @@ impl<'a> RandomAccessIterator for Iter<'a> {
|
|||
/// let bv: Bitv = s.into_bitv();
|
||||
/// assert!(bv[3]);
|
||||
/// ```
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[stable]
|
||||
pub struct BitvSet {
|
||||
bitv: Bitv,
|
||||
|
@ -1784,7 +1784,7 @@ impl<S: hash::Writer> hash::Hash<S> for BitvSet {
|
|||
}
|
||||
|
||||
/// An iterator for `BitvSet`.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[stable]
|
||||
pub struct SetIter<'a> {
|
||||
set: &'a BitvSet,
|
||||
|
@ -1792,7 +1792,7 @@ pub struct SetIter<'a> {
|
|||
}
|
||||
|
||||
/// An iterator combining two `BitvSet` iterators.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct TwoBitPositions<'a> {
|
||||
set: &'a BitvSet,
|
||||
other: &'a BitvSet,
|
||||
|
|
|
@ -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
|
||||
/// done on each operation isn't *catastrophic*, and *is* still bounded by O(B log<sub>B</sub>n),
|
||||
/// it is certainly much slower when it does.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[stable]
|
||||
pub struct BTreeMap<K, V> {
|
||||
root: Node<K, V>,
|
||||
|
|
|
@ -496,7 +496,7 @@ impl<K: Clone, V: Clone> Clone for Node<K, V> {
|
|||
/// println!("Uninitialized memory: {}", handle.into_kv());
|
||||
/// }
|
||||
/// ```
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Handle<NodeRef, Type, NodeType> {
|
||||
node: NodeRef,
|
||||
index: uint
|
||||
|
|
|
@ -30,7 +30,7 @@ use btree_map::{BTreeMap, Keys};
|
|||
///
|
||||
/// See BTreeMap's documentation for a detailed discussion of this collection's performance
|
||||
/// benefits and drawbacks.
|
||||
#[deriving(Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]
|
||||
#[derive(Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]
|
||||
#[stable]
|
||||
pub struct BTreeSet<T>{
|
||||
map: BTreeMap<T, ()>,
|
||||
|
|
|
@ -84,7 +84,7 @@ pub struct IterMut<'a, T:'a> {
|
|||
}
|
||||
|
||||
/// An iterator over mutable references to the items of a `DList`.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[stable]
|
||||
pub struct IntoIter<T> {
|
||||
list: DList<T>
|
||||
|
|
|
@ -21,7 +21,7 @@ use core::ops::{Sub, BitOr, BitAnd, BitXor};
|
|||
|
||||
// FIXME(contentions): implement union family of methods? (general design may be wrong here)
|
||||
|
||||
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
/// A specialized set implementation to use enum types.
|
||||
pub struct EnumSet<E> {
|
||||
// We must maintain the invariant that no bits are set
|
||||
|
@ -223,7 +223,7 @@ pub struct Iter<E> {
|
|||
bits: uint,
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
|
||||
impl<E> Clone for Iter<E> {
|
||||
fn clone(&self) -> Iter<E> {
|
||||
Iter {
|
||||
|
@ -287,7 +287,7 @@ mod test {
|
|||
|
||||
use super::{EnumSet, CLike};
|
||||
|
||||
#[deriving(Copy, PartialEq, Show)]
|
||||
#[derive(Copy, PartialEq, Show)]
|
||||
#[repr(uint)]
|
||||
enum Foo {
|
||||
A, B, C
|
||||
|
@ -491,7 +491,7 @@ mod test {
|
|||
#[should_fail]
|
||||
fn test_overflow() {
|
||||
#[allow(dead_code)]
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
#[repr(uint)]
|
||||
enum Bar {
|
||||
V00, V01, V02, V03, V04, V05, V06, V07, V08, V09,
|
||||
|
|
|
@ -1139,7 +1139,7 @@ pub struct Iter<'a, T:'a> {
|
|||
head: uint
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
|
||||
impl<'a, T> Clone for Iter<'a, T> {
|
||||
fn clone(&self) -> Iter<'a, T> {
|
||||
Iter {
|
||||
|
@ -1674,21 +1674,21 @@ mod tests {
|
|||
})
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
enum Taggy {
|
||||
One(int),
|
||||
Two(int, int),
|
||||
Three(int, int, int),
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
enum Taggypar<T> {
|
||||
Onepar(int),
|
||||
Twopar(int, int),
|
||||
Threepar(int, int, int),
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
struct RecCy {
|
||||
x: int,
|
||||
y: int,
|
||||
|
|
|
@ -1083,7 +1083,7 @@ impl<T: Clone, V: AsSlice<T>> SliceConcatExt<T, Vec<T>> for [V] {
|
|||
/// The last generated swap is always (0, 1), and it returns the
|
||||
/// sequence to its initial order.
|
||||
#[experimental]
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct ElementSwaps {
|
||||
sdir: Vec<SizeDirection>,
|
||||
/// If `true`, emit the last swap that returns the sequence to initial
|
||||
|
@ -1130,11 +1130,11 @@ impl<T: Clone> ToOwned<Vec<T>> for [T] {
|
|||
// Iterators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[deriving(Copy, Clone)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum Direction { Pos, Neg }
|
||||
|
||||
/// An `Index` and `Direction` together.
|
||||
#[deriving(Copy, Clone)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct SizeDirection {
|
||||
size: uint,
|
||||
dir: Direction,
|
||||
|
@ -2709,7 +2709,7 @@ mod tests {
|
|||
assert!(values == [2, 3, 5, 6, 7]);
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq)]
|
||||
#[derive(Clone, PartialEq)]
|
||||
struct Foo;
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -165,7 +165,7 @@ fn canonical_sort(comb: &mut [(char, u8)]) {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
enum DecompositionType {
|
||||
Canonical,
|
||||
Compatible
|
||||
|
@ -173,7 +173,7 @@ enum DecompositionType {
|
|||
|
||||
/// External iterator for a string's decomposition's characters.
|
||||
/// Use with the `std::iter` module.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct Decompositions<'a> {
|
||||
kind: DecompositionType,
|
||||
iter: Chars<'a>,
|
||||
|
@ -252,7 +252,7 @@ impl<'a> Iterator for Decompositions<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
enum RecompositionState {
|
||||
Composing,
|
||||
Purging,
|
||||
|
@ -261,7 +261,7 @@ enum RecompositionState {
|
|||
|
||||
/// External iterator for a string's recomposition's characters.
|
||||
/// Use with the `std::iter` module.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct Recompositions<'a> {
|
||||
iter: Decompositions<'a>,
|
||||
state: RecompositionState,
|
||||
|
@ -356,7 +356,7 @@ impl<'a> Iterator for Recompositions<'a> {
|
|||
|
||||
/// External iterator for a string's UTF16 codeunits.
|
||||
/// Use with the `std::iter` module.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct Utf16Units<'a> {
|
||||
encoder: Utf16Encoder<Chars<'a>>
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ use str::{self, CharRange, FromStr, Utf8Error};
|
|||
use vec::{DerefVec, Vec, as_vec};
|
||||
|
||||
/// A growable string stored as a UTF-8 encoded buffer.
|
||||
#[deriving(Clone, PartialOrd, Eq, Ord)]
|
||||
#[derive(Clone, PartialOrd, Eq, Ord)]
|
||||
#[stable]
|
||||
pub struct String {
|
||||
vec: Vec<u8>,
|
||||
|
|
|
@ -795,7 +795,7 @@ impl<T> Vec<T> {
|
|||
/// let w = v.map_in_place(|i| i + 3);
|
||||
/// assert_eq!(w.as_slice(), [3, 4, 5].as_slice());
|
||||
///
|
||||
/// #[deriving(PartialEq, Show)]
|
||||
/// #[derive(PartialEq, Show)]
|
||||
/// struct Newtype(u8);
|
||||
/// let bytes = vec![0x11, 0x22];
|
||||
/// let newtyped_bytes = bytes.map_in_place(|x| Newtype(x));
|
||||
|
@ -2276,7 +2276,7 @@ mod tests {
|
|||
#[test]
|
||||
fn test_map_in_place_zero_sized() {
|
||||
let v = vec![(), ()];
|
||||
#[deriving(PartialEq, Show)]
|
||||
#[derive(PartialEq, Show)]
|
||||
struct ZeroSized;
|
||||
assert_eq!(v.map_in_place(|_| ZeroSized), [ZeroSized, ZeroSized]);
|
||||
}
|
||||
|
@ -2286,11 +2286,11 @@ mod tests {
|
|||
use std::sync::atomic;
|
||||
use std::sync::atomic::AtomicUint;
|
||||
|
||||
#[deriving(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
struct Nothing;
|
||||
impl Drop for Nothing { fn drop(&mut self) { } }
|
||||
|
||||
#[deriving(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
struct ZeroSized;
|
||||
impl Drop for ZeroSized {
|
||||
fn drop(&mut self) {
|
||||
|
|
|
@ -673,7 +673,7 @@ pub struct Iter<'a, V:'a> {
|
|||
iter: slice::Iter<'a, Option<V>>
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
|
||||
impl<'a, V> Clone for Iter<'a, V> {
|
||||
fn clone(&self) -> Iter<'a, V> {
|
||||
Iter {
|
||||
|
@ -705,7 +705,7 @@ pub struct Keys<'a, V: 'a> {
|
|||
iter: Map<(uint, &'a V), uint, Iter<'a, V>, fn((uint, &'a V)) -> uint>
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
|
||||
impl<'a, V> Clone for Keys<'a, V> {
|
||||
fn clone(&self) -> Keys<'a, V> {
|
||||
Keys {
|
||||
|
@ -720,7 +720,7 @@ pub struct Values<'a, V: 'a> {
|
|||
iter: Map<(uint, &'a V), &'a V, Iter<'a, V>, fn((uint, &'a V)) -> &'a V>
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
|
||||
impl<'a, V> Clone for Values<'a, V> {
|
||||
fn clone(&self) -> Values<'a, V> {
|
||||
Values {
|
||||
|
|
|
@ -62,7 +62,7 @@ unsafe impl<T> Sync for AtomicPtr<T> {}
|
|||
/// Rust's memory orderings are [the same as
|
||||
/// C++'s](http://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync).
|
||||
#[stable]
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub enum Ordering {
|
||||
/// No ordering constraints, only atomic operations.
|
||||
#[stable]
|
||||
|
|
|
@ -430,13 +430,13 @@ impl Char for char {
|
|||
|
||||
/// An iterator over the characters that represent a `char`, as escaped by
|
||||
/// Rust's unicode escaping rules.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct EscapeUnicode {
|
||||
c: char,
|
||||
state: EscapeUnicodeState
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
enum EscapeUnicodeState {
|
||||
Backslash,
|
||||
Type,
|
||||
|
@ -490,12 +490,12 @@ impl Iterator for EscapeUnicode {
|
|||
|
||||
/// An iterator over the characters that represent a `char`, escaped
|
||||
/// for maximum portability.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct EscapeDefault {
|
||||
state: EscapeDefaultState
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
enum EscapeDefaultState {
|
||||
Backslash(char),
|
||||
Char(char),
|
||||
|
|
|
@ -104,7 +104,7 @@ pub trait Eq for Sized?: PartialEq<Self> {
|
|||
}
|
||||
|
||||
/// An ordering is, e.g, a result of a comparison between two values.
|
||||
#[deriving(Clone, Copy, PartialEq, Show)]
|
||||
#[derive(Clone, Copy, PartialEq, Show)]
|
||||
#[stable]
|
||||
pub enum Ordering {
|
||||
/// An ordering where a compared value is less [than another].
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
//! ```
|
||||
//! use std::default::Default;
|
||||
//!
|
||||
//! #[deriving(Default)]
|
||||
//! #[derive(Default)]
|
||||
//! struct SomeOptions {
|
||||
//! foo: int,
|
||||
//! bar: f32,
|
||||
|
@ -54,7 +54,7 @@
|
|||
//! fn default() -> Kind { Kind::A }
|
||||
//! }
|
||||
//!
|
||||
//! #[deriving(Default)]
|
||||
//! #[derive(Default)]
|
||||
//! struct SomeOptions {
|
||||
//! foo: int,
|
||||
//! bar: f32,
|
||||
|
@ -71,7 +71,7 @@
|
|||
//!
|
||||
//! ```
|
||||
//! # use std::default::Default;
|
||||
//! # #[deriving(Default)]
|
||||
//! # #[derive(Default)]
|
||||
//! # struct SomeOptions {
|
||||
//! # foo: int,
|
||||
//! # bar: f32,
|
||||
|
@ -86,12 +86,12 @@
|
|||
/// A trait that types which have a useful default value should implement.
|
||||
///
|
||||
/// A struct can derive default implementations of `Default` for basic types using
|
||||
/// `#[deriving(Default)]`.
|
||||
/// `#[derive(Default)]`.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #[deriving(Default)]
|
||||
/// #[derive(Default)]
|
||||
/// struct SomeOptions {
|
||||
/// foo: int,
|
||||
/// bar: f32,
|
||||
|
|
|
@ -44,7 +44,7 @@ pub type Result = result::Result<(), Error>;
|
|||
/// occurred. Any extra information must be arranged to be transmitted through
|
||||
/// some other means.
|
||||
#[experimental = "core and I/O reconciliation may alter this definition"]
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Error;
|
||||
|
||||
/// A collection of methods that are required to format a message into a stream.
|
||||
|
@ -122,7 +122,7 @@ enum Void {}
|
|||
/// compile time it is ensured that the function and the value have the correct
|
||||
/// types, and then this struct is used to canonicalize arguments to one type.
|
||||
#[experimental = "implementation detail of the `format_args!` macro"]
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Argument<'a> {
|
||||
value: &'a Void,
|
||||
formatter: fn(&Void, &mut Formatter) -> Result,
|
||||
|
@ -199,7 +199,7 @@ impl<'a> Arguments<'a> {
|
|||
/// macro validates the format string at compile-time so usage of the `write`
|
||||
/// and `format` functions can be safely performed.
|
||||
#[stable]
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Arguments<'a> {
|
||||
// Format string pieces to print.
|
||||
pieces: &'a [&'a str],
|
||||
|
|
|
@ -67,23 +67,23 @@ trait GenericRadix {
|
|||
}
|
||||
|
||||
/// A binary (base 2) radix
|
||||
#[deriving(Clone, PartialEq)]
|
||||
#[derive(Clone, PartialEq)]
|
||||
struct Binary;
|
||||
|
||||
/// An octal (base 8) radix
|
||||
#[deriving(Clone, PartialEq)]
|
||||
#[derive(Clone, PartialEq)]
|
||||
struct Octal;
|
||||
|
||||
/// A decimal (base 10) radix
|
||||
#[deriving(Clone, PartialEq)]
|
||||
#[derive(Clone, PartialEq)]
|
||||
struct Decimal;
|
||||
|
||||
/// A hexadecimal (base 16) radix, formatted with lower-case characters
|
||||
#[deriving(Clone, PartialEq)]
|
||||
#[derive(Clone, PartialEq)]
|
||||
struct LowerHex;
|
||||
|
||||
/// A hexadecimal (base 16) radix, formatted with upper-case characters
|
||||
#[deriving(Clone, PartialEq)]
|
||||
#[derive(Clone, PartialEq)]
|
||||
pub struct UpperHex;
|
||||
|
||||
macro_rules! radix {
|
||||
|
@ -110,7 +110,7 @@ radix! { UpperHex, 16, "0x", x @ 0 ... 9 => b'0' + x,
|
|||
x @ 10 ... 15 => b'A' + (x - 10) }
|
||||
|
||||
/// A radix with in the range of `2..36`.
|
||||
#[deriving(Clone, Copy, PartialEq)]
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
#[unstable = "may be renamed or move to a different module"]
|
||||
pub struct Radix {
|
||||
base: u8,
|
||||
|
@ -136,7 +136,7 @@ impl GenericRadix for Radix {
|
|||
|
||||
/// A helper type for formatting radixes.
|
||||
#[unstable = "may be renamed or move to a different module"]
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct RadixFmt<T, R>(T, R);
|
||||
|
||||
/// Constructs a radix formatter in the range of `2..36`.
|
||||
|
|
|
@ -22,14 +22,14 @@ pub use self::Position::*;
|
|||
pub use self::Flag::*;
|
||||
|
||||
#[doc(hidden)]
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Argument<'a> {
|
||||
pub position: Position,
|
||||
pub format: FormatSpec,
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct FormatSpec {
|
||||
pub fill: char,
|
||||
pub align: Alignment,
|
||||
|
@ -39,7 +39,7 @@ pub struct FormatSpec {
|
|||
}
|
||||
|
||||
/// Possible alignments that can be requested as part of a formatting directive.
|
||||
#[deriving(Copy, PartialEq)]
|
||||
#[derive(Copy, PartialEq)]
|
||||
pub enum Alignment {
|
||||
/// Indication that contents should be left-aligned.
|
||||
AlignLeft,
|
||||
|
@ -52,13 +52,13 @@ pub enum Alignment {
|
|||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub enum Count {
|
||||
CountIs(uint), CountIsParam(uint), CountIsNextParam, CountImplied,
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub enum Position {
|
||||
ArgumentNext, ArgumentIs(uint)
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ pub enum Position {
|
|||
/// These flags are discovered through the `flags` field of the `Formatter`
|
||||
/// structure. The flag in that structure is a union of these flags into a
|
||||
/// `uint` where each flag's discriminant is the corresponding bit.
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub enum Flag {
|
||||
/// A flag which enables number formatting to always print the sign of a
|
||||
/// number.
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
//! Generic hashing support.
|
||||
//!
|
||||
//! This module provides a generic way to compute the hash of a value. The
|
||||
//! simplest way to make a type hashable is to use `#[deriving(Hash)]`:
|
||||
//! simplest way to make a type hashable is to use `#[derive(Hash)]`:
|
||||
//!
|
||||
//! # Examples
|
||||
//!
|
||||
|
@ -19,7 +19,7 @@
|
|||
//! use std::hash;
|
||||
//! use std::hash::Hash;
|
||||
//!
|
||||
//! #[deriving(Hash)]
|
||||
//! #[derive(Hash)]
|
||||
//! struct Person {
|
||||
//! id: uint,
|
||||
//! name: String,
|
||||
|
|
|
@ -30,7 +30,7 @@ use default::Default;
|
|||
use super::{Hash, Hasher, Writer};
|
||||
|
||||
/// `SipState` computes a SipHash 2-4 hash over a stream of bytes.
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct SipState {
|
||||
k0: u64,
|
||||
k1: u64,
|
||||
|
@ -213,7 +213,7 @@ impl Default for SipState {
|
|||
}
|
||||
|
||||
/// `SipHasher` computes the SipHash algorithm from a stream of bytes.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[allow(missing_copy_implementations)]
|
||||
pub struct SipHasher {
|
||||
k0: u64,
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
pub type GlueFn = extern "Rust" fn(*const i8);
|
||||
|
||||
#[lang="ty_desc"]
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct TyDesc {
|
||||
// sizeof(T)
|
||||
pub size: uint,
|
||||
|
@ -545,7 +545,7 @@ extern "rust-intrinsic" {
|
|||
/// `TypeId` represents a globally unique identifier for a type
|
||||
#[lang="type_id"] // This needs to be kept in lockstep with the code in trans/intrinsic.rs and
|
||||
// middle/lang_items.rs
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, Show)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Show)]
|
||||
pub struct TypeId {
|
||||
t: u64,
|
||||
}
|
||||
|
|
|
@ -885,7 +885,7 @@ impl<A, B, I, F> ExactSizeIterator for Map<A, B, I, F> where
|
|||
impl<A, B> ExactSizeIterator for Zip<A, B> where A: ExactSizeIterator, B: ExactSizeIterator {}
|
||||
|
||||
/// An double-ended iterator with the direction inverted
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
|
||||
#[stable]
|
||||
pub struct Rev<T> {
|
||||
|
@ -1153,7 +1153,7 @@ impl<T, I> IteratorOrdExt<T> for I where I: Iterator<Item=T>, T: Ord {
|
|||
}
|
||||
|
||||
/// `MinMaxResult` is an enum returned by `min_max`. See `IteratorOrdExt::min_max` for more detail.
|
||||
#[deriving(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
#[unstable = "waiting on namespaced enum conventions"]
|
||||
pub enum MinMaxResult<T> {
|
||||
/// Empty iterator
|
||||
|
@ -1280,7 +1280,7 @@ impl<I> CloneIteratorExt for I where I: Iterator + Clone {
|
|||
}
|
||||
|
||||
/// An iterator that repeats endlessly
|
||||
#[deriving(Clone, Copy)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
|
||||
#[stable]
|
||||
pub struct Cycle<I> {
|
||||
|
@ -1338,7 +1338,7 @@ impl<I> RandomAccessIterator for Cycle<I> where
|
|||
}
|
||||
|
||||
/// An iterator that strings two iterators together
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
|
||||
#[stable]
|
||||
pub struct Chain<A, B> {
|
||||
|
@ -1418,7 +1418,7 @@ impl<T, A, B> RandomAccessIterator for Chain<A, B> where
|
|||
}
|
||||
|
||||
/// An iterator that iterates two other iterators simultaneously
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
|
||||
#[stable]
|
||||
pub struct Zip<A, B> {
|
||||
|
@ -1517,7 +1517,7 @@ pub struct Map<A, B, I: Iterator<Item=A>, F: FnMut(A) -> B> {
|
|||
f: F,
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
|
||||
#[stable]
|
||||
impl<A, B, I, F> Clone for Map<A, B, I, F> where
|
||||
I: Clone + Iterator<Item=A>,
|
||||
|
@ -1594,7 +1594,7 @@ pub struct Filter<A, I, P> where I: Iterator<Item=A>, P: FnMut(&A) -> bool {
|
|||
predicate: P,
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
|
||||
#[stable]
|
||||
impl<A, I, P> Clone for Filter<A, I, P> where
|
||||
I: Clone + Iterator<Item=A>,
|
||||
|
@ -1655,7 +1655,7 @@ pub struct FilterMap<A, B, I, F> where I: Iterator<Item=A>, F: FnMut(A) -> Optio
|
|||
f: F,
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
|
||||
#[stable]
|
||||
impl<A, B, I, F> Clone for FilterMap<A, B, I, F> where
|
||||
I: Clone + Iterator<Item=A>,
|
||||
|
@ -1712,7 +1712,7 @@ impl<A, B, I, F> DoubleEndedIterator for FilterMap<A, B, I, F> where
|
|||
}
|
||||
|
||||
/// An iterator that yields the current count and the element during iteration
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
|
||||
#[stable]
|
||||
pub struct Enumerate<I> {
|
||||
|
@ -1775,7 +1775,7 @@ impl<I> RandomAccessIterator for Enumerate<I> where I: RandomAccessIterator {
|
|||
/// An iterator with a `peek()` that returns an optional reference to the next element.
|
||||
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
|
||||
#[stable]
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Peekable<T, I> where I: Iterator<Item=T> {
|
||||
iter: I,
|
||||
peeked: Option<T>,
|
||||
|
@ -1837,7 +1837,7 @@ pub struct SkipWhile<A, I, P> where I: Iterator<Item=A>, P: FnMut(&A) -> bool {
|
|||
predicate: P,
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
|
||||
#[stable]
|
||||
impl<A, I, P> Clone for SkipWhile<A, I, P> where
|
||||
I: Clone + Iterator<Item=A>,
|
||||
|
@ -1883,7 +1883,7 @@ pub struct TakeWhile<A, I, P> where I: Iterator<Item=A>, P: FnMut(&A) -> bool {
|
|||
predicate: P,
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
|
||||
#[stable]
|
||||
impl<A, I, P> Clone for TakeWhile<A, I, P> where
|
||||
I: Clone + Iterator<Item=A>,
|
||||
|
@ -1929,7 +1929,7 @@ impl<A, I, P> Iterator for TakeWhile<A, I, P> where I: Iterator<Item=A>, P: FnMu
|
|||
}
|
||||
|
||||
/// An iterator that skips over `n` elements of `iter`.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
|
||||
#[stable]
|
||||
pub struct Skip<I> {
|
||||
|
@ -1999,7 +1999,7 @@ impl<I> RandomAccessIterator for Skip<I> where I: RandomAccessIterator{
|
|||
}
|
||||
|
||||
/// An iterator that only iterates over the first `n` iterations of `iter`.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
|
||||
#[stable]
|
||||
pub struct Take<I> {
|
||||
|
@ -2065,7 +2065,7 @@ pub struct Scan<A, B, I, St, F> where I: Iterator, F: FnMut(&mut St, A) -> Optio
|
|||
pub state: St,
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
|
||||
#[stable]
|
||||
impl<A, B, I, St, F> Clone for Scan<A, B, I, St, F> where
|
||||
I: Clone + Iterator<Item=A>,
|
||||
|
@ -2116,7 +2116,7 @@ pub struct FlatMap<A, B, I, U, F> where
|
|||
backiter: Option<U>,
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
|
||||
#[stable]
|
||||
impl<A, B, I, U, F> Clone for FlatMap<A, B, I, U, F> where
|
||||
I: Clone + Iterator<Item=A>,
|
||||
|
@ -2193,7 +2193,7 @@ impl<A, B, I, U, F> DoubleEndedIterator for FlatMap<A, B, I, U, F> where
|
|||
|
||||
/// An iterator that yields `None` forever after the underlying iterator
|
||||
/// yields `None` once.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
|
||||
#[stable]
|
||||
pub struct Fuse<I> {
|
||||
|
@ -2281,7 +2281,7 @@ pub struct Inspect<A, I, F> where I: Iterator<Item=A>, F: FnMut(&A) {
|
|||
f: F,
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
|
||||
#[stable]
|
||||
impl<A, I, F> Clone for Inspect<A, I, F> where
|
||||
I: Clone + Iterator<Item=A>,
|
||||
|
@ -2391,7 +2391,7 @@ pub struct Unfold<A, St, F> where F: FnMut(&mut St) -> Option<A> {
|
|||
pub state: St,
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
|
||||
#[stable]
|
||||
impl<A, St, F> Clone for Unfold<A, St, F> where
|
||||
F: Clone + FnMut(&mut St) -> Option<A>,
|
||||
|
@ -2436,7 +2436,7 @@ impl<A, St, F> Iterator for Unfold<A, St, F> where F: FnMut(&mut St) -> Option<A
|
|||
|
||||
/// An infinite iterator starting at `start` and advancing by `step` with each
|
||||
/// iteration
|
||||
#[deriving(Clone, Copy)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[unstable = "may be renamed"]
|
||||
pub struct Counter<A> {
|
||||
/// The current state the counter is at (next value to be yielded)
|
||||
|
@ -2470,7 +2470,7 @@ impl<A: Add<Output=A> + Clone> Iterator for Counter<A> {
|
|||
}
|
||||
|
||||
/// An iterator over the range [start, stop)
|
||||
#[deriving(Clone, Copy)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[unstable = "may be refactored due to numerics reform or ops reform"]
|
||||
pub struct Range<A> {
|
||||
state: A,
|
||||
|
@ -2565,7 +2565,7 @@ impl<A: Int + ToPrimitive> DoubleEndedIterator for Range<A> {
|
|||
}
|
||||
|
||||
/// An iterator over the range [start, stop]
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[unstable = "may be refactored due to numerics reform or ops reform"]
|
||||
pub struct RangeInclusive<A> {
|
||||
range: Range<A>,
|
||||
|
@ -2635,7 +2635,7 @@ impl<A: Int + ToPrimitive> DoubleEndedIterator for RangeInclusive<A> {
|
|||
}
|
||||
|
||||
/// An iterator over the range [start, stop) by `step`. It handles overflow by stopping.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[unstable = "may be refactored due to numerics reform or ops reform"]
|
||||
pub struct RangeStep<A> {
|
||||
state: A,
|
||||
|
@ -2672,7 +2672,7 @@ impl<A: Int> Iterator for RangeStep<A> {
|
|||
}
|
||||
|
||||
/// An iterator over the range [start, stop] by `step`. It handles overflow by stopping.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[unstable = "may be refactored due to numerics reform or ops reform"]
|
||||
pub struct RangeStepInclusive<A> {
|
||||
state: A,
|
||||
|
@ -2775,7 +2775,7 @@ step_impl_no_between!(u64 i64);
|
|||
|
||||
|
||||
/// An iterator that repeats an element endlessly
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[stable]
|
||||
pub struct Repeat<A> {
|
||||
element: A
|
||||
|
|
|
@ -132,7 +132,7 @@ pub mod marker {
|
|||
/// (for example, `S<&'static int>` is a subtype of `S<&'a int>`
|
||||
/// for some lifetime `'a`, but not the other way around).
|
||||
#[lang="covariant_type"]
|
||||
#[deriving(PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct CovariantType<Sized? T>;
|
||||
|
||||
impl<Sized? T> Copy for CovariantType<T> {}
|
||||
|
@ -180,7 +180,7 @@ pub mod marker {
|
|||
/// function requires arguments of type `T`, it must also accept
|
||||
/// arguments of type `U`, hence such a conversion is safe.
|
||||
#[lang="contravariant_type"]
|
||||
#[deriving(PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct ContravariantType<Sized? T>;
|
||||
|
||||
impl<Sized? T> Copy for ContravariantType<T> {}
|
||||
|
@ -210,7 +210,7 @@ pub mod marker {
|
|||
/// never written, but in fact `Cell` uses unsafe code to achieve
|
||||
/// interior mutability.
|
||||
#[lang="invariant_type"]
|
||||
#[deriving(PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct InvariantType<Sized? T>;
|
||||
|
||||
impl<Sized? T> Copy for InvariantType<T> {}
|
||||
|
@ -235,7 +235,7 @@ pub mod marker {
|
|||
/// For more information about variance, refer to this Wikipedia
|
||||
/// article <http://en.wikipedia.org/wiki/Variance_%28computer_science%29>.
|
||||
#[lang="covariant_lifetime"]
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct CovariantLifetime<'a>;
|
||||
|
||||
/// As `ContravariantType`, but for lifetime parameters. Using
|
||||
|
@ -251,7 +251,7 @@ pub mod marker {
|
|||
/// For more information about variance, refer to this Wikipedia
|
||||
/// article <http://en.wikipedia.org/wiki/Variance_%28computer_science%29>.
|
||||
#[lang="contravariant_lifetime"]
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct ContravariantLifetime<'a>;
|
||||
|
||||
/// As `InvariantType`, but for lifetime parameters. Using
|
||||
|
@ -262,7 +262,7 @@ pub mod marker {
|
|||
/// and this pointer is itself stored in an inherently mutable
|
||||
/// location (such as a `Cell`).
|
||||
#[lang="invariant_lifetime"]
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct InvariantLifetime<'a>;
|
||||
|
||||
/// A type which is considered "not sendable", meaning that it cannot
|
||||
|
@ -270,14 +270,14 @@ pub mod marker {
|
|||
/// typically embedded in other types, such as `Gc`, to ensure that
|
||||
/// their instances remain thread-local.
|
||||
#[lang="no_send_bound"]
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct NoSend;
|
||||
|
||||
/// A type which is considered "not POD", meaning that it is not
|
||||
/// implicitly copyable. This is typically embedded in other types to
|
||||
/// ensure that they are never copied, even if they lack a destructor.
|
||||
#[lang="no_copy_bound"]
|
||||
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[allow(missing_copy_implementations)]
|
||||
pub struct NoCopy;
|
||||
|
||||
|
@ -285,13 +285,13 @@ pub mod marker {
|
|||
/// its contents are not threadsafe, hence they cannot be
|
||||
/// shared between tasks.
|
||||
#[lang="no_sync_bound"]
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct NoSync;
|
||||
|
||||
/// A type which is considered managed by the GC. This is typically
|
||||
/// embedded in other types.
|
||||
#[lang="managed_bound"]
|
||||
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[allow(missing_copy_implementations)]
|
||||
pub struct Managed;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ unsafe impl Zeroable for u64 {}
|
|||
/// A wrapper type for raw pointers and integers that will never be
|
||||
/// NULL or 0 that might allow certain optimizations.
|
||||
#[lang="non_zero"]
|
||||
#[deriving(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Show)]
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Show)]
|
||||
#[experimental]
|
||||
pub struct NonZero<T: Zeroable>(T);
|
||||
|
||||
|
|
|
@ -1218,7 +1218,7 @@ impl_num_cast! { f32, to_f32 }
|
|||
impl_num_cast! { f64, to_f64 }
|
||||
|
||||
/// Used for representing the classification of floating point numbers
|
||||
#[deriving(Copy, PartialEq, Show)]
|
||||
#[derive(Copy, PartialEq, Show)]
|
||||
#[unstable = "may be renamed"]
|
||||
pub enum FpCategory {
|
||||
/// "Not a Number", often obtained by dividing by zero
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
//!
|
||||
//! use std::ops::{Add, Sub};
|
||||
//!
|
||||
//! #[deriving(Show)]
|
||||
//! #[derive(Show)]
|
||||
//! struct Point {
|
||||
//! x: int,
|
||||
//! y: int
|
||||
|
@ -103,7 +103,7 @@ pub trait Drop {
|
|||
///
|
||||
/// use std::ops::Add;
|
||||
///
|
||||
/// #[deriving(Copy)]
|
||||
/// #[derive(Copy)]
|
||||
/// struct Foo;
|
||||
///
|
||||
/// impl Add for Foo {
|
||||
|
@ -152,7 +152,7 @@ add_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 }
|
|||
///
|
||||
/// use std::ops::Sub;
|
||||
///
|
||||
/// #[deriving(Copy)]
|
||||
/// #[derive(Copy)]
|
||||
/// struct Foo;
|
||||
///
|
||||
/// impl Sub for Foo {
|
||||
|
@ -201,7 +201,7 @@ sub_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 }
|
|||
///
|
||||
/// use std::ops::Mul;
|
||||
///
|
||||
/// #[deriving(Copy)]
|
||||
/// #[derive(Copy)]
|
||||
/// struct Foo;
|
||||
///
|
||||
/// impl Mul for Foo {
|
||||
|
@ -250,7 +250,7 @@ mul_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 }
|
|||
///
|
||||
/// use std::ops::Div;
|
||||
///
|
||||
/// #[deriving(Copy)]
|
||||
/// #[derive(Copy)]
|
||||
/// struct Foo;
|
||||
///
|
||||
/// impl Div for Foo {
|
||||
|
@ -299,7 +299,7 @@ div_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 }
|
|||
///
|
||||
/// use std::ops::Rem;
|
||||
///
|
||||
/// #[deriving(Copy)]
|
||||
/// #[derive(Copy)]
|
||||
/// struct Foo;
|
||||
///
|
||||
/// impl Rem for Foo {
|
||||
|
@ -482,7 +482,7 @@ not_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 }
|
|||
///
|
||||
/// use std::ops::BitAnd;
|
||||
///
|
||||
/// #[deriving(Copy)]
|
||||
/// #[derive(Copy)]
|
||||
/// struct Foo;
|
||||
///
|
||||
/// impl BitAnd for Foo {
|
||||
|
@ -531,7 +531,7 @@ bitand_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 }
|
|||
///
|
||||
/// use std::ops::BitOr;
|
||||
///
|
||||
/// #[deriving(Copy)]
|
||||
/// #[derive(Copy)]
|
||||
/// struct Foo;
|
||||
///
|
||||
/// impl BitOr for Foo {
|
||||
|
@ -580,7 +580,7 @@ bitor_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 }
|
|||
///
|
||||
/// use std::ops::BitXor;
|
||||
///
|
||||
/// #[deriving(Copy)]
|
||||
/// #[derive(Copy)]
|
||||
/// struct Foo;
|
||||
///
|
||||
/// impl BitXor for Foo {
|
||||
|
@ -629,7 +629,7 @@ bitxor_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 }
|
|||
///
|
||||
/// use std::ops::Shl;
|
||||
///
|
||||
/// #[deriving(Copy)]
|
||||
/// #[derive(Copy)]
|
||||
/// struct Foo;
|
||||
///
|
||||
/// impl Shl<Foo> for Foo {
|
||||
|
@ -680,7 +680,7 @@ shl_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 }
|
|||
///
|
||||
/// use std::ops::Shr;
|
||||
///
|
||||
/// #[deriving(Copy)]
|
||||
/// #[derive(Copy)]
|
||||
/// struct Foo;
|
||||
///
|
||||
/// impl Shr<Foo> for Foo {
|
||||
|
@ -739,7 +739,7 @@ pub trait Index<Sized? Index, Sized? Result> for Sized? {
|
|||
///
|
||||
/// use std::ops::Index;
|
||||
///
|
||||
/// #[deriving(Copy)]
|
||||
/// #[derive(Copy)]
|
||||
/// struct Foo;
|
||||
///
|
||||
/// impl Index<Foo> for Foo {
|
||||
|
@ -786,7 +786,7 @@ pub trait IndexMut<Sized? Index, Sized? Result> for Sized? {
|
|||
///
|
||||
/// use std::ops::IndexMut;
|
||||
///
|
||||
/// #[deriving(Copy)]
|
||||
/// #[derive(Copy)]
|
||||
/// struct Foo;
|
||||
///
|
||||
/// impl IndexMut<Foo> for Foo {
|
||||
|
@ -822,7 +822,7 @@ pub trait IndexMut<Sized? Index> for Sized? {
|
|||
/// ```ignore
|
||||
/// use std::ops::Slice;
|
||||
///
|
||||
/// #[deriving(Copy)]
|
||||
/// #[derive(Copy)]
|
||||
/// struct Foo;
|
||||
///
|
||||
/// impl Slice<Foo, Foo> for Foo {
|
||||
|
@ -871,7 +871,7 @@ pub trait Slice<Sized? Idx, Sized? Result> for Sized? {
|
|||
/// ```ignore
|
||||
/// use std::ops::SliceMut;
|
||||
///
|
||||
/// #[deriving(Copy)]
|
||||
/// #[derive(Copy)]
|
||||
/// struct Foo;
|
||||
///
|
||||
/// impl SliceMut<Foo, Foo> for Foo {
|
||||
|
@ -911,12 +911,12 @@ pub trait SliceMut<Sized? Idx, Sized? Result> for Sized? {
|
|||
|
||||
|
||||
/// An unbounded range.
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
#[lang="full_range"]
|
||||
pub struct FullRange;
|
||||
|
||||
/// A (half-open) range which is bounded at both ends.
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
#[lang="range"]
|
||||
pub struct Range<Idx> {
|
||||
/// The lower bound of the range (inclusive).
|
||||
|
@ -966,7 +966,7 @@ impl<Idx: Clone + Step> DoubleEndedIterator for Range<Idx> {
|
|||
impl<Idx: Clone + Step> ExactSizeIterator for Range<Idx> {}
|
||||
|
||||
/// A range which is only bounded below.
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
#[lang="range_from"]
|
||||
pub struct RangeFrom<Idx> {
|
||||
/// The lower bound of the range (inclusive).
|
||||
|
@ -986,7 +986,7 @@ impl<Idx: Clone + Step> Iterator for RangeFrom<Idx> {
|
|||
}
|
||||
|
||||
/// A range which is only bounded above.
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
#[lang="range_to"]
|
||||
pub struct RangeTo<Idx> {
|
||||
/// The upper bound of the range (exclusive).
|
||||
|
|
|
@ -163,7 +163,7 @@ use ops::{Deref, FnOnce};
|
|||
// which basically means it must be `Option`.
|
||||
|
||||
/// The `Option` type.
|
||||
#[deriving(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Show, Hash)]
|
||||
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Show, Hash)]
|
||||
#[stable]
|
||||
pub enum Option<T> {
|
||||
/// No value
|
||||
|
@ -772,7 +772,7 @@ impl<T> Default for Option<T> {
|
|||
// The Option Iterators
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct Item<A> {
|
||||
opt: Option<A>
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ impl<T> Copy for Slice<T> {}
|
|||
|
||||
/// The representation of a Rust closure
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Closure {
|
||||
pub code: *mut (),
|
||||
pub env: *mut (),
|
||||
|
@ -44,7 +44,7 @@ pub struct Closure {
|
|||
/// This struct does not have a `Repr` implementation
|
||||
/// because there is no way to refer to all trait objects generically.
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct TraitObject {
|
||||
pub data: *mut (),
|
||||
pub vtable: *mut (),
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
//! defined and used like so:
|
||||
//!
|
||||
//! ```
|
||||
//! #[deriving(Show)]
|
||||
//! #[derive(Show)]
|
||||
//! enum Version { Version1, Version2 }
|
||||
//!
|
||||
//! fn parse_version(header: &[u8]) -> Result<Version, &'static str> {
|
||||
|
@ -243,7 +243,7 @@ use slice;
|
|||
/// `Result` is a type that represents either success (`Ok`) or failure (`Err`).
|
||||
///
|
||||
/// See the [`std::result`](index.html) module documentation for details.
|
||||
#[deriving(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Show, Hash)]
|
||||
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Show, Hash)]
|
||||
#[must_use]
|
||||
#[stable]
|
||||
pub enum Result<T, E> {
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
#[repr(C)]
|
||||
pub struct i8x16(pub i8, pub i8, pub i8, pub i8,
|
||||
pub i8, pub i8, pub i8, pub i8,
|
||||
|
@ -48,26 +48,26 @@ pub struct i8x16(pub i8, pub i8, pub i8, pub i8,
|
|||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
#[repr(C)]
|
||||
pub struct i16x8(pub i16, pub i16, pub i16, pub i16,
|
||||
pub i16, pub i16, pub i16, pub i16);
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
#[repr(C)]
|
||||
pub struct i32x4(pub i32, pub i32, pub i32, pub i32);
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
#[repr(C)]
|
||||
pub struct i64x2(pub i64, pub i64);
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
#[repr(C)]
|
||||
pub struct u8x16(pub u8, pub u8, pub u8, pub u8,
|
||||
pub u8, pub u8, pub u8, pub u8,
|
||||
|
@ -76,31 +76,31 @@ pub struct u8x16(pub u8, pub u8, pub u8, pub u8,
|
|||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
#[repr(C)]
|
||||
pub struct u16x8(pub u16, pub u16, pub u16, pub u16,
|
||||
pub u16, pub u16, pub u16, pub u16);
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
#[repr(C)]
|
||||
pub struct u32x4(pub u32, pub u32, pub u32, pub u32);
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
#[repr(C)]
|
||||
pub struct u64x2(pub u64, pub u64);
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
#[repr(C)]
|
||||
pub struct f32x4(pub f32, pub f32, pub f32, pub f32);
|
||||
|
||||
#[experimental]
|
||||
#[simd]
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
#[repr(C)]
|
||||
pub struct f64x2(pub f64, pub f64);
|
||||
|
|
|
@ -907,7 +907,7 @@ pub struct Split<'a, T:'a, P> where P: FnMut(&T) -> bool {
|
|||
finished: bool
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
|
||||
#[stable]
|
||||
impl<'a, T, P> Clone for Split<'a, T, P> where P: Clone + FnMut(&T) -> bool {
|
||||
fn clone(&self) -> Split<'a, T, P> {
|
||||
|
@ -1133,7 +1133,7 @@ forward_iterator! { SplitNMut: T, &'a mut [T] }
|
|||
forward_iterator! { RSplitNMut: T, &'a mut [T] }
|
||||
|
||||
/// An iterator over overlapping subslices of length `size`.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[experimental = "needs review"]
|
||||
pub struct Windows<'a, T:'a> {
|
||||
v: &'a [T],
|
||||
|
@ -1170,7 +1170,7 @@ impl<'a, T> Iterator for Windows<'a, T> {
|
|||
///
|
||||
/// When the slice len is not evenly divided by the chunk size, the last slice
|
||||
/// of the iteration will be the remainder.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[experimental = "needs review"]
|
||||
pub struct Chunks<'a, T:'a> {
|
||||
v: &'a [T],
|
||||
|
|
|
@ -147,7 +147,7 @@ Section: Creating a string
|
|||
*/
|
||||
|
||||
/// Errors which can occur when attempting to interpret a byte slice as a `str`.
|
||||
#[deriving(Copy, Eq, PartialEq, Clone)]
|
||||
#[derive(Copy, Eq, PartialEq, Clone)]
|
||||
pub enum Utf8Error {
|
||||
/// An invalid byte was detected at the byte offset given.
|
||||
///
|
||||
|
@ -252,7 +252,7 @@ Section: Iterators
|
|||
/// Iterator for the char (representing *Unicode Scalar Values*) of a string
|
||||
///
|
||||
/// Created with the method `.chars()`.
|
||||
#[deriving(Clone, Copy)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct Chars<'a> {
|
||||
iter: slice::Iter<'a, u8>
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ impl<'a> DoubleEndedIterator for Chars<'a> {
|
|||
|
||||
/// External iterator for a string's characters and their byte offsets.
|
||||
/// Use with the `std::iter` module.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct CharIndices<'a> {
|
||||
front_offset: uint,
|
||||
iter: Chars<'a>,
|
||||
|
@ -409,13 +409,13 @@ impl<'a> DoubleEndedIterator for CharIndices<'a> {
|
|||
///
|
||||
/// Created with `StrExt::bytes`
|
||||
#[stable]
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct Bytes<'a>(Map<&'a u8, u8, slice::Iter<'a, u8>, BytesDeref>);
|
||||
delegate_iter!{exact u8 in Bytes<'a>}
|
||||
|
||||
/// A temporary fn new type that ensures that the `Bytes` iterator
|
||||
/// is cloneable.
|
||||
#[deriving(Copy, Clone)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct BytesDeref;
|
||||
|
||||
impl<'a> Fn(&'a u8) -> u8 for BytesDeref {
|
||||
|
@ -426,7 +426,7 @@ impl<'a> Fn(&'a u8) -> u8 for BytesDeref {
|
|||
}
|
||||
|
||||
/// An iterator over the substrings of a string, separated by `sep`.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[deprecated = "Type is now named `Split` or `SplitTerminator`"]
|
||||
pub struct CharSplits<'a, Sep> {
|
||||
/// The slice remaining to be iterated
|
||||
|
@ -440,7 +440,7 @@ pub struct CharSplits<'a, Sep> {
|
|||
|
||||
/// An iterator over the substrings of a string, separated by `sep`,
|
||||
/// splitting at most `count` times.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[deprecated = "Type is now named `SplitN` or `RSplitN`"]
|
||||
pub struct CharSplitsN<'a, Sep> {
|
||||
iter: CharSplits<'a, Sep>,
|
||||
|
@ -564,7 +564,7 @@ impl<'a, Sep: CharEq> Iterator for CharSplitsN<'a, Sep> {
|
|||
|
||||
/// The internal state of an iterator that searches for matches of a substring
|
||||
/// within a larger string using naive search
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct NaiveSearcher {
|
||||
position: uint
|
||||
}
|
||||
|
@ -590,7 +590,7 @@ impl NaiveSearcher {
|
|||
|
||||
/// The internal state of an iterator that searches for matches of a substring
|
||||
/// within a larger string using two-way search
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct TwoWaySearcher {
|
||||
// constants
|
||||
crit_pos: uint,
|
||||
|
@ -827,7 +827,7 @@ impl TwoWaySearcher {
|
|||
|
||||
/// The internal state of an iterator that searches for matches of a substring
|
||||
/// within a larger string using a dynamically chosen search algorithm
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
enum Searcher {
|
||||
Naive(NaiveSearcher),
|
||||
TwoWay(TwoWaySearcher),
|
||||
|
@ -855,7 +855,7 @@ impl Searcher {
|
|||
|
||||
/// An iterator over the start and end indices of the matches of a
|
||||
/// substring within a larger string
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct MatchIndices<'a> {
|
||||
// constants
|
||||
haystack: &'a str,
|
||||
|
@ -865,7 +865,7 @@ pub struct MatchIndices<'a> {
|
|||
|
||||
/// An iterator over the substrings of a string separated by a given
|
||||
/// search string
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[unstable = "Type might get removed"]
|
||||
pub struct SplitStr<'a> {
|
||||
it: MatchIndices<'a>,
|
||||
|
@ -1073,7 +1073,7 @@ pub fn utf8_char_width(b: u8) -> uint {
|
|||
/// Struct that contains a `char` and the index of the first byte of
|
||||
/// the next `char` in a string. This can be used as a data structure
|
||||
/// for iterating over the UTF-8 bytes of a string.
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
#[unstable = "naming is uncertain with container conventions"]
|
||||
pub struct CharRange {
|
||||
/// Current `char`
|
||||
|
@ -1249,25 +1249,25 @@ impl<'a, Sized? S> Str for &'a S where S: Str {
|
|||
}
|
||||
|
||||
/// Return type of `StrExt::split`
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[stable]
|
||||
pub struct Split<'a, P>(CharSplits<'a, P>);
|
||||
delegate_iter!{pattern &'a str in Split<'a, P>}
|
||||
|
||||
/// Return type of `StrExt::split_terminator`
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[unstable = "might get removed in favour of a constructor method on Split"]
|
||||
pub struct SplitTerminator<'a, P>(CharSplits<'a, P>);
|
||||
delegate_iter!{pattern &'a str in SplitTerminator<'a, P>}
|
||||
|
||||
/// Return type of `StrExt::splitn`
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[stable]
|
||||
pub struct SplitN<'a, P>(CharSplitsN<'a, P>);
|
||||
delegate_iter!{pattern forward &'a str in SplitN<'a, P>}
|
||||
|
||||
/// Return type of `StrExt::rsplitn`
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[stable]
|
||||
pub struct RSplitN<'a, P>(CharSplitsN<'a, P>);
|
||||
delegate_iter!{pattern forward &'a str in RSplitN<'a, P>}
|
||||
|
|
|
@ -11,7 +11,7 @@ use core::any::*;
|
|||
use test::Bencher;
|
||||
use test;
|
||||
|
||||
#[deriving(PartialEq, Show)]
|
||||
#[derive(PartialEq, Show)]
|
||||
struct Test;
|
||||
|
||||
static TEST: &'static str = "Test";
|
||||
|
|
|
@ -37,7 +37,7 @@ use std::string;
|
|||
|
||||
/// A piece is a portion of the format string which represents the next part
|
||||
/// to emit. These are emitted as a stream by the `Parser` class.
|
||||
#[deriving(Copy, PartialEq)]
|
||||
#[derive(Copy, PartialEq)]
|
||||
pub enum Piece<'a> {
|
||||
/// A literal string which should directly be emitted
|
||||
String(&'a str),
|
||||
|
@ -47,7 +47,7 @@ pub enum Piece<'a> {
|
|||
}
|
||||
|
||||
/// Representation of an argument specification.
|
||||
#[deriving(Copy, PartialEq)]
|
||||
#[derive(Copy, PartialEq)]
|
||||
pub struct Argument<'a> {
|
||||
/// Where to find this argument
|
||||
pub position: Position<'a>,
|
||||
|
@ -56,7 +56,7 @@ pub struct Argument<'a> {
|
|||
}
|
||||
|
||||
/// Specification for the formatting of an argument in the format string.
|
||||
#[deriving(Copy, PartialEq)]
|
||||
#[derive(Copy, PartialEq)]
|
||||
pub struct FormatSpec<'a> {
|
||||
/// Optionally specified character to fill alignment with
|
||||
pub fill: Option<char>,
|
||||
|
@ -75,7 +75,7 @@ pub struct FormatSpec<'a> {
|
|||
}
|
||||
|
||||
/// Enum describing where an argument for a format can be located.
|
||||
#[deriving(Copy, PartialEq)]
|
||||
#[derive(Copy, PartialEq)]
|
||||
pub enum Position<'a> {
|
||||
/// The argument will be in the next position. This is the default.
|
||||
ArgumentNext,
|
||||
|
@ -86,7 +86,7 @@ pub enum Position<'a> {
|
|||
}
|
||||
|
||||
/// Enum of alignments which are supported.
|
||||
#[deriving(Copy, PartialEq)]
|
||||
#[derive(Copy, PartialEq)]
|
||||
pub enum Alignment {
|
||||
/// The value will be aligned to the left.
|
||||
AlignLeft,
|
||||
|
@ -100,7 +100,7 @@ pub enum Alignment {
|
|||
|
||||
/// Various flags which can be applied to format strings. The meaning of these
|
||||
/// flags is defined by the formatters themselves.
|
||||
#[deriving(Copy, PartialEq)]
|
||||
#[derive(Copy, PartialEq)]
|
||||
pub enum Flag {
|
||||
/// A `+` will be used to denote positive numbers.
|
||||
FlagSignPlus,
|
||||
|
@ -116,7 +116,7 @@ pub enum Flag {
|
|||
|
||||
/// A count is used for the precision and width parameters of an integer, and
|
||||
/// can reference either an argument or a literal integer.
|
||||
#[deriving(Copy, PartialEq)]
|
||||
#[derive(Copy, PartialEq)]
|
||||
pub enum Count<'a> {
|
||||
/// The count is specified explicitly.
|
||||
CountIs(uint),
|
||||
|
|
|
@ -105,7 +105,7 @@ use std::iter::repeat;
|
|||
use std::result;
|
||||
|
||||
/// Name of an option. Either a string or a single char.
|
||||
#[deriving(Clone, PartialEq, Eq)]
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub enum Name {
|
||||
/// A string representing the long name of an option.
|
||||
/// For example: "help"
|
||||
|
@ -116,7 +116,7 @@ pub enum Name {
|
|||
}
|
||||
|
||||
/// Describes whether an option has an argument.
|
||||
#[deriving(Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
pub enum HasArg {
|
||||
/// The option requires an argument.
|
||||
Yes,
|
||||
|
@ -127,7 +127,7 @@ pub enum HasArg {
|
|||
}
|
||||
|
||||
/// Describes how often an option may occur.
|
||||
#[deriving(Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Occur {
|
||||
/// The option occurs once.
|
||||
Req,
|
||||
|
@ -138,7 +138,7 @@ pub enum Occur {
|
|||
}
|
||||
|
||||
/// A description of a possible option.
|
||||
#[deriving(Clone, PartialEq, Eq)]
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub struct Opt {
|
||||
/// Name of the option
|
||||
pub name: Name,
|
||||
|
@ -152,7 +152,7 @@ pub struct Opt {
|
|||
|
||||
/// One group of options, e.g., both `-h` and `--help`, along with
|
||||
/// their shared description and properties.
|
||||
#[deriving(Clone, PartialEq, Eq)]
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub struct OptGroup {
|
||||
/// Short name of the option, e.g. `h` for a `-h` option
|
||||
pub short_name: String,
|
||||
|
@ -169,7 +169,7 @@ pub struct OptGroup {
|
|||
}
|
||||
|
||||
/// Describes whether an option is given at all or has a value.
|
||||
#[deriving(Clone, PartialEq, Eq)]
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
enum Optval {
|
||||
Val(String),
|
||||
Given,
|
||||
|
@ -177,7 +177,7 @@ enum Optval {
|
|||
|
||||
/// The result of checking command line arguments. Contains a vector
|
||||
/// of matches and a vector of free strings.
|
||||
#[deriving(Clone, PartialEq, Eq)]
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub struct Matches {
|
||||
/// Options that matched
|
||||
opts: Vec<Opt>,
|
||||
|
@ -190,7 +190,7 @@ pub struct Matches {
|
|||
/// The type returned when the command line does not conform to the
|
||||
/// expected format. Use the `Show` implementation to output detailed
|
||||
/// information.
|
||||
#[deriving(Clone, PartialEq, Eq)]
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub enum Fail {
|
||||
/// The option requires an argument but none was passed.
|
||||
ArgumentMissing(String),
|
||||
|
@ -205,7 +205,7 @@ pub enum Fail {
|
|||
}
|
||||
|
||||
/// The type of failure that occurred.
|
||||
#[deriving(Copy, PartialEq, Eq)]
|
||||
#[derive(Copy, PartialEq, Eq)]
|
||||
#[allow(missing_docs)]
|
||||
pub enum FailType {
|
||||
ArgumentMissing_,
|
||||
|
@ -827,18 +827,18 @@ pub fn short_usage(program_name: &str, opts: &[OptGroup]) -> String {
|
|||
line
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
enum SplitWithinState {
|
||||
A, // leading whitespace, initial state
|
||||
B, // words
|
||||
C, // internal and trailing whitespace
|
||||
}
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
enum Whitespace {
|
||||
Ws, // current char is whitespace
|
||||
Cr // current char is not whitespace
|
||||
}
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
enum LengthLimit {
|
||||
UnderLim, // current char makes current substring still fit in limit
|
||||
OverLim // current char makes current substring no longer fit in limit
|
||||
|
|
|
@ -517,7 +517,7 @@ pub trait GraphWalk<'a, N, E> {
|
|||
fn target(&'a self, edge: &E) -> N;
|
||||
}
|
||||
|
||||
#[deriving(Copy, PartialEq, Eq, Show)]
|
||||
#[derive(Copy, PartialEq, Eq, Show)]
|
||||
pub enum RenderOption {
|
||||
NoEdgeLabels,
|
||||
NoNodeLabels,
|
||||
|
|
|
@ -386,7 +386,7 @@ pub mod types {
|
|||
pub type pthread_t = c_ulong;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct glob_t {
|
||||
#[derive(Copy)] pub struct glob_t {
|
||||
pub gl_pathc: size_t,
|
||||
pub gl_pathv: *mut *mut c_char,
|
||||
pub gl_offs: size_t,
|
||||
|
@ -399,18 +399,18 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct timeval {
|
||||
#[derive(Copy)] pub struct timeval {
|
||||
pub tv_sec: time_t,
|
||||
pub tv_usec: suseconds_t,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct timespec {
|
||||
#[derive(Copy)] pub struct timespec {
|
||||
pub tv_sec: time_t,
|
||||
pub tv_nsec: c_long,
|
||||
}
|
||||
|
||||
#[deriving(Copy)] pub enum timezone {}
|
||||
#[derive(Copy)] pub enum timezone {}
|
||||
|
||||
pub type sighandler_t = size_t;
|
||||
}
|
||||
|
@ -423,29 +423,29 @@ pub mod types {
|
|||
pub type in_port_t = u16;
|
||||
pub type in_addr_t = u32;
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr {
|
||||
#[derive(Copy)] pub struct sockaddr {
|
||||
pub sa_family: sa_family_t,
|
||||
pub sa_data: [u8; 14],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_storage {
|
||||
#[derive(Copy)] pub struct sockaddr_storage {
|
||||
pub ss_family: sa_family_t,
|
||||
pub __ss_align: i64,
|
||||
pub __ss_pad2: [u8; 112],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_in {
|
||||
#[derive(Copy)] pub struct sockaddr_in {
|
||||
pub sin_family: sa_family_t,
|
||||
pub sin_port: in_port_t,
|
||||
pub sin_addr: in_addr,
|
||||
pub sin_zero: [u8; 8],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct in_addr {
|
||||
#[derive(Copy)] pub struct in_addr {
|
||||
pub s_addr: in_addr_t,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_in6 {
|
||||
#[derive(Copy)] pub struct sockaddr_in6 {
|
||||
pub sin6_family: sa_family_t,
|
||||
pub sin6_port: in_port_t,
|
||||
pub sin6_flowinfo: u32,
|
||||
|
@ -453,21 +453,21 @@ pub mod types {
|
|||
pub sin6_scope_id: u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct in6_addr {
|
||||
#[derive(Copy)] pub struct in6_addr {
|
||||
pub s6_addr: [u16; 8]
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct ip_mreq {
|
||||
#[derive(Copy)] pub struct ip_mreq {
|
||||
pub imr_multiaddr: in_addr,
|
||||
pub imr_interface: in_addr,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct ip6_mreq {
|
||||
#[derive(Copy)] pub struct ip6_mreq {
|
||||
pub ipv6mr_multiaddr: in6_addr,
|
||||
pub ipv6mr_interface: c_uint,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct addrinfo {
|
||||
#[derive(Copy)] pub struct addrinfo {
|
||||
pub ai_flags: c_int,
|
||||
pub ai_family: c_int,
|
||||
pub ai_socktype: c_int,
|
||||
|
@ -489,13 +489,13 @@ pub mod types {
|
|||
pub ai_next: *mut addrinfo,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_un {
|
||||
#[derive(Copy)] pub struct sockaddr_un {
|
||||
pub sun_family: sa_family_t,
|
||||
pub sun_path: [c_char; 108]
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct ifaddrs {
|
||||
#[derive(Copy)] pub struct ifaddrs {
|
||||
pub ifa_next: *mut ifaddrs,
|
||||
pub ifa_name: *mut c_char,
|
||||
pub ifa_flags: c_uint,
|
||||
|
@ -578,7 +578,7 @@ pub mod types {
|
|||
pub type blkcnt_t = i32;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct stat {
|
||||
#[derive(Copy)] pub struct stat {
|
||||
pub st_dev: dev_t,
|
||||
pub __pad1: c_short,
|
||||
pub st_ino: ino_t,
|
||||
|
@ -602,13 +602,13 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct utimbuf {
|
||||
#[derive(Copy)] pub struct utimbuf {
|
||||
pub actime: time_t,
|
||||
pub modtime: time_t,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct pthread_attr_t {
|
||||
#[derive(Copy)] pub struct pthread_attr_t {
|
||||
pub __size: [u32; 9]
|
||||
}
|
||||
}
|
||||
|
@ -623,7 +623,7 @@ pub mod types {
|
|||
pub type blkcnt_t = u32;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct stat {
|
||||
#[derive(Copy)] pub struct stat {
|
||||
pub st_dev: c_ulonglong,
|
||||
pub __pad0: [c_uchar; 4],
|
||||
pub __st_ino: ino_t,
|
||||
|
@ -646,13 +646,13 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct utimbuf {
|
||||
#[derive(Copy)] pub struct utimbuf {
|
||||
pub actime: time_t,
|
||||
pub modtime: time_t,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct pthread_attr_t {
|
||||
#[derive(Copy)] pub struct pthread_attr_t {
|
||||
pub __size: [u32; 9]
|
||||
}
|
||||
}
|
||||
|
@ -668,7 +668,7 @@ pub mod types {
|
|||
pub type blkcnt_t = i32;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct stat {
|
||||
#[derive(Copy)] pub struct stat {
|
||||
pub st_dev: c_ulong,
|
||||
pub st_pad1: [c_long; 3],
|
||||
pub st_ino: ino_t,
|
||||
|
@ -692,13 +692,13 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct utimbuf {
|
||||
#[derive(Copy)] pub struct utimbuf {
|
||||
pub actime: time_t,
|
||||
pub modtime: time_t,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct pthread_attr_t {
|
||||
#[derive(Copy)] pub struct pthread_attr_t {
|
||||
pub __size: [u32; 9]
|
||||
}
|
||||
}
|
||||
|
@ -707,7 +707,7 @@ pub mod types {
|
|||
pub mod extra {
|
||||
use types::os::arch::c95::{c_ushort, c_int, c_uchar};
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_ll {
|
||||
#[derive(Copy)] pub struct sockaddr_ll {
|
||||
pub sll_family: c_ushort,
|
||||
pub sll_protocol: c_ushort,
|
||||
pub sll_ifindex: c_int,
|
||||
|
@ -779,7 +779,7 @@ pub mod types {
|
|||
pub type blkcnt_t = i64;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct stat {
|
||||
#[derive(Copy)] pub struct stat {
|
||||
pub st_dev: dev_t,
|
||||
pub st_ino: ino_t,
|
||||
pub st_nlink: nlink_t,
|
||||
|
@ -801,13 +801,13 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct utimbuf {
|
||||
#[derive(Copy)] pub struct utimbuf {
|
||||
pub actime: time_t,
|
||||
pub modtime: time_t,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct pthread_attr_t {
|
||||
#[derive(Copy)] pub struct pthread_attr_t {
|
||||
pub __size: [u64; 7]
|
||||
}
|
||||
}
|
||||
|
@ -823,7 +823,7 @@ pub mod types {
|
|||
pub type blkcnt_t = i64;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct stat {
|
||||
#[derive(Copy)] pub struct stat {
|
||||
pub st_dev: dev_t,
|
||||
pub st_ino: ino_t,
|
||||
pub st_mode: mode_t,
|
||||
|
@ -846,13 +846,13 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct utimbuf {
|
||||
#[derive(Copy)] pub struct utimbuf {
|
||||
pub actime: time_t,
|
||||
pub modtime: time_t,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct pthread_attr_t {
|
||||
#[derive(Copy)] pub struct pthread_attr_t {
|
||||
pub __size: [u64; 8]
|
||||
}
|
||||
}
|
||||
|
@ -862,7 +862,7 @@ pub mod types {
|
|||
}
|
||||
pub mod extra {
|
||||
use types::os::arch::c95::{c_ushort, c_int, c_uchar};
|
||||
#[deriving(Copy)] pub struct sockaddr_ll {
|
||||
#[derive(Copy)] pub struct sockaddr_ll {
|
||||
pub sll_family: c_ushort,
|
||||
pub sll_protocol: c_ushort,
|
||||
pub sll_ifindex: c_int,
|
||||
|
@ -888,7 +888,7 @@ pub mod types {
|
|||
pub type pthread_t = uintptr_t;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct glob_t {
|
||||
#[derive(Copy)] pub struct glob_t {
|
||||
pub gl_pathc: size_t,
|
||||
pub __unused1: size_t,
|
||||
pub gl_offs: size_t,
|
||||
|
@ -905,18 +905,18 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct timeval {
|
||||
#[derive(Copy)] pub struct timeval {
|
||||
pub tv_sec: time_t,
|
||||
pub tv_usec: suseconds_t,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct timespec {
|
||||
#[derive(Copy)] pub struct timespec {
|
||||
pub tv_sec: time_t,
|
||||
pub tv_nsec: c_long,
|
||||
}
|
||||
|
||||
#[deriving(Copy)] pub enum timezone {}
|
||||
#[derive(Copy)] pub enum timezone {}
|
||||
|
||||
pub type sighandler_t = size_t;
|
||||
}
|
||||
|
@ -929,13 +929,13 @@ pub mod types {
|
|||
pub type in_port_t = u16;
|
||||
pub type in_addr_t = u32;
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr {
|
||||
#[derive(Copy)] pub struct sockaddr {
|
||||
pub sa_len: u8,
|
||||
pub sa_family: sa_family_t,
|
||||
pub sa_data: [u8; 14],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_storage {
|
||||
#[derive(Copy)] pub struct sockaddr_storage {
|
||||
pub ss_len: u8,
|
||||
pub ss_family: sa_family_t,
|
||||
pub __ss_pad1: [u8; 6],
|
||||
|
@ -943,7 +943,7 @@ pub mod types {
|
|||
pub __ss_pad2: [u8; 112],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_in {
|
||||
#[derive(Copy)] pub struct sockaddr_in {
|
||||
pub sin_len: u8,
|
||||
pub sin_family: sa_family_t,
|
||||
pub sin_port: in_port_t,
|
||||
|
@ -951,11 +951,11 @@ pub mod types {
|
|||
pub sin_zero: [u8; 8],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct in_addr {
|
||||
#[derive(Copy)] pub struct in_addr {
|
||||
pub s_addr: in_addr_t,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_in6 {
|
||||
#[derive(Copy)] pub struct sockaddr_in6 {
|
||||
pub sin6_len: u8,
|
||||
pub sin6_family: sa_family_t,
|
||||
pub sin6_port: in_port_t,
|
||||
|
@ -964,21 +964,21 @@ pub mod types {
|
|||
pub sin6_scope_id: u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct in6_addr {
|
||||
#[derive(Copy)] pub struct in6_addr {
|
||||
pub s6_addr: [u16; 8]
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct ip_mreq {
|
||||
#[derive(Copy)] pub struct ip_mreq {
|
||||
pub imr_multiaddr: in_addr,
|
||||
pub imr_interface: in_addr,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct ip6_mreq {
|
||||
#[derive(Copy)] pub struct ip6_mreq {
|
||||
pub ipv6mr_multiaddr: in6_addr,
|
||||
pub ipv6mr_interface: c_uint,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct addrinfo {
|
||||
#[derive(Copy)] pub struct addrinfo {
|
||||
pub ai_flags: c_int,
|
||||
pub ai_family: c_int,
|
||||
pub ai_socktype: c_int,
|
||||
|
@ -989,13 +989,13 @@ pub mod types {
|
|||
pub ai_next: *mut addrinfo,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_un {
|
||||
#[derive(Copy)] pub struct sockaddr_un {
|
||||
pub sun_len: u8,
|
||||
pub sun_family: sa_family_t,
|
||||
pub sun_path: [c_char; 104]
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct ifaddrs {
|
||||
#[derive(Copy)] pub struct ifaddrs {
|
||||
pub ifa_next: *mut ifaddrs,
|
||||
pub ifa_name: *mut c_char,
|
||||
pub ifa_flags: c_uint,
|
||||
|
@ -1062,7 +1062,7 @@ pub mod types {
|
|||
pub type blkcnt_t = i64;
|
||||
pub type fflags_t = u32;
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct stat {
|
||||
#[derive(Copy)] pub struct stat {
|
||||
pub st_dev: dev_t,
|
||||
pub st_ino: ino_t,
|
||||
pub st_mode: mode_t,
|
||||
|
@ -1088,7 +1088,7 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct utimbuf {
|
||||
#[derive(Copy)] pub struct utimbuf {
|
||||
pub actime: time_t,
|
||||
pub modtime: time_t,
|
||||
}
|
||||
|
@ -1116,7 +1116,7 @@ pub mod types {
|
|||
pub type pthread_t = uintptr_t;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct glob_t {
|
||||
#[derive(Copy)] pub struct glob_t {
|
||||
pub gl_pathc: size_t,
|
||||
pub __unused1: size_t,
|
||||
pub gl_offs: size_t,
|
||||
|
@ -1133,18 +1133,18 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct timeval {
|
||||
#[derive(Copy)] pub struct timeval {
|
||||
pub tv_sec: time_t,
|
||||
pub tv_usec: suseconds_t,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct timespec {
|
||||
#[derive(Copy)] pub struct timespec {
|
||||
pub tv_sec: time_t,
|
||||
pub tv_nsec: c_long,
|
||||
}
|
||||
|
||||
#[deriving(Copy)] pub enum timezone {}
|
||||
#[derive(Copy)] pub enum timezone {}
|
||||
|
||||
pub type sighandler_t = size_t;
|
||||
}
|
||||
|
@ -1157,13 +1157,13 @@ pub mod types {
|
|||
pub type in_port_t = u16;
|
||||
pub type in_addr_t = u32;
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr {
|
||||
#[derive(Copy)] pub struct sockaddr {
|
||||
pub sa_len: u8,
|
||||
pub sa_family: sa_family_t,
|
||||
pub sa_data: [u8; 14],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_storage {
|
||||
#[derive(Copy)] pub struct sockaddr_storage {
|
||||
pub ss_len: u8,
|
||||
pub ss_family: sa_family_t,
|
||||
pub __ss_pad1: [u8; 6],
|
||||
|
@ -1171,7 +1171,7 @@ pub mod types {
|
|||
pub __ss_pad2: [u8; 112],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_in {
|
||||
#[derive(Copy)] pub struct sockaddr_in {
|
||||
pub sin_len: u8,
|
||||
pub sin_family: sa_family_t,
|
||||
pub sin_port: in_port_t,
|
||||
|
@ -1179,11 +1179,11 @@ pub mod types {
|
|||
pub sin_zero: [u8; 8],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct in_addr {
|
||||
#[derive(Copy)] pub struct in_addr {
|
||||
pub s_addr: in_addr_t,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_in6 {
|
||||
#[derive(Copy)] pub struct sockaddr_in6 {
|
||||
pub sin6_len: u8,
|
||||
pub sin6_family: sa_family_t,
|
||||
pub sin6_port: in_port_t,
|
||||
|
@ -1192,21 +1192,21 @@ pub mod types {
|
|||
pub sin6_scope_id: u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct in6_addr {
|
||||
#[derive(Copy)] pub struct in6_addr {
|
||||
pub s6_addr: [u16; 8]
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct ip_mreq {
|
||||
#[derive(Copy)] pub struct ip_mreq {
|
||||
pub imr_multiaddr: in_addr,
|
||||
pub imr_interface: in_addr,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct ip6_mreq {
|
||||
#[derive(Copy)] pub struct ip6_mreq {
|
||||
pub ipv6mr_multiaddr: in6_addr,
|
||||
pub ipv6mr_interface: c_uint,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct addrinfo {
|
||||
#[derive(Copy)] pub struct addrinfo {
|
||||
pub ai_flags: c_int,
|
||||
pub ai_family: c_int,
|
||||
pub ai_socktype: c_int,
|
||||
|
@ -1217,13 +1217,13 @@ pub mod types {
|
|||
pub ai_next: *mut addrinfo,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_un {
|
||||
#[derive(Copy)] pub struct sockaddr_un {
|
||||
pub sun_len: u8,
|
||||
pub sun_family: sa_family_t,
|
||||
pub sun_path: [c_char; 104]
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct ifaddrs {
|
||||
#[derive(Copy)] pub struct ifaddrs {
|
||||
pub ifa_next: *mut ifaddrs,
|
||||
pub ifa_name: *mut c_char,
|
||||
pub ifa_flags: c_uint,
|
||||
|
@ -1291,7 +1291,7 @@ pub mod types {
|
|||
pub type fflags_t = u32;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct stat {
|
||||
#[derive(Copy)] pub struct stat {
|
||||
pub st_ino: ino_t,
|
||||
pub st_nlink: nlink_t,
|
||||
pub st_dev: dev_t,
|
||||
|
@ -1316,7 +1316,7 @@ pub mod types {
|
|||
pub st_qspare2: int64_t,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct utimbuf {
|
||||
#[derive(Copy)] pub struct utimbuf {
|
||||
pub actime: time_t,
|
||||
pub modtime: time_t,
|
||||
}
|
||||
|
@ -1343,7 +1343,7 @@ pub mod types {
|
|||
// pub Note: this is the struct called stat64 in Windows. Not stat,
|
||||
// nor stati64.
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct stat {
|
||||
#[derive(Copy)] pub struct stat {
|
||||
pub st_dev: dev_t,
|
||||
pub st_ino: ino_t,
|
||||
pub st_mode: u16,
|
||||
|
@ -1359,24 +1359,24 @@ pub mod types {
|
|||
|
||||
// note that this is called utimbuf64 in Windows
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct utimbuf {
|
||||
#[derive(Copy)] pub struct utimbuf {
|
||||
pub actime: time64_t,
|
||||
pub modtime: time64_t,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct timeval {
|
||||
#[derive(Copy)] pub struct timeval {
|
||||
pub tv_sec: c_long,
|
||||
pub tv_usec: c_long,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct timespec {
|
||||
#[derive(Copy)] pub struct timespec {
|
||||
pub tv_sec: time_t,
|
||||
pub tv_nsec: c_long,
|
||||
}
|
||||
|
||||
#[deriving(Copy)] pub enum timezone {}
|
||||
#[derive(Copy)] pub enum timezone {}
|
||||
}
|
||||
|
||||
pub mod bsd44 {
|
||||
|
@ -1389,30 +1389,30 @@ pub mod types {
|
|||
pub type in_port_t = u16;
|
||||
pub type in_addr_t = u32;
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr {
|
||||
#[derive(Copy)] pub struct sockaddr {
|
||||
pub sa_family: sa_family_t,
|
||||
pub sa_data: [u8; 14],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_storage {
|
||||
#[derive(Copy)] pub struct sockaddr_storage {
|
||||
pub ss_family: sa_family_t,
|
||||
pub __ss_pad1: [u8; 6],
|
||||
pub __ss_align: i64,
|
||||
pub __ss_pad2: [u8; 112],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_in {
|
||||
#[derive(Copy)] pub struct sockaddr_in {
|
||||
pub sin_family: sa_family_t,
|
||||
pub sin_port: in_port_t,
|
||||
pub sin_addr: in_addr,
|
||||
pub sin_zero: [u8; 8],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct in_addr {
|
||||
#[derive(Copy)] pub struct in_addr {
|
||||
pub s_addr: in_addr_t,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_in6 {
|
||||
#[derive(Copy)] pub struct sockaddr_in6 {
|
||||
pub sin6_family: sa_family_t,
|
||||
pub sin6_port: in_port_t,
|
||||
pub sin6_flowinfo: u32,
|
||||
|
@ -1420,21 +1420,21 @@ pub mod types {
|
|||
pub sin6_scope_id: u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct in6_addr {
|
||||
#[derive(Copy)] pub struct in6_addr {
|
||||
pub s6_addr: [u16; 8]
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct ip_mreq {
|
||||
#[derive(Copy)] pub struct ip_mreq {
|
||||
pub imr_multiaddr: in_addr,
|
||||
pub imr_interface: in_addr,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct ip6_mreq {
|
||||
#[derive(Copy)] pub struct ip6_mreq {
|
||||
pub ipv6mr_multiaddr: in6_addr,
|
||||
pub ipv6mr_interface: c_uint,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct addrinfo {
|
||||
#[derive(Copy)] pub struct addrinfo {
|
||||
pub ai_flags: c_int,
|
||||
pub ai_family: c_int,
|
||||
pub ai_socktype: c_int,
|
||||
|
@ -1445,7 +1445,7 @@ pub mod types {
|
|||
pub ai_next: *mut addrinfo,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_un {
|
||||
#[derive(Copy)] pub struct sockaddr_un {
|
||||
pub sun_family: sa_family_t,
|
||||
pub sun_path: [c_char; 108]
|
||||
}
|
||||
|
@ -1573,7 +1573,7 @@ pub mod types {
|
|||
pub type LPCH = *mut CHAR;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct SECURITY_ATTRIBUTES {
|
||||
#[derive(Copy)] pub struct SECURITY_ATTRIBUTES {
|
||||
pub nLength: DWORD,
|
||||
pub lpSecurityDescriptor: LPVOID,
|
||||
pub bInheritHandle: BOOL,
|
||||
|
@ -1597,7 +1597,7 @@ pub mod types {
|
|||
pub type int64 = i64;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct STARTUPINFO {
|
||||
#[derive(Copy)] pub struct STARTUPINFO {
|
||||
pub cb: DWORD,
|
||||
pub lpReserved: LPWSTR,
|
||||
pub lpDesktop: LPWSTR,
|
||||
|
@ -1620,7 +1620,7 @@ pub mod types {
|
|||
pub type LPSTARTUPINFO = *mut STARTUPINFO;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct PROCESS_INFORMATION {
|
||||
#[derive(Copy)] pub struct PROCESS_INFORMATION {
|
||||
pub hProcess: HANDLE,
|
||||
pub hThread: HANDLE,
|
||||
pub dwProcessId: DWORD,
|
||||
|
@ -1629,7 +1629,7 @@ pub mod types {
|
|||
pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct SYSTEM_INFO {
|
||||
#[derive(Copy)] pub struct SYSTEM_INFO {
|
||||
pub wProcessorArchitecture: WORD,
|
||||
pub wReserved: WORD,
|
||||
pub dwPageSize: DWORD,
|
||||
|
@ -1645,7 +1645,7 @@ pub mod types {
|
|||
pub type LPSYSTEM_INFO = *mut SYSTEM_INFO;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct MEMORY_BASIC_INFORMATION {
|
||||
#[derive(Copy)] pub struct MEMORY_BASIC_INFORMATION {
|
||||
pub BaseAddress: LPVOID,
|
||||
pub AllocationBase: LPVOID,
|
||||
pub AllocationProtect: DWORD,
|
||||
|
@ -1657,7 +1657,7 @@ pub mod types {
|
|||
pub type LPMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct OVERLAPPED {
|
||||
#[derive(Copy)] pub struct OVERLAPPED {
|
||||
pub Internal: *mut c_ulong,
|
||||
pub InternalHigh: *mut c_ulong,
|
||||
pub Offset: DWORD,
|
||||
|
@ -1668,7 +1668,7 @@ pub mod types {
|
|||
pub type LPOVERLAPPED = *mut OVERLAPPED;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct FILETIME {
|
||||
#[derive(Copy)] pub struct FILETIME {
|
||||
pub dwLowDateTime: DWORD,
|
||||
pub dwHighDateTime: DWORD,
|
||||
}
|
||||
|
@ -1676,7 +1676,7 @@ pub mod types {
|
|||
pub type LPFILETIME = *mut FILETIME;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct GUID {
|
||||
#[derive(Copy)] pub struct GUID {
|
||||
pub Data1: DWORD,
|
||||
pub Data2: WORD,
|
||||
pub Data3: WORD,
|
||||
|
@ -1684,7 +1684,7 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct WSAPROTOCOLCHAIN {
|
||||
#[derive(Copy)] pub struct WSAPROTOCOLCHAIN {
|
||||
pub ChainLen: c_int,
|
||||
pub ChainEntries: [DWORD; MAX_PROTOCOL_CHAIN as uint],
|
||||
}
|
||||
|
@ -1692,7 +1692,7 @@ pub mod types {
|
|||
pub type LPWSAPROTOCOLCHAIN = *mut WSAPROTOCOLCHAIN;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct WSAPROTOCOL_INFO {
|
||||
#[derive(Copy)] pub struct WSAPROTOCOL_INFO {
|
||||
pub dwServiceFlags1: DWORD,
|
||||
pub dwServiceFlags2: DWORD,
|
||||
pub dwServiceFlags3: DWORD,
|
||||
|
@ -1720,7 +1720,7 @@ pub mod types {
|
|||
pub type GROUP = c_uint;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct WIN32_FIND_DATAW {
|
||||
#[derive(Copy)] pub struct WIN32_FIND_DATAW {
|
||||
pub dwFileAttributes: DWORD,
|
||||
pub ftCreationTime: FILETIME,
|
||||
pub ftLastAccessTime: FILETIME,
|
||||
|
@ -1750,7 +1750,7 @@ pub mod types {
|
|||
pub type pthread_t = uintptr_t;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct glob_t {
|
||||
#[derive(Copy)] pub struct glob_t {
|
||||
pub gl_pathc: size_t,
|
||||
pub __unused1: c_int,
|
||||
pub gl_offs: size_t,
|
||||
|
@ -1767,18 +1767,18 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct timeval {
|
||||
#[derive(Copy)] pub struct timeval {
|
||||
pub tv_sec: time_t,
|
||||
pub tv_usec: suseconds_t,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct timespec {
|
||||
#[derive(Copy)] pub struct timespec {
|
||||
pub tv_sec: time_t,
|
||||
pub tv_nsec: c_long,
|
||||
}
|
||||
|
||||
#[deriving(Copy)] pub enum timezone {}
|
||||
#[derive(Copy)] pub enum timezone {}
|
||||
|
||||
pub type sighandler_t = size_t;
|
||||
}
|
||||
|
@ -1792,14 +1792,14 @@ pub mod types {
|
|||
pub type in_port_t = u16;
|
||||
pub type in_addr_t = u32;
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr {
|
||||
#[derive(Copy)] pub struct sockaddr {
|
||||
pub sa_len: u8,
|
||||
pub sa_family: sa_family_t,
|
||||
pub sa_data: [u8; 14],
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_storage {
|
||||
#[derive(Copy)] pub struct sockaddr_storage {
|
||||
pub ss_len: u8,
|
||||
pub ss_family: sa_family_t,
|
||||
pub __ss_pad1: [u8; 6],
|
||||
|
@ -1808,7 +1808,7 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_in {
|
||||
#[derive(Copy)] pub struct sockaddr_in {
|
||||
pub sin_len: u8,
|
||||
pub sin_family: sa_family_t,
|
||||
pub sin_port: in_port_t,
|
||||
|
@ -1817,12 +1817,12 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct in_addr {
|
||||
#[derive(Copy)] pub struct in_addr {
|
||||
pub s_addr: in_addr_t,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_in6 {
|
||||
#[derive(Copy)] pub struct sockaddr_in6 {
|
||||
pub sin6_len: u8,
|
||||
pub sin6_family: sa_family_t,
|
||||
pub sin6_port: in_port_t,
|
||||
|
@ -1832,24 +1832,24 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct in6_addr {
|
||||
#[derive(Copy)] pub struct in6_addr {
|
||||
pub s6_addr: [u16; 8]
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct ip_mreq {
|
||||
#[derive(Copy)] pub struct ip_mreq {
|
||||
pub imr_multiaddr: in_addr,
|
||||
pub imr_interface: in_addr,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct ip6_mreq {
|
||||
#[derive(Copy)] pub struct ip6_mreq {
|
||||
pub ipv6mr_multiaddr: in6_addr,
|
||||
pub ipv6mr_interface: c_uint,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct addrinfo {
|
||||
#[derive(Copy)] pub struct addrinfo {
|
||||
pub ai_flags: c_int,
|
||||
pub ai_family: c_int,
|
||||
pub ai_socktype: c_int,
|
||||
|
@ -1861,14 +1861,14 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct sockaddr_un {
|
||||
#[derive(Copy)] pub struct sockaddr_un {
|
||||
pub sun_len: u8,
|
||||
pub sun_family: sa_family_t,
|
||||
pub sun_path: [c_char; 104]
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct ifaddrs {
|
||||
#[derive(Copy)] pub struct ifaddrs {
|
||||
pub ifa_next: *mut ifaddrs,
|
||||
pub ifa_name: *mut c_char,
|
||||
pub ifa_flags: c_uint,
|
||||
|
@ -1931,7 +1931,7 @@ pub mod types {
|
|||
pub type blkcnt_t = i32;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct stat {
|
||||
#[derive(Copy)] pub struct stat {
|
||||
pub st_dev: dev_t,
|
||||
pub st_mode: mode_t,
|
||||
pub st_nlink: nlink_t,
|
||||
|
@ -1957,13 +1957,13 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct utimbuf {
|
||||
#[derive(Copy)] pub struct utimbuf {
|
||||
pub actime: time_t,
|
||||
pub modtime: time_t,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct pthread_attr_t {
|
||||
#[derive(Copy)] pub struct pthread_attr_t {
|
||||
pub __sig: c_long,
|
||||
pub __opaque: [c_char; 36]
|
||||
}
|
||||
|
@ -1974,7 +1974,7 @@ pub mod types {
|
|||
}
|
||||
pub mod extra {
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct mach_timebase_info {
|
||||
#[derive(Copy)] pub struct mach_timebase_info {
|
||||
pub numer: u32,
|
||||
pub denom: u32,
|
||||
}
|
||||
|
@ -2035,7 +2035,7 @@ pub mod types {
|
|||
pub type blkcnt_t = i32;
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct stat {
|
||||
#[derive(Copy)] pub struct stat {
|
||||
pub st_dev: dev_t,
|
||||
pub st_mode: mode_t,
|
||||
pub st_nlink: nlink_t,
|
||||
|
@ -2061,13 +2061,13 @@ pub mod types {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct utimbuf {
|
||||
#[derive(Copy)] pub struct utimbuf {
|
||||
pub actime: time_t,
|
||||
pub modtime: time_t,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct pthread_attr_t {
|
||||
#[derive(Copy)] pub struct pthread_attr_t {
|
||||
pub __sig: c_long,
|
||||
pub __opaque: [c_char; 56]
|
||||
}
|
||||
|
@ -2078,7 +2078,7 @@ pub mod types {
|
|||
}
|
||||
pub mod extra {
|
||||
#[repr(C)]
|
||||
#[deriving(Copy)] pub struct mach_timebase_info {
|
||||
#[derive(Copy)] pub struct mach_timebase_info {
|
||||
pub numer: u32,
|
||||
pub denom: u32,
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ use regex::Regex;
|
|||
use std::ascii::AsciiExt;
|
||||
use std::cmp;
|
||||
|
||||
#[deriving(Show, Clone)]
|
||||
#[derive(Show, Clone)]
|
||||
pub struct LogDirective {
|
||||
pub name: Option<String>,
|
||||
pub level: u32,
|
||||
|
|
|
@ -232,7 +232,7 @@ struct DefaultLogger {
|
|||
}
|
||||
|
||||
/// Wraps the log level with fmt implementations.
|
||||
#[deriving(Copy, PartialEq, PartialOrd)]
|
||||
#[derive(Copy, PartialEq, PartialOrd)]
|
||||
pub struct LogLevel(pub u32);
|
||||
|
||||
impl fmt::Show for LogLevel {
|
||||
|
@ -319,7 +319,7 @@ pub fn set_logger(logger: Box<Logger + Send>) -> Option<Box<Logger + Send>> {
|
|||
|
||||
/// A LogRecord is created by the logging macros, and passed as the only
|
||||
/// argument to Loggers.
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
pub struct LogRecord<'a> {
|
||||
|
||||
/// The module path of where the LogRecord originated.
|
||||
|
@ -339,7 +339,7 @@ pub struct LogRecord<'a> {
|
|||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct LogLocation {
|
||||
pub module_path: &'static str,
|
||||
pub file: &'static str,
|
||||
|
|
|
@ -29,7 +29,7 @@ const CHACHA_ROUNDS: uint = 20; // Cryptographically secure from 8 upwards as of
|
|||
/// [1]: D. J. Bernstein, [*ChaCha, a variant of
|
||||
/// Salsa20*](http://cr.yp.to/chacha.html)
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct ChaChaRng {
|
||||
buffer: [u32; STATE_WORDS], // Internal buffer of output
|
||||
state: [u32; STATE_WORDS], // Initial state
|
||||
|
|
|
@ -29,7 +29,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample};
|
|||
/// Generate Normal Random
|
||||
/// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
|
||||
/// College, Oxford
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Exp1(pub f64);
|
||||
|
||||
// This could be done via `-rng.gen::<f64>().ln()` but that is slower.
|
||||
|
@ -67,7 +67,7 @@ impl Rand for Exp1 {
|
|||
/// let v = exp.ind_sample(&mut rand::thread_rng());
|
||||
/// println!("{} is from a Exp(2) distribution", v);
|
||||
/// ```
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Exp {
|
||||
/// `lambda` stored as `1/lambda`, since this is what we scale by.
|
||||
lambda_inverse: f64
|
||||
|
|
|
@ -263,7 +263,7 @@ mod tests {
|
|||
use {Rng, Rand};
|
||||
use super::{RandSample, WeightedChoice, Weighted, Sample, IndependentSample};
|
||||
|
||||
#[deriving(PartialEq, Show)]
|
||||
#[derive(PartialEq, Show)]
|
||||
struct ConstRand(uint);
|
||||
impl Rand for ConstRand {
|
||||
fn rand<R: Rng>(_: &mut R) -> ConstRand {
|
||||
|
|
|
@ -28,7 +28,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample};
|
|||
/// Generate Normal Random
|
||||
/// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
|
||||
/// College, Oxford
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct StandardNormal(pub f64);
|
||||
|
||||
impl Rand for StandardNormal {
|
||||
|
@ -84,7 +84,7 @@ impl Rand for StandardNormal {
|
|||
/// let v = normal.ind_sample(&mut rand::thread_rng());
|
||||
/// println!("{} is from a N(2, 9) distribution", v)
|
||||
/// ```
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Normal {
|
||||
mean: f64,
|
||||
std_dev: f64,
|
||||
|
@ -132,7 +132,7 @@ impl IndependentSample<f64> for Normal {
|
|||
/// let v = log_normal.ind_sample(&mut rand::thread_rng());
|
||||
/// println!("{} is from an ln N(2, 9) distribution", v)
|
||||
/// ```
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct LogNormal {
|
||||
norm: Normal
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ const RAND_SIZE_UINT: uint = 1 << (RAND_SIZE_LEN as uint);
|
|||
///
|
||||
/// [1]: Bob Jenkins, [*ISAAC: A fast cryptographic random number
|
||||
/// generator*](http://www.burtleburtle.net/bob/rand/isaacafa.html)
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct IsaacRng {
|
||||
cnt: u32,
|
||||
rsl: [u32; RAND_SIZE_UINT],
|
||||
|
@ -264,7 +264,7 @@ const RAND_SIZE_64: uint = 1 << RAND_SIZE_64_LEN;
|
|||
///
|
||||
/// [1]: Bob Jenkins, [*ISAAC: A fast cryptographic random number
|
||||
/// generator*](http://www.burtleburtle.net/bob/rand/isaacafa.html)
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Isaac64Rng {
|
||||
cnt: uint,
|
||||
rsl: [u64; RAND_SIZE_64],
|
||||
|
|
|
@ -133,7 +133,7 @@ pub trait Reseeder<R> {
|
|||
|
||||
/// Reseed an RNG using a `Default` instance. This reseeds by
|
||||
/// replacing the RNG with the result of a `Default::default` call.
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct ReseedWithDefault;
|
||||
|
||||
impl<R: Rng + Default> Reseeder<R> for ReseedWithDefault {
|
||||
|
|
|
@ -41,7 +41,7 @@ use std::str;
|
|||
pub mod io;
|
||||
|
||||
/// Common data structures
|
||||
#[deriving(Clone, Copy)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct Doc<'a> {
|
||||
pub data: &'a [u8],
|
||||
pub start: uint,
|
||||
|
@ -71,7 +71,7 @@ pub struct TaggedDoc<'a> {
|
|||
pub doc: Doc<'a>,
|
||||
}
|
||||
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
pub enum EbmlEncoderTag {
|
||||
EsUint, // 0
|
||||
EsU64, // 1
|
||||
|
@ -105,7 +105,7 @@ pub enum EbmlEncoderTag {
|
|||
EsLabel, // Used only when debugging
|
||||
}
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
pub enum Error {
|
||||
IntTooBig(uint),
|
||||
Expected(String),
|
||||
|
@ -147,7 +147,7 @@ pub mod reader {
|
|||
)
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Res {
|
||||
pub val: uint,
|
||||
pub next: uint
|
||||
|
|
|
@ -25,7 +25,7 @@ use parse::{
|
|||
|
||||
type InstIdx = uint;
|
||||
|
||||
#[deriving(Show, Clone)]
|
||||
#[derive(Show, Clone)]
|
||||
pub enum Inst {
|
||||
// When a Match instruction is executed, the current thread is successful.
|
||||
Match,
|
||||
|
@ -78,7 +78,7 @@ pub enum Inst {
|
|||
/// All of the data in a compiled expression is wrapped in "MaybeStatic" or
|
||||
/// "MaybeOwned" types so that a `Program` can be represented as static data.
|
||||
/// (This makes it convenient and efficient for use with the `regex!` macro.)
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct Program {
|
||||
/// A sequence of instructions.
|
||||
pub insts: Vec<Inst>,
|
||||
|
|
|
@ -52,7 +52,7 @@ impl fmt::Show for Error {
|
|||
///
|
||||
/// Note that this representation prevents one from reproducing the regex as
|
||||
/// it was typed. (But it could be used to reproduce an equivalent regex.)
|
||||
#[deriving(Show, Clone)]
|
||||
#[derive(Show, Clone)]
|
||||
pub enum Ast {
|
||||
Nothing,
|
||||
Literal(char, Flags),
|
||||
|
@ -69,14 +69,14 @@ pub enum Ast {
|
|||
Rep(Box<Ast>, Repeater, Greed),
|
||||
}
|
||||
|
||||
#[deriving(Show, PartialEq, Clone)]
|
||||
#[derive(Show, PartialEq, Clone)]
|
||||
pub enum Repeater {
|
||||
ZeroOne,
|
||||
ZeroMore,
|
||||
OneMore,
|
||||
}
|
||||
|
||||
#[deriving(Copy, Show, Clone)]
|
||||
#[derive(Copy, Show, Clone)]
|
||||
pub enum Greed {
|
||||
Greedy,
|
||||
Ungreedy,
|
||||
|
@ -103,7 +103,7 @@ impl Greed {
|
|||
/// constructing an abstract syntax tree. Its central purpose is to facilitate
|
||||
/// parsing groups and alternations while also maintaining a stack of flag
|
||||
/// state.
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
enum BuildAst {
|
||||
Expr(Ast),
|
||||
Paren(Flags, uint, String), // '('
|
||||
|
|
|
@ -104,7 +104,7 @@ pub fn is_match(regex: &str, text: &str) -> Result<bool, parse::Error> {
|
|||
/// makes it much faster when searching text.
|
||||
/// More details about the `regex!` macro can be found in the `regex` crate
|
||||
/// documentation.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub enum Regex {
|
||||
// The representation of `Regex` is exported to support the `regex!`
|
||||
// syntax extension. Do not rely on it.
|
||||
|
@ -117,7 +117,7 @@ pub enum Regex {
|
|||
Native(ExNative),
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
#[doc(hidden)]
|
||||
pub struct ExDynamic {
|
||||
original: String,
|
||||
|
@ -127,7 +127,7 @@ pub struct ExDynamic {
|
|||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct ExNative {
|
||||
#[doc(hidden)]
|
||||
pub original: &'static str,
|
||||
|
@ -540,7 +540,7 @@ impl Regex {
|
|||
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub enum NamesIter<'a> {
|
||||
NamesIterNative(::std::slice::Iter<'a, Option<&'static str>>),
|
||||
NamesIterDynamic(::std::slice::Iter<'a, Option<String>>)
|
||||
|
@ -599,7 +599,7 @@ impl<F> Replacer for F where F: FnMut(&Captures) -> String {
|
|||
///
|
||||
/// `'r` is the lifetime of the compiled expression and `'t` is the lifetime
|
||||
/// of the string being split.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct RegexSplits<'r, 't> {
|
||||
finder: FindMatches<'r, 't>,
|
||||
last: uint,
|
||||
|
@ -635,7 +635,7 @@ impl<'r, 't> Iterator for RegexSplits<'r, 't> {
|
|||
///
|
||||
/// `'r` is the lifetime of the compiled expression and `'t` is the lifetime
|
||||
/// of the string being split.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct RegexSplitsN<'r, 't> {
|
||||
splits: RegexSplits<'r, 't>,
|
||||
cur: uint,
|
||||
|
@ -801,7 +801,7 @@ impl<'t> Captures<'t> {
|
|||
/// expression.
|
||||
///
|
||||
/// `'t` is the lifetime of the matched text.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct SubCaptures<'t> {
|
||||
idx: uint,
|
||||
caps: &'t Captures<'t>,
|
||||
|
@ -826,7 +826,7 @@ impl<'t> Iterator for SubCaptures<'t> {
|
|||
/// Positions are byte indices in terms of the original string matched.
|
||||
///
|
||||
/// `'t` is the lifetime of the matched text.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct SubCapturesPos<'t> {
|
||||
idx: uint,
|
||||
caps: &'t Captures<'t>,
|
||||
|
@ -852,7 +852,7 @@ impl<'t> Iterator for SubCapturesPos<'t> {
|
|||
///
|
||||
/// `'r` is the lifetime of the compiled expression and `'t` is the lifetime
|
||||
/// of the matched string.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct FindCaptures<'r, 't> {
|
||||
re: &'r Regex,
|
||||
search: &'t str,
|
||||
|
@ -897,7 +897,7 @@ impl<'r, 't> Iterator for FindCaptures<'r, 't> {
|
|||
///
|
||||
/// `'r` is the lifetime of the compiled expression and `'t` is the lifetime
|
||||
/// of the matched string.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct FindMatches<'r, 't> {
|
||||
re: &'r Regex,
|
||||
search: &'t str,
|
||||
|
|
|
@ -52,7 +52,7 @@ use unicode::regex::PERLW;
|
|||
pub type CaptureLocs = Vec<Option<uint>>;
|
||||
|
||||
/// Indicates the type of match to be performed by the VM.
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub enum MatchKind {
|
||||
/// Only checks if a match exists or not. Does not return location.
|
||||
Exists,
|
||||
|
@ -97,7 +97,7 @@ struct Nfa<'r, 't> {
|
|||
|
||||
/// Indicates the next action to take after a single non-empty instruction
|
||||
/// is processed.
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub enum StepState {
|
||||
/// This is returned if and only if a Match instruction is reached and
|
||||
/// we only care about the existence of a match. It instructs the VM to
|
||||
|
|
|
@ -57,7 +57,7 @@ declare_lint! {
|
|||
"suggest using `loop { }` instead of `while true { }`"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct WhileTrue;
|
||||
|
||||
impl LintPass for WhileTrue {
|
||||
|
@ -83,7 +83,7 @@ declare_lint! {
|
|||
"detects unnecessary type casts that can be removed"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct UnusedCasts;
|
||||
|
||||
impl LintPass for UnusedCasts {
|
||||
|
@ -125,7 +125,7 @@ declare_lint! {
|
|||
"shift exceeds the type's number of bits"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct TypeLimits {
|
||||
/// Id of the last visited negated expression
|
||||
negated_expr_id: ast::NodeId,
|
||||
|
@ -442,7 +442,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for ImproperCTypesVisitor<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct ImproperCTypes;
|
||||
|
||||
impl LintPass for ImproperCTypes {
|
||||
|
@ -485,7 +485,7 @@ declare_lint! {
|
|||
"use of owned (Box type) heap memory"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct BoxPointers;
|
||||
|
||||
impl BoxPointers {
|
||||
|
@ -625,7 +625,7 @@ declare_lint! {
|
|||
"detects attributes that were not used by the compiler"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct UnusedAttributes;
|
||||
|
||||
impl LintPass for UnusedAttributes {
|
||||
|
@ -709,7 +709,7 @@ declare_lint! {
|
|||
"path statements with no effect"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct PathStatements;
|
||||
|
||||
impl LintPass for PathStatements {
|
||||
|
@ -743,7 +743,7 @@ declare_lint! {
|
|||
"unused result of an expression in a statement"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct UnusedResults;
|
||||
|
||||
impl LintPass for UnusedResults {
|
||||
|
@ -811,7 +811,7 @@ declare_lint! {
|
|||
"types, variants, traits and type parameters should have camel case names"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct NonCamelCaseTypes;
|
||||
|
||||
impl NonCamelCaseTypes {
|
||||
|
@ -884,7 +884,7 @@ impl LintPass for NonCamelCaseTypes {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
#[derive(PartialEq)]
|
||||
enum MethodContext {
|
||||
TraitDefaultImpl,
|
||||
TraitImpl,
|
||||
|
@ -934,7 +934,7 @@ declare_lint! {
|
|||
"methods, functions, lifetime parameters and modules should have snake case names"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct NonSnakeCase;
|
||||
|
||||
impl NonSnakeCase {
|
||||
|
@ -1047,7 +1047,7 @@ declare_lint! {
|
|||
"static constants should have uppercase identifiers"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct NonUpperCaseGlobals;
|
||||
|
||||
impl LintPass for NonUpperCaseGlobals {
|
||||
|
@ -1100,7 +1100,7 @@ declare_lint! {
|
|||
"`if`, `match`, `while` and `return` do not need parentheses"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct UnusedParens;
|
||||
|
||||
impl UnusedParens {
|
||||
|
@ -1194,7 +1194,7 @@ declare_lint! {
|
|||
"unnecessary braces around an imported item"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct UnusedImportBraces;
|
||||
|
||||
impl LintPass for UnusedImportBraces {
|
||||
|
@ -1233,7 +1233,7 @@ declare_lint! {
|
|||
"using `Struct { x: x }` instead of `Struct { x }`"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct NonShorthandFieldPatterns;
|
||||
|
||||
impl LintPass for NonShorthandFieldPatterns {
|
||||
|
@ -1266,7 +1266,7 @@ declare_lint! {
|
|||
"unnecessary use of an `unsafe` block"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct UnusedUnsafe;
|
||||
|
||||
impl LintPass for UnusedUnsafe {
|
||||
|
@ -1291,7 +1291,7 @@ declare_lint! {
|
|||
"usage of an `unsafe` block"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct UnsafeBlocks;
|
||||
|
||||
impl LintPass for UnsafeBlocks {
|
||||
|
@ -1315,7 +1315,7 @@ declare_lint! {
|
|||
"detect mut variables which don't need to be mutable"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct UnusedMut;
|
||||
|
||||
impl UnusedMut {
|
||||
|
@ -1384,7 +1384,7 @@ declare_lint! {
|
|||
"detects unnecessary allocations that can be eliminated"
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct UnusedAllocation;
|
||||
|
||||
impl LintPass for UnusedAllocation {
|
||||
|
@ -1575,7 +1575,7 @@ impl LintPass for MissingDoc {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct MissingCopyImplementations;
|
||||
|
||||
impl LintPass for MissingCopyImplementations {
|
||||
|
@ -1646,7 +1646,7 @@ declare_lint! {
|
|||
|
||||
/// Checks for use of items with `#[deprecated]`, `#[experimental]` and
|
||||
/// `#[unstable]` attributes, or no stability attribute.
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Stability;
|
||||
|
||||
impl Stability {
|
||||
|
@ -1857,7 +1857,7 @@ declare_lint!{
|
|||
|
||||
/// Does nothing as a lint pass, but registers some `Lint`s
|
||||
/// which are used by other parts of the compiler.
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct HardwiredLints;
|
||||
|
||||
impl LintPass for HardwiredLints {
|
||||
|
|
|
@ -42,7 +42,7 @@ use syntax::ast;
|
|||
pub use lint::context::{Context, LintStore, raw_emit_lint, check_crate, gather_attrs};
|
||||
|
||||
/// Specification of a single lint.
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Lint {
|
||||
/// A string identifier for the lint.
|
||||
///
|
||||
|
@ -174,7 +174,7 @@ pub trait LintPass {
|
|||
pub type LintPassObject = Box<LintPass + 'static>;
|
||||
|
||||
/// Identifies a lint known to the compiler.
|
||||
#[deriving(Clone, Copy)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct LintId {
|
||||
// Identity is based on pointer equality of this field.
|
||||
lint: &'static Lint,
|
||||
|
@ -210,7 +210,7 @@ impl LintId {
|
|||
}
|
||||
|
||||
/// Setting for how to handle a lint.
|
||||
#[deriving(Clone, Copy, PartialEq, PartialOrd, Eq, Ord)]
|
||||
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord)]
|
||||
pub enum Level {
|
||||
Allow, Warn, Deny, Forbid
|
||||
}
|
||||
|
@ -239,7 +239,7 @@ impl Level {
|
|||
}
|
||||
|
||||
/// How a lint level was set.
|
||||
#[deriving(Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
pub enum LintSource {
|
||||
/// Lint is at the default level as declared
|
||||
/// in rustc or a plugin.
|
||||
|
|
|
@ -113,7 +113,7 @@ pub const tag_items_data_item_reexport_def_id: uint = 0x39;
|
|||
pub const tag_items_data_item_reexport_name: uint = 0x3a;
|
||||
|
||||
// used to encode crate_ctxt side tables
|
||||
#[deriving(Copy, PartialEq)]
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[repr(uint)]
|
||||
pub enum astencode_tag { // Reserves 0x40 -- 0x5f
|
||||
tag_ast = 0x40,
|
||||
|
@ -219,7 +219,7 @@ pub const tag_items_data_item_stability: uint = 0x92;
|
|||
|
||||
pub const tag_items_data_item_repr: uint = 0x93;
|
||||
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub struct LinkMeta {
|
||||
pub crate_name: String,
|
||||
pub crate_hash: Svh,
|
||||
|
|
|
@ -32,7 +32,7 @@ use syntax::parse::token;
|
|||
|
||||
use std::collections::hash_map::HashMap;
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct MethodInfo {
|
||||
pub name: ast::Name,
|
||||
pub def_id: ast::DefId,
|
||||
|
|
|
@ -48,13 +48,13 @@ pub struct crate_metadata {
|
|||
pub span: Span,
|
||||
}
|
||||
|
||||
#[deriving(Copy, Show, PartialEq, Clone)]
|
||||
#[derive(Copy, Show, PartialEq, Clone)]
|
||||
pub enum LinkagePreference {
|
||||
RequireDynamic,
|
||||
RequireStatic,
|
||||
}
|
||||
|
||||
#[deriving(Copy, Clone, PartialEq, FromPrimitive)]
|
||||
#[derive(Copy, Clone, PartialEq, FromPrimitive)]
|
||||
pub enum NativeLibraryKind {
|
||||
NativeStatic, // native static library (.a archive)
|
||||
NativeFramework, // OSX-specific
|
||||
|
@ -63,7 +63,7 @@ pub enum NativeLibraryKind {
|
|||
|
||||
// Where a crate came from on the local filesystem. One of these two options
|
||||
// must be non-None.
|
||||
#[deriving(PartialEq, Clone)]
|
||||
#[derive(PartialEq, Clone)]
|
||||
pub struct CrateSource {
|
||||
pub dylib: Option<Path>,
|
||||
pub rlib: Option<Path>,
|
||||
|
|
|
@ -111,7 +111,7 @@ fn lookup_item<'a>(item_id: ast::NodeId, data: &'a [u8]) -> rbml::Doc<'a> {
|
|||
find_item(item_id, items)
|
||||
}
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
#[derive(PartialEq)]
|
||||
enum Family {
|
||||
ImmStatic, // c
|
||||
MutStatic, // b
|
||||
|
@ -471,7 +471,7 @@ pub fn get_symbol(data: &[u8], id: ast::NodeId) -> String {
|
|||
}
|
||||
|
||||
// Something that a name can resolve to.
|
||||
#[deriving(Copy, Clone, Show)]
|
||||
#[derive(Copy, Clone, Show)]
|
||||
pub enum DefLike {
|
||||
DlDef(def::Def),
|
||||
DlImpl(ast::DefId),
|
||||
|
@ -1173,7 +1173,7 @@ pub fn get_crate_attributes(data: &[u8]) -> Vec<ast::Attribute> {
|
|||
get_attributes(rbml::Doc::new(data))
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct CrateDep {
|
||||
pub cnum: ast::CrateNum,
|
||||
pub name: String,
|
||||
|
|
|
@ -98,7 +98,7 @@ pub fn encode_def_id(rbml_w: &mut Encoder, id: DefId) {
|
|||
rbml_w.wr_tagged_str(tag_def_id, def_to_string(id)[]);
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
struct entry<T> {
|
||||
val: T,
|
||||
pos: u64
|
||||
|
|
|
@ -20,7 +20,7 @@ use std::os;
|
|||
use util::fs as myfs;
|
||||
use session::search_paths::{SearchPaths, PathKind};
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub enum FileMatch {
|
||||
FileMatches,
|
||||
FileDoesntMatch,
|
||||
|
|
|
@ -43,7 +43,7 @@ use syntax::parse::token;
|
|||
// def-id will depend on where it originated from. Therefore, the conversion
|
||||
// function is given an indicator of the source of the def-id. See
|
||||
// astencode.rs for more information.
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
pub enum DefIdSource {
|
||||
// Identifies a struct, trait, enum, etc.
|
||||
NominalType,
|
||||
|
|
|
@ -26,7 +26,7 @@ struct CFGBuilder<'a, 'tcx: 'a> {
|
|||
loop_scopes: Vec<LoopScope>,
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
struct LoopScope {
|
||||
loop_id: ast::NodeId, // id of loop/while node
|
||||
continue_index: CFGIndex, // where to go on a `loop`
|
||||
|
|
|
@ -26,7 +26,7 @@ pub struct CFG {
|
|||
pub exit: CFGIndex,
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct CFGNodeData {
|
||||
pub id: ast::NodeId
|
||||
}
|
||||
|
|
|
@ -16,12 +16,12 @@ use syntax::codemap::Span;
|
|||
use syntax::visit::Visitor;
|
||||
use syntax::visit;
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq)]
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
enum Context {
|
||||
Normal, Loop, Closure
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
struct CheckLoopVisitor<'a> {
|
||||
sess: &'a Session,
|
||||
cx: Context
|
||||
|
|
|
@ -102,7 +102,7 @@ pub struct MatchCheckCtxt<'a, 'tcx: 'a> {
|
|||
pub param_env: ParameterEnvironment<'a, 'tcx>,
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq)]
|
||||
#[derive(Clone, PartialEq)]
|
||||
pub enum Constructor {
|
||||
/// The constructor of all patterns that don't vary by constructor,
|
||||
/// e.g. struct patterns and fixed-length arrays.
|
||||
|
@ -119,14 +119,14 @@ pub enum Constructor {
|
|||
SliceWithSubslice(uint, uint)
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq)]
|
||||
#[derive(Clone, PartialEq)]
|
||||
enum Usefulness {
|
||||
Useful,
|
||||
UsefulWithWitness(Vec<P<Pat>>),
|
||||
NotUseful
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
enum WitnessPreference {
|
||||
ConstructWitness,
|
||||
LeaveOutWitness
|
||||
|
|
|
@ -39,7 +39,7 @@ use syntax::visit::Visitor;
|
|||
use syntax::codemap::Span;
|
||||
use syntax::visit;
|
||||
|
||||
#[deriving(Copy, Eq, PartialEq)]
|
||||
#[derive(Copy, Eq, PartialEq)]
|
||||
enum Mode {
|
||||
InConstant,
|
||||
InStatic,
|
||||
|
|
|
@ -62,7 +62,7 @@ use std::rc::Rc;
|
|||
// - Non-constants: everything else.
|
||||
//
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub enum constness {
|
||||
integral_const,
|
||||
general_const,
|
||||
|
@ -294,7 +294,7 @@ pub fn process_crate(tcx: &ty::ctxt) {
|
|||
|
||||
// FIXME (#33): this doesn't handle big integer/float literals correctly
|
||||
// (nor does the rest of our literal handling).
|
||||
#[deriving(Clone, PartialEq)]
|
||||
#[derive(Clone, PartialEq)]
|
||||
pub enum const_val {
|
||||
const_float(f64),
|
||||
const_int(i64),
|
||||
|
|
|
@ -28,13 +28,13 @@ use syntax::visit;
|
|||
use syntax::print::{pp, pprust};
|
||||
use util::nodemap::NodeMap;
|
||||
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
pub enum EntryOrExit {
|
||||
Entry,
|
||||
Exit,
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct DataFlowContext<'a, 'tcx: 'a, O> {
|
||||
tcx: &'a ty::ctxt<'tcx>,
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ use syntax::ast_util::local_def;
|
|||
|
||||
use std::cell::RefCell;
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
|
||||
pub enum Def {
|
||||
DefFn(ast::DefId, bool /* is_ctor */),
|
||||
DefStaticMethod(/* method */ ast::DefId, MethodProvenance),
|
||||
|
@ -68,19 +68,19 @@ pub type DefMap = RefCell<NodeMap<Def>>;
|
|||
// within.
|
||||
pub type ExportMap = NodeMap<Vec<Export>>;
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Export {
|
||||
pub name: ast::Name, // The name of the target.
|
||||
pub def_id: ast::DefId, // The definition of the target.
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
|
||||
pub enum MethodProvenance {
|
||||
FromTrait(ast::DefId),
|
||||
FromImpl(ast::DefId),
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
|
||||
pub enum TyParamProvenance {
|
||||
FromSelf(ast::DefId),
|
||||
FromParam(ast::DefId),
|
||||
|
@ -106,7 +106,7 @@ impl TyParamProvenance {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, Eq, PartialEq)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq)]
|
||||
pub enum TraitItemKind {
|
||||
NonstaticMethodTraitItemKind,
|
||||
StaticMethodTraitItemKind,
|
||||
|
|
|
@ -23,7 +23,7 @@ use syntax::codemap::Span;
|
|||
use syntax::visit;
|
||||
use syntax::visit::Visitor;
|
||||
|
||||
#[deriving(Copy, PartialEq)]
|
||||
#[derive(Copy, PartialEq)]
|
||||
enum UnsafeContext {
|
||||
SafeContext,
|
||||
UnsafeFn,
|
||||
|
|
|
@ -95,7 +95,7 @@ pub trait Delegate<'tcx> {
|
|||
mode: MutateMode);
|
||||
}
|
||||
|
||||
#[deriving(Copy, PartialEq, Show)]
|
||||
#[derive(Copy, PartialEq, Show)]
|
||||
pub enum LoanCause {
|
||||
ClosureCapture(Span),
|
||||
AddrOf,
|
||||
|
@ -107,20 +107,20 @@ pub enum LoanCause {
|
|||
MatchDiscriminant
|
||||
}
|
||||
|
||||
#[deriving(Copy, PartialEq, Show)]
|
||||
#[derive(Copy, PartialEq, Show)]
|
||||
pub enum ConsumeMode {
|
||||
Copy, // reference to x where x has a type that copies
|
||||
Move(MoveReason), // reference to x where x has a type that moves
|
||||
}
|
||||
|
||||
#[deriving(Copy, PartialEq, Show)]
|
||||
#[derive(Copy, PartialEq, Show)]
|
||||
pub enum MoveReason {
|
||||
DirectRefMove,
|
||||
PatBindingMove,
|
||||
CaptureMove,
|
||||
}
|
||||
|
||||
#[deriving(Copy, PartialEq, Show)]
|
||||
#[derive(Copy, PartialEq, Show)]
|
||||
pub enum MatchMode {
|
||||
NonBindingMatch,
|
||||
BorrowingMatch,
|
||||
|
@ -128,7 +128,7 @@ pub enum MatchMode {
|
|||
MovingMatch,
|
||||
}
|
||||
|
||||
#[deriving(PartialEq,Show)]
|
||||
#[derive(PartialEq,Show)]
|
||||
enum TrackMatchMode<T> {
|
||||
Unknown,
|
||||
Definite(MatchMode),
|
||||
|
@ -197,14 +197,14 @@ impl<T> TrackMatchMode<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Copy, PartialEq, Show)]
|
||||
#[derive(Copy, PartialEq, Show)]
|
||||
pub enum MutateMode {
|
||||
Init,
|
||||
JustWrite, // x = y
|
||||
WriteAndRead, // x += y
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
enum OverloadedCallType {
|
||||
FnOverloadedCall,
|
||||
FnMutOverloadedCall,
|
||||
|
|
|
@ -14,7 +14,7 @@ use syntax::ast;
|
|||
use self::SimplifiedType::*;
|
||||
|
||||
/// See `simplify_type
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub enum SimplifiedType {
|
||||
BoolSimplifiedType,
|
||||
CharSimplifiedType,
|
||||
|
|
|
@ -61,18 +61,18 @@ impl<E: Show> Show for Edge<E> {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq, Show)]
|
||||
#[derive(Clone, Copy, PartialEq, Show)]
|
||||
pub struct NodeIndex(pub uint);
|
||||
#[allow(non_upper_case_globals)]
|
||||
pub const InvalidNodeIndex: NodeIndex = NodeIndex(uint::MAX);
|
||||
|
||||
#[deriving(Copy, PartialEq, Show)]
|
||||
#[derive(Copy, PartialEq, Show)]
|
||||
pub struct EdgeIndex(pub uint);
|
||||
#[allow(non_upper_case_globals)]
|
||||
pub const InvalidEdgeIndex: EdgeIndex = EdgeIndex(uint::MAX);
|
||||
|
||||
// Use a private field here to guarantee no more instances are created:
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
pub struct Direction { repr: uint }
|
||||
#[allow(non_upper_case_globals)]
|
||||
pub const Outgoing: Direction = Direction { repr: 0 };
|
||||
|
|
|
@ -447,7 +447,7 @@ impl<'tcx> Combineable<'tcx> for ty::FnSig<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct CombineFields<'a, 'tcx: 'a> {
|
||||
pub infcx: &'a InferCtxt<'a, 'tcx>,
|
||||
pub a_is_expected: bool,
|
||||
|
|
|
@ -97,7 +97,7 @@ pub type SkolemizationMap = FnvHashMap<ty::BoundRegion,ty::Region>;
|
|||
/// Why did we require that the two types be related?
|
||||
///
|
||||
/// See `error_reporting.rs` for more details
|
||||
#[deriving(Clone, Copy, Show)]
|
||||
#[derive(Clone, Copy, Show)]
|
||||
pub enum TypeOrigin {
|
||||
// Not yet categorized in a better way
|
||||
Misc(Span),
|
||||
|
@ -135,7 +135,7 @@ pub enum TypeOrigin {
|
|||
}
|
||||
|
||||
/// See `error_reporting.rs` for more details
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub enum ValuePairs<'tcx> {
|
||||
Types(ty::expected_found<Ty<'tcx>>),
|
||||
TraitRefs(ty::expected_found<Rc<ty::TraitRef<'tcx>>>),
|
||||
|
@ -146,7 +146,7 @@ pub enum ValuePairs<'tcx> {
|
|||
/// encounter an error or subtyping constraint.
|
||||
///
|
||||
/// See `error_reporting.rs` for more details.
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub struct TypeTrace<'tcx> {
|
||||
origin: TypeOrigin,
|
||||
values: ValuePairs<'tcx>,
|
||||
|
@ -155,7 +155,7 @@ pub struct TypeTrace<'tcx> {
|
|||
/// The origin of a `r1 <= r2` constraint.
|
||||
///
|
||||
/// See `error_reporting.rs` for more details
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub enum SubregionOrigin<'tcx> {
|
||||
// Arose from a subtyping relation
|
||||
Subtype(TypeTrace<'tcx>),
|
||||
|
@ -224,7 +224,7 @@ pub enum SubregionOrigin<'tcx> {
|
|||
}
|
||||
|
||||
/// Times when we replace late-bound regions with variables:
|
||||
#[deriving(Clone, Copy, Show)]
|
||||
#[derive(Clone, Copy, Show)]
|
||||
pub enum LateBoundRegionConversionTime {
|
||||
/// when a fn is called
|
||||
FnCall,
|
||||
|
@ -239,7 +239,7 @@ pub enum LateBoundRegionConversionTime {
|
|||
/// Reasons to create a region inference variable
|
||||
///
|
||||
/// See `error_reporting.rs` for more details
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub enum RegionVariableOrigin<'tcx> {
|
||||
// Region variables created for ill-categorized reasons,
|
||||
// mostly indicates places in need of refactoring
|
||||
|
@ -272,7 +272,7 @@ pub enum RegionVariableOrigin<'tcx> {
|
|||
BoundRegionInCoherence(ast::Name),
|
||||
}
|
||||
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
pub enum fixup_err {
|
||||
unresolved_int_ty(IntVid),
|
||||
unresolved_float_ty(FloatVid),
|
||||
|
|
|
@ -121,7 +121,7 @@ struct ConstraintGraph<'a, 'tcx: 'a> {
|
|||
node_ids: FnvHashMap<Node, uint>,
|
||||
}
|
||||
|
||||
#[deriving(Clone, Hash, PartialEq, Eq, Show)]
|
||||
#[derive(Clone, Hash, PartialEq, Eq, Show)]
|
||||
enum Node {
|
||||
RegionVid(ty::RegionVid),
|
||||
Region(ty::Region),
|
||||
|
|
|
@ -42,7 +42,7 @@ mod doc;
|
|||
mod graphviz;
|
||||
|
||||
// A constraint that influences the inference process.
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
|
||||
pub enum Constraint {
|
||||
// One region variable is subregion of another
|
||||
ConstrainVarSubVar(RegionVid, RegionVid),
|
||||
|
@ -69,13 +69,13 @@ pub enum Verify<'tcx> {
|
|||
VerifyParamBound(ty::ParamTy, SubregionOrigin<'tcx>, Region, Vec<Region>),
|
||||
}
|
||||
|
||||
#[deriving(Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Copy, PartialEq, Eq, Hash)]
|
||||
pub struct TwoRegions {
|
||||
a: Region,
|
||||
b: Region,
|
||||
}
|
||||
|
||||
#[deriving(Copy, PartialEq)]
|
||||
#[derive(Copy, PartialEq)]
|
||||
pub enum UndoLogEntry {
|
||||
OpenSnapshot,
|
||||
CommitedSnapshot,
|
||||
|
@ -86,12 +86,12 @@ pub enum UndoLogEntry {
|
|||
AddCombination(CombineMapType, TwoRegions)
|
||||
}
|
||||
|
||||
#[deriving(Copy, PartialEq)]
|
||||
#[derive(Copy, PartialEq)]
|
||||
pub enum CombineMapType {
|
||||
Lub, Glb
|
||||
}
|
||||
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub enum RegionResolutionError<'tcx> {
|
||||
/// `ConcreteFailure(o, a, b)`:
|
||||
///
|
||||
|
@ -143,7 +143,7 @@ pub enum RegionResolutionError<'tcx> {
|
|||
/// ```
|
||||
/// would report an error because we expect 'a and 'b to match, and so we group
|
||||
/// 'a and 'b together inside a SameRegions struct
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub struct SameRegions {
|
||||
pub scope_id: ast::NodeId,
|
||||
pub regions: Vec<BoundRegion>
|
||||
|
@ -217,7 +217,7 @@ pub struct RegionVarBindings<'a, 'tcx: 'a> {
|
|||
values: RefCell<Option<Vec<VarValue>>>,
|
||||
}
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
#[allow(missing_copy_implementations)]
|
||||
pub struct RegionSnapshot {
|
||||
length: uint,
|
||||
|
@ -937,10 +937,10 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> {
|
|||
|
||||
// ______________________________________________________________________
|
||||
|
||||
#[deriving(Copy, PartialEq, Show)]
|
||||
#[derive(Copy, PartialEq, Show)]
|
||||
enum Classification { Expanding, Contracting }
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub enum VarValue { NoValue, Value(Region), ErrorValue }
|
||||
|
||||
struct VarData {
|
||||
|
|
|
@ -46,7 +46,7 @@ struct Delegate;
|
|||
|
||||
type Relation = (RelationDir, ty::TyVid);
|
||||
|
||||
#[deriving(Copy, PartialEq, Show)]
|
||||
#[derive(Copy, PartialEq, Show)]
|
||||
pub enum RelationDir {
|
||||
SubtypeOf, SupertypeOf, EqTo
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ pub trait UnifyValue<'tcx> : Clone + Repr<'tcx> + PartialEq {
|
|||
/// to keep the DAG relatively balanced, which helps keep the running
|
||||
/// time of the algorithm under control. For more information, see
|
||||
/// <http://en.wikipedia.org/wiki/Disjoint-set_data_structure>.
|
||||
#[deriving(PartialEq,Clone)]
|
||||
#[derive(PartialEq,Clone)]
|
||||
pub enum VarValue<K,V> {
|
||||
Redirect(K),
|
||||
Root(V, uint),
|
||||
|
@ -90,7 +90,7 @@ pub struct Node<K,V> {
|
|||
pub rank: uint,
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Delegate;
|
||||
|
||||
// We can't use V:LatticeValue, much as I would like to,
|
||||
|
|
|
@ -46,7 +46,7 @@ macro_rules! lets_do_this {
|
|||
$( $variant:ident, $name:expr, $method:ident; )*
|
||||
) => {
|
||||
|
||||
#[deriving(Copy, FromPrimitive, PartialEq, Eq, Hash)]
|
||||
#[derive(Copy, FromPrimitive, PartialEq, Eq, Hash)]
|
||||
pub enum LangItem {
|
||||
$($variant),*
|
||||
}
|
||||
|
|
|
@ -138,10 +138,10 @@ enum LoopKind<'a> {
|
|||
ForLoop(&'a ast::Pat),
|
||||
}
|
||||
|
||||
#[deriving(Copy, PartialEq)]
|
||||
#[derive(Copy, PartialEq)]
|
||||
struct Variable(uint);
|
||||
|
||||
#[deriving(Copy, PartialEq)]
|
||||
#[derive(Copy, PartialEq)]
|
||||
struct LiveNode(uint);
|
||||
|
||||
impl Variable {
|
||||
|
@ -158,7 +158,7 @@ impl Clone for LiveNode {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Copy, PartialEq, Show)]
|
||||
#[derive(Copy, PartialEq, Show)]
|
||||
enum LiveNodeKind {
|
||||
FreeVarNode(Span),
|
||||
ExprNode(Span),
|
||||
|
@ -244,13 +244,13 @@ struct CaptureInfo {
|
|||
var_nid: NodeId
|
||||
}
|
||||
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
struct LocalInfo {
|
||||
id: NodeId,
|
||||
ident: ast::Ident
|
||||
}
|
||||
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
enum VarKind {
|
||||
Arg(NodeId, ast::Ident),
|
||||
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
|
||||
// the same basic propagation framework in all cases.
|
||||
|
||||
#[deriving(Clone, Copy)]
|
||||
#[derive(Clone, Copy)]
|
||||
struct Users {
|
||||
reader: LiveNode,
|
||||
writer: LiveNode,
|
||||
|
@ -544,7 +544,7 @@ fn invalid_users() -> Users {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
struct Specials {
|
||||
exit_ln: LiveNode,
|
||||
fallthrough_ln: LiveNode,
|
||||
|
|
|
@ -87,7 +87,7 @@ use syntax::parse::token;
|
|||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
|
||||
#[deriving(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
pub enum categorization<'tcx> {
|
||||
cat_rvalue(ty::Region), // temporary val, argument is its scope
|
||||
cat_static_item,
|
||||
|
@ -101,7 +101,7 @@ pub enum categorization<'tcx> {
|
|||
}
|
||||
|
||||
// Represents any kind of upvar
|
||||
#[deriving(Clone, Copy, PartialEq, Show)]
|
||||
#[derive(Clone, Copy, PartialEq, Show)]
|
||||
pub struct Upvar {
|
||||
pub id: ty::UpvarId,
|
||||
// Unboxed closure kinds are used even for old-style closures for simplicity
|
||||
|
@ -111,7 +111,7 @@ pub struct Upvar {
|
|||
}
|
||||
|
||||
// different kinds of pointers:
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
|
||||
pub enum PointerKind {
|
||||
Unique,
|
||||
BorrowedPtr(ty::BorrowKind, ty::Region),
|
||||
|
@ -121,25 +121,25 @@ pub enum PointerKind {
|
|||
|
||||
// We use the term "interior" to mean "something reachable from the
|
||||
// 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 {
|
||||
InteriorField(FieldName),
|
||||
InteriorElement(ElementKind),
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
|
||||
pub enum FieldName {
|
||||
NamedField(ast::Name),
|
||||
PositionalField(uint)
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
|
||||
pub enum ElementKind {
|
||||
VecElement,
|
||||
OtherElement,
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
|
||||
pub enum MutabilityCategory {
|
||||
McImmutable, // Immutable.
|
||||
McDeclared, // Directly declared as mutable.
|
||||
|
@ -151,7 +151,7 @@ pub enum MutabilityCategory {
|
|||
// Upvar categorization can generate a variable number of nested
|
||||
// derefs. The note allows detecting them without deep pattern
|
||||
// matching on the categorization.
|
||||
#[deriving(Clone, Copy, PartialEq, Show)]
|
||||
#[derive(Clone, Copy, PartialEq, Show)]
|
||||
pub enum Note {
|
||||
NoteClosureEnv(ty::UpvarId), // Deref through closure env
|
||||
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
|
||||
// (`@T`). So use `cmt.ty` to find the type of the value in a consistent
|
||||
// fashion. For more details, see the method `cat_pattern`
|
||||
#[deriving(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
pub struct cmt_<'tcx> {
|
||||
pub id: ast::NodeId, // id of expr/pat producing this value
|
||||
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
|
||||
// as accessing of components:
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub enum deref_kind {
|
||||
deref_ptr(PointerKind),
|
||||
deref_interior(InteriorKind),
|
||||
|
@ -1296,13 +1296,13 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub enum InteriorSafety {
|
||||
InteriorUnsafe,
|
||||
InteriorSafe
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub enum AliasableReason {
|
||||
AliasableBorrowed,
|
||||
AliasableClosure(ast::NodeId), // Aliasable due to capture Fn closure env
|
||||
|
|
|
@ -49,7 +49,7 @@ pub type PublicItems = NodeSet;
|
|||
// FIXME: dox
|
||||
pub type LastPrivateMap = NodeMap<LastPrivate>;
|
||||
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
pub enum LastPrivate {
|
||||
LastMod(PrivateDep),
|
||||
// `use` directives (imports) can refer to two separate definitions in the
|
||||
|
@ -63,14 +63,14 @@ pub enum LastPrivate {
|
|||
type_used: ImportUse},
|
||||
}
|
||||
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
pub enum PrivateDep {
|
||||
AllPublic,
|
||||
DependsOn(ast::DefId),
|
||||
}
|
||||
|
||||
// How an import is used.
|
||||
#[deriving(Copy, PartialEq, Show)]
|
||||
#[derive(Copy, PartialEq, Show)]
|
||||
pub enum ImportUse {
|
||||
Unused, // The import is not used.
|
||||
Used, // The import is used.
|
||||
|
|
|
@ -36,7 +36,7 @@ use syntax::visit::{Visitor, FnKind};
|
|||
/// placate the same deriving in `ty::FreeRegion`, but we may want to
|
||||
/// actually attach a more meaningful ordering to scopes than the one
|
||||
/// generated via deriving here.
|
||||
#[deriving(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, RustcEncodable,
|
||||
#[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, RustcEncodable,
|
||||
RustcDecodable, Show, Copy)]
|
||||
pub enum CodeExtent {
|
||||
Misc(ast::NodeId)
|
||||
|
@ -116,7 +116,7 @@ pub struct RegionMaps {
|
|||
terminating_scopes: RefCell<FnvHashSet<CodeExtent>>,
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct Context {
|
||||
var_parent: Option<ast::NodeId>,
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ use syntax::visit;
|
|||
use syntax::visit::Visitor;
|
||||
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 {
|
||||
DefStaticRegion,
|
||||
DefEarlyBoundRegion(/* space */ subst::ParamSpace,
|
||||
|
|
|
@ -28,7 +28,7 @@ use syntax::codemap::{Span, DUMMY_SP};
|
|||
/// identify each in-scope parameter by an *index* and a *parameter
|
||||
/// space* (which indices where the parameter is defined; see
|
||||
/// `ParamSpace`).
|
||||
#[deriving(Clone, PartialEq, Eq, Hash, Show)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, Show)]
|
||||
pub struct Substs<'tcx> {
|
||||
pub types: VecPerParamSpace<Ty<'tcx>>,
|
||||
pub regions: RegionSubsts,
|
||||
|
@ -37,7 +37,7 @@ pub struct Substs<'tcx> {
|
|||
/// Represents the values to use when substituting lifetime parameters.
|
||||
/// If the value is `ErasedRegions`, then this subst is occurring during
|
||||
/// 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 {
|
||||
ErasedRegions,
|
||||
NonerasedRegions(VecPerParamSpace<ty::Region>)
|
||||
|
@ -179,7 +179,7 @@ impl RegionSubsts {
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// ParamSpace
|
||||
|
||||
#[deriving(PartialOrd, Ord, PartialEq, Eq, Copy,
|
||||
#[derive(PartialOrd, Ord, PartialEq, Eq, Copy,
|
||||
Clone, Hash, RustcEncodable, RustcDecodable, Show)]
|
||||
pub enum ParamSpace {
|
||||
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
|
||||
/// the set of things declared on the type, self, or method
|
||||
/// distinct.
|
||||
#[deriving(PartialEq, Eq, Clone, Hash, RustcEncodable, RustcDecodable)]
|
||||
#[derive(PartialEq, Eq, Clone, Hash, RustcEncodable, RustcDecodable)]
|
||||
pub struct VecPerParamSpace<T> {
|
||||
// This was originally represented as a tuple with one Vec<T> for
|
||||
// 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> {
|
||||
vec: &'a VecPerParamSpace<T>,
|
||||
space_index: uint,
|
||||
|
|
|
@ -63,7 +63,7 @@ mod util;
|
|||
/// either identifying an `impl` (e.g., `impl Eq for int`) that
|
||||
/// provides the required vtable, or else finding a bound that is in
|
||||
/// scope. The eventual result is usually a `Selection` (defined below).
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct Obligation<'tcx, T> {
|
||||
pub cause: ObligationCause<'tcx>,
|
||||
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>>;
|
||||
|
||||
/// Why did we incur this obligation? Used for error reporting.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct ObligationCause<'tcx> {
|
||||
pub span: Span,
|
||||
|
||||
|
@ -89,7 +89,7 @@ pub struct ObligationCause<'tcx> {
|
|||
pub code: ObligationCauseCode<'tcx>
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub enum ObligationCauseCode<'tcx> {
|
||||
/// Not well classified or should be obvious from span.
|
||||
MiscObligation,
|
||||
|
@ -126,7 +126,7 @@ pub enum ObligationCauseCode<'tcx> {
|
|||
ImplDerivedObligation(DerivedObligationCause<'tcx>),
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct DerivedObligationCause<'tcx> {
|
||||
/// The trait reference of the parent obligation that led to the
|
||||
/// 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>>;
|
||||
|
||||
#[deriving(Clone,Show)]
|
||||
#[derive(Clone,Show)]
|
||||
pub enum SelectionError<'tcx> {
|
||||
Unimplemented,
|
||||
Overflow,
|
||||
|
@ -158,7 +158,7 @@ pub struct FulfillmentError<'tcx> {
|
|||
pub code: FulfillmentErrorCode<'tcx>
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub enum FulfillmentErrorCode<'tcx> {
|
||||
CodeSelectionError(SelectionError<'tcx>),
|
||||
CodeProjectionError(MismatchedProjectionTypes<'tcx>),
|
||||
|
@ -212,7 +212,7 @@ pub type SelectionResult<'tcx, T> = Result<Option<T>, SelectionError<'tcx>>;
|
|||
/// ### The type parameter `N`
|
||||
///
|
||||
/// See explanation on `VtableImplData`.
|
||||
#[deriving(Show,Clone)]
|
||||
#[derive(Show,Clone)]
|
||||
pub enum Vtable<'tcx, N> {
|
||||
/// Vtable identifying a particular impl.
|
||||
VtableImpl(VtableImplData<'tcx, N>),
|
||||
|
@ -247,21 +247,21 @@ pub enum Vtable<'tcx, N> {
|
|||
/// is `Obligation`, as one might expect. During trans, however, this
|
||||
/// is `()`, because trans only requires a shallow resolution of an
|
||||
/// impl, and nested obligations are satisfied later.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct VtableImplData<'tcx, N> {
|
||||
pub impl_def_id: ast::DefId,
|
||||
pub substs: subst::Substs<'tcx>,
|
||||
pub nested: subst::VecPerParamSpace<N>
|
||||
}
|
||||
|
||||
#[deriving(Show,Clone)]
|
||||
#[derive(Show,Clone)]
|
||||
pub struct VtableBuiltinData<N> {
|
||||
pub nested: subst::VecPerParamSpace<N>
|
||||
}
|
||||
|
||||
/// A vtable for some object-safe trait `Foo` automatically derived
|
||||
/// for the object type `Foo`.
|
||||
#[deriving(PartialEq,Eq,Clone)]
|
||||
#[derive(PartialEq,Eq,Clone)]
|
||||
pub struct VtableObjectData<'tcx> {
|
||||
pub object_ty: Ty<'tcx>,
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ pub enum ObjectSafetyViolation<'tcx> {
|
|||
}
|
||||
|
||||
/// Reasons a method might not be object-safe.
|
||||
#[deriving(Copy,Clone,Show)]
|
||||
#[derive(Copy,Clone,Show)]
|
||||
pub enum MethodViolationCode {
|
||||
/// e.g., `fn(self)`
|
||||
ByValueSelf,
|
||||
|
|
|
@ -45,7 +45,7 @@ pub enum ProjectionTyError<'tcx> {
|
|||
TraitSelectionError(SelectionError<'tcx>),
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct MismatchedProjectionTypes<'tcx> {
|
||||
pub err: ty::type_err<'tcx>
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ struct TraitObligationStack<'prev, 'tcx: 'prev> {
|
|||
previous: Option<&'prev TraitObligationStack<'prev, 'tcx>>
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct SelectionCache<'tcx> {
|
||||
hashmap: RefCell<HashMap<Rc<ty::TraitRef<'tcx>>,
|
||||
SelectionResult<'tcx, SelectionCandidate<'tcx>>>>,
|
||||
|
@ -95,7 +95,7 @@ pub enum MethodMatchResult {
|
|||
MethodDidNotMatch,
|
||||
}
|
||||
|
||||
#[deriving(Copy, Show)]
|
||||
#[derive(Copy, Show)]
|
||||
pub enum MethodMatchedData {
|
||||
// In the case of a precise match, we don't really need to store
|
||||
// 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
|
||||
/// clauses can give additional information (like, the types of output
|
||||
/// parameters) that would have to be inferred from the impl.
|
||||
#[deriving(PartialEq,Eq,Show,Clone)]
|
||||
#[derive(PartialEq,Eq,Show,Clone)]
|
||||
enum SelectionCandidate<'tcx> {
|
||||
BuiltinCandidate(ty::BuiltinBound),
|
||||
ParamCandidate(ty::PolyTraitRef<'tcx>),
|
||||
|
@ -171,7 +171,7 @@ enum BuiltinBoundConditions<'tcx> {
|
|||
AmbiguousBuiltin
|
||||
}
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
enum EvaluationResult<'tcx> {
|
||||
EvaluatedToOk,
|
||||
EvaluatedToAmbig,
|
||||
|
|
|
@ -108,13 +108,13 @@ pub struct CrateAnalysis<'tcx> {
|
|||
pub glob_map: Option<GlobMap>,
|
||||
}
|
||||
|
||||
#[deriving(Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Copy, PartialEq, Eq, Hash)]
|
||||
pub struct field<'tcx> {
|
||||
pub name: ast::Name,
|
||||
pub mt: mt<'tcx>
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, Show)]
|
||||
#[derive(Clone, Copy, Show)]
|
||||
pub enum ImplOrTraitItemContainer {
|
||||
TraitContainer(ast::DefId),
|
||||
ImplContainer(ast::DefId),
|
||||
|
@ -129,7 +129,7 @@ impl ImplOrTraitItemContainer {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub enum ImplOrTraitItem<'tcx> {
|
||||
MethodTraitItem(Rc<Method<'tcx>>),
|
||||
TypeTraitItem(Rc<AssociatedType>),
|
||||
|
@ -174,7 +174,7 @@ impl<'tcx> ImplOrTraitItem<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, Show)]
|
||||
#[derive(Clone, Copy, Show)]
|
||||
pub enum ImplOrTraitItemId {
|
||||
MethodTraitItemId(ast::DefId),
|
||||
TypeTraitItemId(ast::DefId),
|
||||
|
@ -189,7 +189,7 @@ impl ImplOrTraitItemId {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub struct Method<'tcx> {
|
||||
pub name: ast::Name,
|
||||
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 name: ast::Name,
|
||||
pub vis: ast::Visibility,
|
||||
|
@ -241,13 +241,13 @@ pub struct AssociatedType {
|
|||
pub container: ImplOrTraitItemContainer,
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
|
||||
pub struct mt<'tcx> {
|
||||
pub ty: Ty<'tcx>,
|
||||
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 {
|
||||
/// Box<Trait>
|
||||
UniqTraitStore,
|
||||
|
@ -255,7 +255,7 @@ pub enum TraitStore {
|
|||
RegionTraitStore(Region, ast::Mutability),
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, Show)]
|
||||
#[derive(Clone, Copy, Show)]
|
||||
pub struct field_ty {
|
||||
pub name: Name,
|
||||
pub id: DefId,
|
||||
|
@ -265,26 +265,26 @@ pub struct field_ty {
|
|||
|
||||
// Contains information needed to resolve types and (in the future) look up
|
||||
// the types of AST nodes.
|
||||
#[deriving(Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Copy, PartialEq, Eq, Hash)]
|
||||
pub struct creader_cache_key {
|
||||
pub cnum: CrateNum,
|
||||
pub pos: uint,
|
||||
pub len: uint
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub enum ast_ty_to_ty_cache_entry<'tcx> {
|
||||
atttce_unresolved, /* not resolved yet */
|
||||
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 types: VecPerParamSpace<Variance>,
|
||||
pub regions: VecPerParamSpace<Variance>,
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq, RustcDecodable, RustcEncodable, Show, Copy)]
|
||||
#[derive(Clone, PartialEq, RustcDecodable, RustcEncodable, Show, Copy)]
|
||||
pub enum Variance {
|
||||
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
|
||||
|
@ -292,14 +292,14 @@ pub enum Variance {
|
|||
Bivariant, // T<A> <: T<B> -- e.g., unused type parameter
|
||||
}
|
||||
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub enum AutoAdjustment<'tcx> {
|
||||
AdjustAddEnv(ast::DefId, ty::TraitStore),
|
||||
AdjustReifyFnPointer(ast::DefId), // go from a fn-item type to a fn-pointer type
|
||||
AdjustDerefRef(AutoDerefRef<'tcx>)
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
pub enum UnsizeKind<'tcx> {
|
||||
// [T, ..n] -> [T], the uint field is n.
|
||||
UnsizeLength(uint),
|
||||
|
@ -309,13 +309,13 @@ pub enum UnsizeKind<'tcx> {
|
|||
UnsizeVtable(TyTrait<'tcx>, /* the self type of the trait */ Ty<'tcx>)
|
||||
}
|
||||
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub struct AutoDerefRef<'tcx> {
|
||||
pub autoderefs: uint,
|
||||
pub autoref: Option<AutoRef<'tcx>>
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq, Show)]
|
||||
#[derive(Clone, PartialEq, Show)]
|
||||
pub enum AutoRef<'tcx> {
|
||||
/// Convert from T to &T
|
||||
/// 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 space: subst::ParamSpace,
|
||||
pub index: uint
|
||||
}
|
||||
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub enum MethodOrigin<'tcx> {
|
||||
// fully statically resolved method
|
||||
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
|
||||
// with a bounded trait.
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub struct MethodParam<'tcx> {
|
||||
// the precise trait reference that occurs as a bound -- this may
|
||||
// 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
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub struct MethodObject<'tcx> {
|
||||
// the (super)trait containing the method to be invoked
|
||||
pub trait_ref: Rc<ty::TraitRef<'tcx>>,
|
||||
|
@ -487,7 +487,7 @@ pub struct MethodObject<'tcx> {
|
|||
pub real_index: uint,
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct MethodCallee<'tcx> {
|
||||
pub origin: MethodOrigin<'tcx>,
|
||||
pub ty: Ty<'tcx>,
|
||||
|
@ -506,13 +506,13 @@ pub struct MethodCallee<'tcx> {
|
|||
/// needed to add to the side tables. Thus to disambiguate
|
||||
/// we also keep track of whether there's an adjustment in
|
||||
/// our key.
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, Hash, Show)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
|
||||
pub struct MethodCall {
|
||||
pub expr_id: ast::NodeId,
|
||||
pub adjustment: ExprAdjustment
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq, Eq, Hash, Show, RustcEncodable, RustcDecodable, Copy)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, Show, RustcEncodable, RustcDecodable, Copy)]
|
||||
pub enum ExprAdjustment {
|
||||
NoAdjustment,
|
||||
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.
|
||||
pub type vtable_res<'tcx> = VecPerParamSpace<vtable_param_res<'tcx>>;
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub enum vtable_origin<'tcx> {
|
||||
/*
|
||||
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
|
||||
/// `transmute_restrictions` vector during `intrinsicck`. They are
|
||||
/// then checked during `trans` by the fn `check_intrinsics`.
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub struct TransmuteRestriction<'tcx> {
|
||||
/// The span whence the restriction comes.
|
||||
pub span: Span,
|
||||
|
@ -858,7 +858,7 @@ macro_rules! sty_debug_print {
|
|||
// variable names.
|
||||
mod inner {
|
||||
use middle::ty;
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
struct DebugStat {
|
||||
total: uint,
|
||||
region_infer: uint,
|
||||
|
@ -926,7 +926,7 @@ impl<'tcx> ctxt<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Show)]
|
||||
#[derive(Show)]
|
||||
pub struct TyS<'tcx> {
|
||||
pub sty: sty<'tcx>,
|
||||
pub flags: TypeFlags,
|
||||
|
@ -1032,14 +1032,14 @@ pub fn type_escapes_depth(ty: Ty, depth: u32) -> bool {
|
|||
ty.region_depth > depth
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq, Eq, Hash, Show)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, Show)]
|
||||
pub struct BareFnTy<'tcx> {
|
||||
pub unsafety: ast::Unsafety,
|
||||
pub abi: abi::Abi,
|
||||
pub sig: PolyFnSig<'tcx>,
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq, Eq, Hash, Show)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, Show)]
|
||||
pub struct ClosureTy<'tcx> {
|
||||
pub unsafety: ast::Unsafety,
|
||||
pub onceness: ast::Onceness,
|
||||
|
@ -1049,7 +1049,7 @@ pub struct ClosureTy<'tcx> {
|
|||
pub abi: abi::Abi,
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub enum FnOutput<'tcx> {
|
||||
FnConverging(Ty<'tcx>),
|
||||
FnDiverging
|
||||
|
@ -1070,7 +1070,7 @@ impl<'tcx> FnOutput<'tcx> {
|
|||
/// - `inputs` is the list of arguments and their modes.
|
||||
/// - `output` is the return type.
|
||||
/// - `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 inputs: Vec<Ty<'tcx>>,
|
||||
pub output: FnOutput<'tcx>,
|
||||
|
@ -1079,7 +1079,7 @@ pub struct 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 space: subst::ParamSpace,
|
||||
pub idx: u32,
|
||||
|
@ -1125,7 +1125,7 @@ pub struct ParamTy {
|
|||
/// is the outer fn.
|
||||
///
|
||||
/// [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 {
|
||||
// We maintain the invariant that this is never 0. So 1 indicates
|
||||
// the innermost binder. To ensure this, create with `DebruijnIndex::new`.
|
||||
|
@ -1133,7 +1133,7 @@ pub struct DebruijnIndex {
|
|||
}
|
||||
|
||||
/// Representation of regions:
|
||||
#[deriving(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show, Copy)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Show, Copy)]
|
||||
pub enum Region {
|
||||
// Region bound in a type or fn declaration which will be
|
||||
// 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
|
||||
/// the original var id (that is, the root variable that is referenced
|
||||
/// 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 var_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 {
|
||||
/// Data must be immutable and is aliasable.
|
||||
ImmBorrow,
|
||||
|
@ -1273,7 +1273,7 @@ pub enum BorrowKind {
|
|||
/// - Through mutation, the borrowed upvars can actually escape
|
||||
/// the closure, so sometimes it is necessary for them to be larger
|
||||
/// than the closure lifetime itself.
|
||||
#[deriving(PartialEq, Clone, RustcEncodable, RustcDecodable, Show, Copy)]
|
||||
#[derive(PartialEq, Clone, RustcEncodable, RustcDecodable, Show, Copy)]
|
||||
pub struct UpvarBorrow {
|
||||
pub kind: BorrowKind,
|
||||
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)]
|
||||
/// A "free" region `fr` can be interpreted as "some region
|
||||
/// at least as big as the scope `fr.scope`".
|
||||
|
@ -1307,7 +1307,7 @@ pub struct FreeRegion {
|
|||
pub bound_region: BoundRegion
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq, PartialOrd, Eq, Ord, Hash,
|
||||
#[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash,
|
||||
RustcEncodable, RustcDecodable, Show, Copy)]
|
||||
pub enum BoundRegion {
|
||||
/// 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
|
||||
// AST structure in libsyntax/ast.rs as well.
|
||||
#[deriving(Clone, PartialEq, Eq, Hash, Show)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, Show)]
|
||||
pub enum sty<'tcx> {
|
||||
ty_bool,
|
||||
ty_char,
|
||||
|
@ -1377,7 +1377,7 @@ pub enum sty<'tcx> {
|
|||
// on non-useful type error messages)
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq, Eq, Hash, Show)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, Show)]
|
||||
pub struct TyTrait<'tcx> {
|
||||
pub principal: ty::PolyTraitRef<'tcx>,
|
||||
pub bounds: ExistentialBounds<'tcx>,
|
||||
|
@ -1449,7 +1449,7 @@ impl<'tcx> TyTrait<'tcx> {
|
|||
/// Note that a `TraitRef` introduces a level of region binding, to
|
||||
/// account for higher-ranked trait bounds like `T : for<'a> Foo<&'a
|
||||
/// U>` or higher-ranked object types.
|
||||
#[deriving(Clone, PartialEq, Eq, Hash, Show)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, Show)]
|
||||
pub struct TraitRef<'tcx> {
|
||||
pub def_id: DefId,
|
||||
pub substs: &'tcx Substs<'tcx>,
|
||||
|
@ -1487,16 +1487,16 @@ impl<'tcx> PolyTraitRef<'tcx> {
|
|||
/// erase, or otherwise "discharge" these bound reons, we change the
|
||||
/// type from `Binder<T>` to just `T` (see
|
||||
/// e.g. `liberate_late_bound_regions`).
|
||||
#[deriving(Clone, PartialEq, Eq, Hash, Show)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, Show)]
|
||||
pub struct Binder<T>(pub T);
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq)]
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub enum IntVarValue {
|
||||
IntType(ast::IntTy),
|
||||
UintType(ast::UintTy),
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, Show)]
|
||||
#[derive(Clone, Copy, Show)]
|
||||
pub enum terr_vstore_kind {
|
||||
terr_vec,
|
||||
terr_str,
|
||||
|
@ -1504,14 +1504,14 @@ pub enum terr_vstore_kind {
|
|||
terr_trait
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, Show)]
|
||||
#[derive(Clone, Copy, Show)]
|
||||
pub struct expected_found<T> {
|
||||
pub expected: T,
|
||||
pub found: T
|
||||
}
|
||||
|
||||
// Data structures used in type unification
|
||||
#[deriving(Clone, Copy, Show)]
|
||||
#[derive(Clone, Copy, Show)]
|
||||
pub enum type_err<'tcx> {
|
||||
terr_mismatch,
|
||||
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>`
|
||||
/// 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 region_bounds: Vec<ty::Region>,
|
||||
pub builtin_bounds: BuiltinBounds,
|
||||
|
@ -1561,7 +1561,7 @@ pub struct ParamBounds<'tcx> {
|
|||
/// major difference between this case and `ParamBounds` is that
|
||||
/// general purpose trait bounds are omitted and there must be
|
||||
/// *exactly one* region.
|
||||
#[deriving(PartialEq, Eq, Hash, Clone, Show)]
|
||||
#[derive(PartialEq, Eq, Hash, Clone, Show)]
|
||||
pub struct ExistentialBounds<'tcx> {
|
||||
pub region_bound: ty::Region,
|
||||
pub builtin_bounds: BuiltinBounds,
|
||||
|
@ -1570,7 +1570,7 @@ pub struct ExistentialBounds<'tcx> {
|
|||
|
||||
pub type BuiltinBounds = EnumSet<BuiltinBound>;
|
||||
|
||||
#[deriving(Clone, RustcEncodable, PartialEq, Eq, RustcDecodable, Hash,
|
||||
#[derive(Clone, RustcEncodable, PartialEq, Eq, RustcDecodable, Hash,
|
||||
Show, Copy)]
|
||||
#[repr(uint)]
|
||||
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 index: u32
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub struct IntVid {
|
||||
pub index: u32
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub struct FloatVid {
|
||||
pub index: u32
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)]
|
||||
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)]
|
||||
pub struct RegionVid {
|
||||
pub index: u32
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub enum InferTy {
|
||||
TyVar(TyVid),
|
||||
IntVar(IntVid),
|
||||
|
@ -1645,7 +1645,7 @@ pub enum InferTy {
|
|||
FreshIntTy(u32),
|
||||
}
|
||||
|
||||
#[deriving(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)]
|
||||
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Hash, Show, Copy)]
|
||||
pub enum UnconstrainedNumeric {
|
||||
UnconstrainedFloat,
|
||||
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 {
|
||||
ReVar(RegionVid),
|
||||
ReSkolemized(u32, BoundRegion)
|
||||
|
@ -1728,7 +1728,7 @@ impl fmt::Show for IntVarValue {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub struct TypeParameterDef<'tcx> {
|
||||
pub name: ast::Name,
|
||||
pub def_id: ast::DefId,
|
||||
|
@ -1738,7 +1738,7 @@ pub struct TypeParameterDef<'tcx> {
|
|||
pub default: Option<Ty<'tcx>>,
|
||||
}
|
||||
|
||||
#[deriving(RustcEncodable, RustcDecodable, Clone, Show)]
|
||||
#[derive(RustcEncodable, RustcDecodable, Clone, Show)]
|
||||
pub struct RegionParameterDef {
|
||||
pub name: ast::Name,
|
||||
pub def_id: ast::DefId,
|
||||
|
@ -1755,7 +1755,7 @@ impl RegionParameterDef {
|
|||
|
||||
/// Information about the formal type/lifetime parameters associated
|
||||
/// with an item or method. Analogous to ast::Generics.
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub struct Generics<'tcx> {
|
||||
pub types: VecPerParamSpace<TypeParameterDef<'tcx>>,
|
||||
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> {
|
||||
/// Corresponds to `where Foo : Bar<A,B,C>`. `Foo` here would be
|
||||
/// the `Self` type of the trait reference and `A`, `B`, and `C`
|
||||
|
@ -1808,7 +1808,7 @@ pub enum Predicate<'tcx> {
|
|||
Projection(PolyProjectionPredicate<'tcx>),
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq, Eq, Hash, Show)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, Show)]
|
||||
pub struct TraitPredicate<'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 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 type PolyOutlivesPredicate<A,B> = ty::Binder<OutlivesPredicate<A,B>>;
|
||||
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
|
||||
/// #2 eventually yields one of these `ProjectionPredicate`
|
||||
/// instances to normalize the LHS.
|
||||
#[deriving(Clone, PartialEq, Eq, Hash, Show)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, Show)]
|
||||
pub struct ProjectionPredicate<'tcx> {
|
||||
pub projection_ty: ProjectionTy<'tcx>,
|
||||
pub ty: Ty<'tcx>,
|
||||
|
@ -1872,7 +1872,7 @@ impl<'tcx> PolyProjectionPredicate<'tcx> {
|
|||
|
||||
/// Represents the projection of an associated type. In explicit UFCS
|
||||
/// 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> {
|
||||
/// The trait reference `T as Trait<..>`.
|
||||
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
|
||||
/// like `Foo<int,uint>`, then the `GenericBounds` would be `[[],
|
||||
/// [uint:Bar<int>]]`.
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub struct GenericBounds<'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
|
||||
/// future I hope to refine the representation of types so as to make
|
||||
/// more distinctions clearer.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct ParameterEnvironment<'a, 'tcx:'a> {
|
||||
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
|
||||
/// "poly" prefix to refer to higher-ranked things, as in
|
||||
/// `PolyTraitRef`.
|
||||
#[deriving(Clone, Show)]
|
||||
#[derive(Clone, Show)]
|
||||
pub struct TypeScheme<'tcx> {
|
||||
pub generics: Generics<'tcx>,
|
||||
pub ty: Ty<'tcx>
|
||||
|
@ -2234,13 +2234,13 @@ pub struct TraitDef<'tcx> {
|
|||
|
||||
/// Records the substitutions used to translate the polytype for an
|
||||
/// item into the monotype of an item reference.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct ItemSubsts<'tcx> {
|
||||
pub substs: Substs<'tcx>,
|
||||
}
|
||||
|
||||
/// Records information about each unboxed closure.
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct UnboxedClosure<'tcx> {
|
||||
/// The type of the unboxed closure.
|
||||
pub closure_type: ClosureTy<'tcx>,
|
||||
|
@ -2248,7 +2248,7 @@ pub struct UnboxedClosure<'tcx> {
|
|||
pub kind: UnboxedClosureKind,
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq, Eq, Show)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Show)]
|
||||
pub enum UnboxedClosureKind {
|
||||
FnUnboxedClosureKind,
|
||||
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
|
||||
/// easier for me (nmatsakis) to think about what is contained within
|
||||
/// a type than to think about what is *not* contained within a type.
|
||||
#[deriving(Clone, Copy)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct TypeContents {
|
||||
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
|
||||
/// 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 {
|
||||
Representable,
|
||||
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
|
||||
/// generate code for that kind of expression. See trans/expr.rs for more
|
||||
/// information.
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub enum ExprKind {
|
||||
LvalueExpr,
|
||||
RvalueDpsExpr,
|
||||
|
@ -5091,7 +5091,7 @@ pub fn associated_type_parameter_index(cx: &ctxt,
|
|||
cx.sess.bug("couldn't find associated type parameter index")
|
||||
}
|
||||
|
||||
#[deriving(Copy, PartialEq, Eq)]
|
||||
#[derive(Copy, PartialEq, Eq)]
|
||||
pub struct AssociatedTypeInfo {
|
||||
pub def_id: ast::DefId,
|
||||
pub index: uint,
|
||||
|
@ -5186,7 +5186,7 @@ pub fn ty_to_def_id(ty: Ty) -> Option<ast::DefId> {
|
|||
}
|
||||
|
||||
// Enum information
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct VariantInfo<'tcx> {
|
||||
pub args: Vec<Ty<'tcx>>,
|
||||
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()
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub enum DtorKind {
|
||||
NoDtor,
|
||||
TraitDtor(DefId, bool)
|
||||
|
@ -5712,7 +5712,7 @@ pub fn tup_fields<'tcx>(v: &[Ty<'tcx>]) -> Vec<field<'tcx>> {
|
|||
}).collect()
|
||||
}
|
||||
|
||||
#[deriving(Copy, Clone)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct UnboxedClosureUpvar<'tcx> {
|
||||
pub def: def::Def,
|
||||
pub span: Span,
|
||||
|
@ -6643,7 +6643,7 @@ impl<'a,'tcx> UnboxedClosureTyper<'tcx> for ty::ParameterEnvironment<'a,'tcx> {
|
|||
|
||||
|
||||
/// The category of explicit self.
|
||||
#[deriving(Clone, Copy, Eq, PartialEq, Show)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Show)]
|
||||
pub enum ExplicitSelfCategory {
|
||||
StaticExplicitSelfCategory,
|
||||
ByValueExplicitSelfCategory,
|
||||
|
@ -6712,7 +6712,7 @@ pub fn accumulate_lifetimes_in_type(accumulator: &mut Vec<ty::Region>,
|
|||
}
|
||||
|
||||
/// A free variable referred to in a function.
|
||||
#[deriving(Copy, RustcEncodable, RustcDecodable)]
|
||||
#[derive(Copy, RustcEncodable, RustcDecodable)]
|
||||
pub struct Freevar {
|
||||
/// The variable being accessed free.
|
||||
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)
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[derive(Copy)]
|
||||
pub enum CopyImplementationError {
|
||||
FieldDoesNotImplementCopy(ast::Name),
|
||||
VariantDoesNotImplementCopy(ast::Name),
|
||||
|
|
|
@ -46,7 +46,7 @@ pub struct Config {
|
|||
pub uint_type: UintTy,
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq)]
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub enum OptLevel {
|
||||
No, // -O0
|
||||
Less, // -O1
|
||||
|
@ -54,14 +54,14 @@ pub enum OptLevel {
|
|||
Aggressive // -O3
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq)]
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub enum DebugInfoLevel {
|
||||
NoDebugInfo,
|
||||
LimitedDebugInfo,
|
||||
FullDebugInfo,
|
||||
}
|
||||
|
||||
#[deriving(Clone, Copy, PartialEq, PartialOrd, Ord, Eq)]
|
||||
#[derive(Clone, Copy, PartialEq, PartialOrd, Ord, Eq)]
|
||||
pub enum OutputType {
|
||||
OutputTypeBitcode,
|
||||
OutputTypeAssembly,
|
||||
|
@ -71,7 +71,7 @@ pub enum OutputType {
|
|||
OutputTypeDepInfo,
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct Options {
|
||||
// The crate config requested for the session, which may be combined
|
||||
// with additional crate configurations during the compile process
|
||||
|
@ -113,7 +113,7 @@ pub struct Options {
|
|||
pub alt_std_name: Option<String>
|
||||
}
|
||||
|
||||
#[deriving(Clone, PartialEq, Eq)]
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
#[allow(missing_copy_implementations)]
|
||||
pub enum PrintRequest {
|
||||
FileNames,
|
||||
|
@ -137,7 +137,7 @@ impl Input {
|
|||
}
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct OutputFilenames {
|
||||
pub out_directory: Path,
|
||||
pub out_filestem: String,
|
||||
|
@ -222,14 +222,14 @@ pub fn basic_options() -> Options {
|
|||
// users can have their own entry
|
||||
// functions that don't start a
|
||||
// scheduler
|
||||
#[deriving(Copy, PartialEq)]
|
||||
#[derive(Copy, PartialEq)]
|
||||
pub enum EntryFnType {
|
||||
EntryMain,
|
||||
EntryStart,
|
||||
EntryNone,
|
||||
}
|
||||
|
||||
#[deriving(Copy, PartialEq, PartialOrd, Clone, Ord, Eq, Hash)]
|
||||
#[derive(Copy, PartialEq, PartialOrd, Clone, Ord, Eq, Hash)]
|
||||
pub enum CrateType {
|
||||
CrateTypeExecutable,
|
||||
CrateTypeDylib,
|
||||
|
@ -337,7 +337,7 @@ pub fn debugging_opts_map() -> Vec<(&'static str, &'static str, u64)> {
|
|||
]
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub enum Passes {
|
||||
SomePasses(Vec<String>),
|
||||
AllPasses,
|
||||
|
@ -365,7 +365,7 @@ impl Passes {
|
|||
macro_rules! cgoptions {
|
||||
($($opt:ident : $t:ty = ($init:expr, $parse:ident, $desc:expr)),* ,) =>
|
||||
(
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct CodegenOptions { $(pub $opt: $t),* }
|
||||
|
||||
pub fn basic_codegen_options() -> CodegenOptions {
|
||||
|
@ -674,10 +674,10 @@ pub fn optgroups() -> Vec<getopts::OptGroup> {
|
|||
.collect()
|
||||
}
|
||||
|
||||
#[deriving(Copy, Clone, PartialEq, Eq, Show)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Show)]
|
||||
pub enum OptionStability { Stable, Unstable }
|
||||
|
||||
#[deriving(Clone, PartialEq, Eq)]
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub struct RustcOptGroup {
|
||||
pub opt_group: getopts::OptGroup,
|
||||
pub stability: OptionStability,
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
use std::slice;
|
||||
|
||||
#[deriving(Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct SearchPaths {
|
||||
paths: Vec<(PathKind, Path)>,
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ pub struct Iter<'a> {
|
|||
iter: slice::Iter<'a, (PathKind, Path)>,
|
||||
}
|
||||
|
||||
#[deriving(Eq, PartialEq, Clone, Copy)]
|
||||
#[derive(Eq, PartialEq, Clone, Copy)]
|
||||
pub enum PathKind {
|
||||
Native,
|
||||
Crate,
|
||||
|
|
|
@ -23,7 +23,7 @@ use syntax::visit::Visitor;
|
|||
|
||||
// Useful type to use with `Result<>` indicate that an error has already
|
||||
// been reported to the user, so no need to continue checking.
|
||||
#[deriving(Clone, Copy, Show)]
|
||||
#[derive(Clone, Copy, Show)]
|
||||
pub struct ErrorReported;
|
||||
|
||||
pub fn time<T, U, F>(do_it: bool, what: &str, u: U, f: F) -> T where
|
||||
|
|
|
@ -68,7 +68,7 @@ pub mod DefIdSet {
|
|||
///
|
||||
/// This uses FNV hashing, as described here:
|
||||
/// 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;
|
||||
|
||||
#[allow(missing_copy_implementations)]
|
||||
|
|
|
@ -22,7 +22,7 @@ use self::UndoLog::*;
|
|||
|
||||
use std::mem;
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
#[derive(PartialEq)]
|
||||
pub enum UndoLog<T,U> {
|
||||
/// Indicates where a snapshot started.
|
||||
OpenSnapshot,
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue