Fallout in public-facing and semi-public-facing libs
This commit is contained in:
parent
49b76a087b
commit
c35c46821a
39 changed files with 273 additions and 242 deletions
|
@ -1648,7 +1648,7 @@ specific type.
|
||||||
Implementations are defined with the keyword `impl`.
|
Implementations are defined with the keyword `impl`.
|
||||||
|
|
||||||
```
|
```
|
||||||
# #[derive(Copy)]
|
# #[derive(Copy, Clone)]
|
||||||
# struct Point {x: f64, y: f64};
|
# struct Point {x: f64, y: f64};
|
||||||
# type Surface = i32;
|
# type Surface = i32;
|
||||||
# struct BoundingBox {x: f64, y: f64, width: f64, height: f64};
|
# struct BoundingBox {x: f64, y: f64, width: f64, height: f64};
|
||||||
|
@ -1661,6 +1661,10 @@ struct Circle {
|
||||||
|
|
||||||
impl Copy for Circle {}
|
impl Copy for Circle {}
|
||||||
|
|
||||||
|
impl Clone for Circle {
|
||||||
|
fn clone(&self) -> Circle { *self }
|
||||||
|
}
|
||||||
|
|
||||||
impl Shape for Circle {
|
impl Shape for Circle {
|
||||||
fn draw(&self, s: Surface) { do_draw_circle(s, *self); }
|
fn draw(&self, s: Surface) { do_draw_circle(s, *self); }
|
||||||
fn bounding_box(&self) -> BoundingBox {
|
fn bounding_box(&self) -> BoundingBox {
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
//! use std::collections::BinaryHeap;
|
//! use std::collections::BinaryHeap;
|
||||||
//! use std::usize;
|
//! use std::usize;
|
||||||
//!
|
//!
|
||||||
//! #[derive(Copy, Eq, PartialEq)]
|
//! #[derive(Copy, Clone, Eq, PartialEq)]
|
||||||
//! struct State {
|
//! struct State {
|
||||||
//! cost: usize,
|
//! cost: usize,
|
||||||
//! position: usize,
|
//! position: usize,
|
||||||
|
|
|
@ -526,7 +526,7 @@ impl<K: Clone, V: Clone> Clone for Node<K, V> {
|
||||||
/// println!("Uninitialized memory: {:?}", handle.into_kv());
|
/// println!("Uninitialized memory: {:?}", handle.into_kv());
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct Handle<NodeRef, Type, NodeType> {
|
pub struct Handle<NodeRef, Type, NodeType> {
|
||||||
node: NodeRef,
|
node: NodeRef,
|
||||||
index: usize,
|
index: usize,
|
||||||
|
|
|
@ -21,7 +21,7 @@ use core::ops::{Sub, BitOr, BitAnd, BitXor};
|
||||||
|
|
||||||
// FIXME(contentions): implement union family of methods? (general design may be wrong here)
|
// FIXME(contentions): implement union family of methods? (general design may be wrong here)
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
/// A specialized set implementation to use enum types.
|
/// A specialized set implementation to use enum types.
|
||||||
///
|
///
|
||||||
/// It is a logic error for an item to be modified in such a way that the transformation of the
|
/// It is a logic error for an item to be modified in such a way that the transformation of the
|
||||||
|
@ -37,6 +37,10 @@ pub struct EnumSet<E> {
|
||||||
|
|
||||||
impl<E> Copy for EnumSet<E> {}
|
impl<E> Copy for EnumSet<E> {}
|
||||||
|
|
||||||
|
impl<E> Clone for EnumSet<E> {
|
||||||
|
fn clone(&self) -> EnumSet<E> { *self }
|
||||||
|
}
|
||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
impl<E:CLike + fmt::Debug> fmt::Debug for EnumSet<E> {
|
impl<E:CLike + fmt::Debug> fmt::Debug for EnumSet<E> {
|
||||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||||
|
|
|
@ -14,7 +14,7 @@ use collections::enum_set::{CLike, EnumSet};
|
||||||
|
|
||||||
use self::Foo::*;
|
use self::Foo::*;
|
||||||
|
|
||||||
#[derive(Copy, PartialEq, Debug)]
|
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||||
#[repr(usize)]
|
#[repr(usize)]
|
||||||
enum Foo {
|
enum Foo {
|
||||||
A, B, C
|
A, B, C
|
||||||
|
@ -218,7 +218,7 @@ fn test_operators() {
|
||||||
#[should_panic]
|
#[should_panic]
|
||||||
fn test_overflow() {
|
fn test_overflow() {
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
#[repr(usize)]
|
#[repr(usize)]
|
||||||
enum Bar {
|
enum Bar {
|
||||||
V00, V01, V02, V03, V04, V05, V06, V07, V08, V09,
|
V00, V01, V02, V03, V04, V05, V06, V07, V08, V09,
|
||||||
|
|
|
@ -122,7 +122,7 @@ unsafe impl<T> Sync for AtomicPtr<T> {}
|
||||||
/// Rust's memory orderings are [the same as
|
/// Rust's memory orderings are [the same as
|
||||||
/// C++'s](http://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync).
|
/// C++'s](http://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync).
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum Ordering {
|
pub enum Ordering {
|
||||||
/// No ordering constraints, only atomic operations.
|
/// No ordering constraints, only atomic operations.
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
use any;
|
use any;
|
||||||
use cell::{Cell, RefCell, Ref, RefMut, BorrowState};
|
use cell::{Cell, RefCell, Ref, RefMut, BorrowState};
|
||||||
use char::CharExt;
|
use char::CharExt;
|
||||||
|
use clone::Clone;
|
||||||
use iter::Iterator;
|
use iter::Iterator;
|
||||||
use marker::{Copy, PhantomData, Sized};
|
use marker::{Copy, PhantomData, Sized};
|
||||||
use mem;
|
use mem;
|
||||||
|
@ -54,7 +55,7 @@ pub type Result = result::Result<(), Error>;
|
||||||
/// occurred. Any extra information must be arranged to be transmitted through
|
/// occurred. Any extra information must be arranged to be transmitted through
|
||||||
/// some other means.
|
/// some other means.
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub struct Error;
|
pub struct Error;
|
||||||
|
|
||||||
/// A collection of methods that are required to format a message into a stream.
|
/// A collection of methods that are required to format a message into a stream.
|
||||||
|
@ -141,6 +142,12 @@ pub struct ArgumentV1<'a> {
|
||||||
formatter: fn(&Void, &mut Formatter) -> Result,
|
formatter: fn(&Void, &mut Formatter) -> Result,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a> Clone for ArgumentV1<'a> {
|
||||||
|
fn clone(&self) -> ArgumentV1<'a> {
|
||||||
|
*self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'a> ArgumentV1<'a> {
|
impl<'a> ArgumentV1<'a> {
|
||||||
#[inline(never)]
|
#[inline(never)]
|
||||||
fn show_usize(x: &usize, f: &mut Formatter) -> Result {
|
fn show_usize(x: &usize, f: &mut Formatter) -> Result {
|
||||||
|
@ -175,7 +182,7 @@ impl<'a> ArgumentV1<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// flags available in the v1 format of format_args
|
// flags available in the v1 format of format_args
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
#[allow(dead_code)] // SignMinus isn't currently used
|
#[allow(dead_code)] // SignMinus isn't currently used
|
||||||
enum FlagV1 { SignPlus, SignMinus, Alternate, SignAwareZeroPad, }
|
enum FlagV1 { SignPlus, SignMinus, Alternate, SignAwareZeroPad, }
|
||||||
|
|
||||||
|
@ -222,7 +229,7 @@ impl<'a> Arguments<'a> {
|
||||||
/// macro validates the format string at compile-time so usage of the `write`
|
/// macro validates the format string at compile-time so usage of the `write`
|
||||||
/// and `format` functions can be safely performed.
|
/// and `format` functions can be safely performed.
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct Arguments<'a> {
|
pub struct Arguments<'a> {
|
||||||
// Format string pieces to print.
|
// Format string pieces to print.
|
||||||
pieces: &'a [&'a str],
|
pieces: &'a [&'a str],
|
||||||
|
|
|
@ -139,7 +139,7 @@ impl GenericRadix for Radix {
|
||||||
/// A helper type for formatting radixes.
|
/// A helper type for formatting radixes.
|
||||||
#[unstable(feature = "core",
|
#[unstable(feature = "core",
|
||||||
reason = "may be renamed or move to a different module")]
|
reason = "may be renamed or move to a different module")]
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct RadixFmt<T, R>(T, R);
|
pub struct RadixFmt<T, R>(T, R);
|
||||||
|
|
||||||
/// Constructs a radix formatter in the range of `2..36`.
|
/// Constructs a radix formatter in the range of `2..36`.
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
#![stable(feature = "rust1", since = "1.0.0")]
|
#![stable(feature = "rust1", since = "1.0.0")]
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub struct Argument {
|
pub struct Argument {
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
|
@ -25,7 +25,7 @@ pub struct Argument {
|
||||||
pub format: FormatSpec,
|
pub format: FormatSpec,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub struct FormatSpec {
|
pub struct FormatSpec {
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
|
@ -41,7 +41,7 @@ pub struct FormatSpec {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Possible alignments that can be requested as part of a formatting directive.
|
/// Possible alignments that can be requested as part of a formatting directive.
|
||||||
#[derive(Copy, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub enum Alignment {
|
pub enum Alignment {
|
||||||
/// Indication that contents should be left-aligned.
|
/// Indication that contents should be left-aligned.
|
||||||
|
@ -58,7 +58,7 @@ pub enum Alignment {
|
||||||
Unknown,
|
Unknown,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub enum Count {
|
pub enum Count {
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
|
@ -71,7 +71,7 @@ pub enum Count {
|
||||||
Implied,
|
Implied,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub enum Position {
|
pub enum Position {
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
|
|
|
@ -75,7 +75,7 @@ pub trait Sized : MarkerTrait {
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// // we can just derive a `Copy` implementation
|
/// // we can just derive a `Copy` implementation
|
||||||
/// #[derive(Debug, Copy)]
|
/// #[derive(Debug, Copy, Clone)]
|
||||||
/// struct Foo;
|
/// struct Foo;
|
||||||
///
|
///
|
||||||
/// let x = Foo;
|
/// let x = Foo;
|
||||||
|
@ -124,7 +124,7 @@ pub trait Sized : MarkerTrait {
|
||||||
/// There are two ways to implement `Copy` on your type:
|
/// There are two ways to implement `Copy` on your type:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #[derive(Copy)]
|
/// #[derive(Copy, Clone)]
|
||||||
/// struct MyStruct;
|
/// struct MyStruct;
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
@ -133,6 +133,7 @@ pub trait Sized : MarkerTrait {
|
||||||
/// ```
|
/// ```
|
||||||
/// struct MyStruct;
|
/// struct MyStruct;
|
||||||
/// impl Copy for MyStruct {}
|
/// impl Copy for MyStruct {}
|
||||||
|
/// impl Clone for MyStruct { fn clone(&self) -> MyStruct { *self } }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// There is a small difference between the two: the `derive` strategy will also place a `Copy`
|
/// There is a small difference between the two: the `derive` strategy will also place a `Copy`
|
||||||
|
|
|
@ -2425,7 +2425,7 @@ impl_num_cast! { f32, to_f32 }
|
||||||
impl_num_cast! { f64, to_f64 }
|
impl_num_cast! { f64, to_f64 }
|
||||||
|
|
||||||
/// Used for representing the classification of floating point numbers
|
/// Used for representing the classification of floating point numbers
|
||||||
#[derive(Copy, PartialEq, Debug)]
|
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub enum FpCategory {
|
pub enum FpCategory {
|
||||||
/// "Not a Number", often obtained by dividing by zero
|
/// "Not a Number", often obtained by dividing by zero
|
||||||
|
|
|
@ -165,7 +165,7 @@ macro_rules! forward_ref_binop {
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::ops::Add;
|
/// use std::ops::Add;
|
||||||
///
|
///
|
||||||
/// #[derive(Copy)]
|
/// #[derive(Copy, Clone)]
|
||||||
/// struct Foo;
|
/// struct Foo;
|
||||||
///
|
///
|
||||||
/// impl Add for Foo {
|
/// impl Add for Foo {
|
||||||
|
@ -219,7 +219,7 @@ add_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::ops::Sub;
|
/// use std::ops::Sub;
|
||||||
///
|
///
|
||||||
/// #[derive(Copy)]
|
/// #[derive(Copy, Clone)]
|
||||||
/// struct Foo;
|
/// struct Foo;
|
||||||
///
|
///
|
||||||
/// impl Sub for Foo {
|
/// impl Sub for Foo {
|
||||||
|
@ -273,7 +273,7 @@ sub_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::ops::Mul;
|
/// use std::ops::Mul;
|
||||||
///
|
///
|
||||||
/// #[derive(Copy)]
|
/// #[derive(Copy, Clone)]
|
||||||
/// struct Foo;
|
/// struct Foo;
|
||||||
///
|
///
|
||||||
/// impl Mul for Foo {
|
/// impl Mul for Foo {
|
||||||
|
@ -327,7 +327,7 @@ mul_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::ops::Div;
|
/// use std::ops::Div;
|
||||||
///
|
///
|
||||||
/// #[derive(Copy)]
|
/// #[derive(Copy, Clone)]
|
||||||
/// struct Foo;
|
/// struct Foo;
|
||||||
///
|
///
|
||||||
/// impl Div for Foo {
|
/// impl Div for Foo {
|
||||||
|
@ -381,7 +381,7 @@ div_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::ops::Rem;
|
/// use std::ops::Rem;
|
||||||
///
|
///
|
||||||
/// #[derive(Copy)]
|
/// #[derive(Copy, Clone)]
|
||||||
/// struct Foo;
|
/// struct Foo;
|
||||||
///
|
///
|
||||||
/// impl Rem for Foo {
|
/// impl Rem for Foo {
|
||||||
|
@ -454,7 +454,7 @@ rem_float_impl! { f64, fmod }
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::ops::Neg;
|
/// use std::ops::Neg;
|
||||||
///
|
///
|
||||||
/// #[derive(Copy)]
|
/// #[derive(Copy, Clone)]
|
||||||
/// struct Foo;
|
/// struct Foo;
|
||||||
///
|
///
|
||||||
/// impl Neg for Foo {
|
/// impl Neg for Foo {
|
||||||
|
@ -511,7 +511,7 @@ neg_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::ops::Not;
|
/// use std::ops::Not;
|
||||||
///
|
///
|
||||||
/// #[derive(Copy)]
|
/// #[derive(Copy, Clone)]
|
||||||
/// struct Foo;
|
/// struct Foo;
|
||||||
///
|
///
|
||||||
/// impl Not for Foo {
|
/// impl Not for Foo {
|
||||||
|
@ -565,7 +565,7 @@ not_impl! { bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::ops::BitAnd;
|
/// use std::ops::BitAnd;
|
||||||
///
|
///
|
||||||
/// #[derive(Copy)]
|
/// #[derive(Copy, Clone)]
|
||||||
/// struct Foo;
|
/// struct Foo;
|
||||||
///
|
///
|
||||||
/// impl BitAnd for Foo {
|
/// impl BitAnd for Foo {
|
||||||
|
@ -619,7 +619,7 @@ bitand_impl! { bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::ops::BitOr;
|
/// use std::ops::BitOr;
|
||||||
///
|
///
|
||||||
/// #[derive(Copy)]
|
/// #[derive(Copy, Clone)]
|
||||||
/// struct Foo;
|
/// struct Foo;
|
||||||
///
|
///
|
||||||
/// impl BitOr for Foo {
|
/// impl BitOr for Foo {
|
||||||
|
@ -673,7 +673,7 @@ bitor_impl! { bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::ops::BitXor;
|
/// use std::ops::BitXor;
|
||||||
///
|
///
|
||||||
/// #[derive(Copy)]
|
/// #[derive(Copy, Clone)]
|
||||||
/// struct Foo;
|
/// struct Foo;
|
||||||
///
|
///
|
||||||
/// impl BitXor for Foo {
|
/// impl BitXor for Foo {
|
||||||
|
@ -727,7 +727,7 @@ bitxor_impl! { bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::ops::Shl;
|
/// use std::ops::Shl;
|
||||||
///
|
///
|
||||||
/// #[derive(Copy)]
|
/// #[derive(Copy, Clone)]
|
||||||
/// struct Foo;
|
/// struct Foo;
|
||||||
///
|
///
|
||||||
/// impl Shl<Foo> for Foo {
|
/// impl Shl<Foo> for Foo {
|
||||||
|
@ -799,7 +799,7 @@ shl_impl_all! { u8 u16 u32 u64 usize i8 i16 i32 i64 isize }
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::ops::Shr;
|
/// use std::ops::Shr;
|
||||||
///
|
///
|
||||||
/// #[derive(Copy)]
|
/// #[derive(Copy, Clone)]
|
||||||
/// struct Foo;
|
/// struct Foo;
|
||||||
///
|
///
|
||||||
/// impl Shr<Foo> for Foo {
|
/// impl Shr<Foo> for Foo {
|
||||||
|
@ -871,7 +871,7 @@ shr_impl_all! { u8 u16 u32 u64 usize i8 i16 i32 i64 isize }
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::ops::Index;
|
/// use std::ops::Index;
|
||||||
///
|
///
|
||||||
/// #[derive(Copy)]
|
/// #[derive(Copy, Clone)]
|
||||||
/// struct Foo;
|
/// struct Foo;
|
||||||
/// struct Bar;
|
/// struct Bar;
|
||||||
///
|
///
|
||||||
|
@ -912,7 +912,7 @@ pub trait Index<Idx: ?Sized> {
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::ops::{Index, IndexMut};
|
/// use std::ops::{Index, IndexMut};
|
||||||
///
|
///
|
||||||
/// #[derive(Copy)]
|
/// #[derive(Copy, Clone)]
|
||||||
/// struct Foo;
|
/// struct Foo;
|
||||||
/// struct Bar;
|
/// struct Bar;
|
||||||
///
|
///
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
//!
|
//!
|
||||||
//! Their definition should always match the ABI defined in `rustc::back::abi`.
|
//! Their definition should always match the ABI defined in `rustc::back::abi`.
|
||||||
|
|
||||||
use marker::Copy;
|
|
||||||
use mem;
|
use mem;
|
||||||
|
|
||||||
/// The representation of a slice like `&[T]`.
|
/// The representation of a slice like `&[T]`.
|
||||||
|
@ -63,6 +62,9 @@ pub struct Slice<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> Copy for Slice<T> {}
|
impl<T> Copy for Slice<T> {}
|
||||||
|
impl<T> Clone for Slice<T> {
|
||||||
|
fn clone(&self) -> Slice<T> { *self }
|
||||||
|
}
|
||||||
|
|
||||||
/// The representation of a trait object like `&SomeTrait`.
|
/// The representation of a trait object like `&SomeTrait`.
|
||||||
///
|
///
|
||||||
|
@ -136,7 +138,7 @@ impl<T> Copy for Slice<T> {}
|
||||||
/// assert_eq!(synthesized.bar(), 457);
|
/// assert_eq!(synthesized.bar(), 457);
|
||||||
/// ```
|
/// ```
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct TraitObject {
|
pub struct TraitObject {
|
||||||
pub data: *mut (),
|
pub data: *mut (),
|
||||||
pub vtable: *mut (),
|
pub vtable: *mut (),
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
#[unstable(feature = "core")]
|
#[unstable(feature = "core")]
|
||||||
#[simd]
|
#[simd]
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct i8x16(pub i8, pub i8, pub i8, pub i8,
|
pub struct i8x16(pub i8, pub i8, pub i8, pub i8,
|
||||||
pub i8, pub i8, pub i8, pub i8,
|
pub i8, pub i8, pub i8, pub i8,
|
||||||
|
@ -47,26 +47,26 @@ pub struct i8x16(pub i8, pub i8, pub i8, pub i8,
|
||||||
|
|
||||||
#[unstable(feature = "core")]
|
#[unstable(feature = "core")]
|
||||||
#[simd]
|
#[simd]
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct i16x8(pub i16, pub i16, pub i16, pub i16,
|
pub struct i16x8(pub i16, pub i16, pub i16, pub i16,
|
||||||
pub i16, pub i16, pub i16, pub i16);
|
pub i16, pub i16, pub i16, pub i16);
|
||||||
|
|
||||||
#[unstable(feature = "core")]
|
#[unstable(feature = "core")]
|
||||||
#[simd]
|
#[simd]
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct i32x4(pub i32, pub i32, pub i32, pub i32);
|
pub struct i32x4(pub i32, pub i32, pub i32, pub i32);
|
||||||
|
|
||||||
#[unstable(feature = "core")]
|
#[unstable(feature = "core")]
|
||||||
#[simd]
|
#[simd]
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct i64x2(pub i64, pub i64);
|
pub struct i64x2(pub i64, pub i64);
|
||||||
|
|
||||||
#[unstable(feature = "core")]
|
#[unstable(feature = "core")]
|
||||||
#[simd]
|
#[simd]
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct u8x16(pub u8, pub u8, pub u8, pub u8,
|
pub struct u8x16(pub u8, pub u8, pub u8, pub u8,
|
||||||
pub u8, pub u8, pub u8, pub u8,
|
pub u8, pub u8, pub u8, pub u8,
|
||||||
|
@ -75,31 +75,31 @@ pub struct u8x16(pub u8, pub u8, pub u8, pub u8,
|
||||||
|
|
||||||
#[unstable(feature = "core")]
|
#[unstable(feature = "core")]
|
||||||
#[simd]
|
#[simd]
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct u16x8(pub u16, pub u16, pub u16, pub u16,
|
pub struct u16x8(pub u16, pub u16, pub u16, pub u16,
|
||||||
pub u16, pub u16, pub u16, pub u16);
|
pub u16, pub u16, pub u16, pub u16);
|
||||||
|
|
||||||
#[unstable(feature = "core")]
|
#[unstable(feature = "core")]
|
||||||
#[simd]
|
#[simd]
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct u32x4(pub u32, pub u32, pub u32, pub u32);
|
pub struct u32x4(pub u32, pub u32, pub u32, pub u32);
|
||||||
|
|
||||||
#[unstable(feature = "core")]
|
#[unstable(feature = "core")]
|
||||||
#[simd]
|
#[simd]
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct u64x2(pub u64, pub u64);
|
pub struct u64x2(pub u64, pub u64);
|
||||||
|
|
||||||
#[unstable(feature = "core")]
|
#[unstable(feature = "core")]
|
||||||
#[simd]
|
#[simd]
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct f32x4(pub f32, pub f32, pub f32, pub f32);
|
pub struct f32x4(pub f32, pub f32, pub f32, pub f32);
|
||||||
|
|
||||||
#[unstable(feature = "core")]
|
#[unstable(feature = "core")]
|
||||||
#[simd]
|
#[simd]
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct f64x2(pub f64, pub f64);
|
pub struct f64x2(pub f64, pub f64);
|
||||||
|
|
|
@ -1123,7 +1123,7 @@ static UTF8_CHAR_WIDTH: [u8; 256] = [
|
||||||
/// Struct that contains a `char` and the index of the first byte of
|
/// Struct that contains a `char` and the index of the first byte of
|
||||||
/// the next `char` in a string. This can be used as a data structure
|
/// the next `char` in a string. This can be used as a data structure
|
||||||
/// for iterating over the UTF-8 bytes of a string.
|
/// for iterating over the UTF-8 bytes of a string.
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
#[unstable(feature = "str_char",
|
#[unstable(feature = "str_char",
|
||||||
reason = "existence of this struct is uncertain as it is frequently \
|
reason = "existence of this struct is uncertain as it is frequently \
|
||||||
able to be replaced with char.len_utf8() and/or \
|
able to be replaced with char.len_utf8() and/or \
|
||||||
|
|
|
@ -40,7 +40,7 @@ use std::string;
|
||||||
|
|
||||||
/// A piece is a portion of the format string which represents the next part
|
/// A piece is a portion of the format string which represents the next part
|
||||||
/// to emit. These are emitted as a stream by the `Parser` class.
|
/// to emit. These are emitted as a stream by the `Parser` class.
|
||||||
#[derive(Copy, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
pub enum Piece<'a> {
|
pub enum Piece<'a> {
|
||||||
/// A literal string which should directly be emitted
|
/// A literal string which should directly be emitted
|
||||||
String(&'a str),
|
String(&'a str),
|
||||||
|
@ -50,7 +50,7 @@ pub enum Piece<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Representation of an argument specification.
|
/// Representation of an argument specification.
|
||||||
#[derive(Copy, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
pub struct Argument<'a> {
|
pub struct Argument<'a> {
|
||||||
/// Where to find this argument
|
/// Where to find this argument
|
||||||
pub position: Position<'a>,
|
pub position: Position<'a>,
|
||||||
|
@ -59,7 +59,7 @@ pub struct Argument<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Specification for the formatting of an argument in the format string.
|
/// Specification for the formatting of an argument in the format string.
|
||||||
#[derive(Copy, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
pub struct FormatSpec<'a> {
|
pub struct FormatSpec<'a> {
|
||||||
/// Optionally specified character to fill alignment with
|
/// Optionally specified character to fill alignment with
|
||||||
pub fill: Option<char>,
|
pub fill: Option<char>,
|
||||||
|
@ -78,7 +78,7 @@ pub struct FormatSpec<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Enum describing where an argument for a format can be located.
|
/// Enum describing where an argument for a format can be located.
|
||||||
#[derive(Copy, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
pub enum Position<'a> {
|
pub enum Position<'a> {
|
||||||
/// The argument will be in the next position. This is the default.
|
/// The argument will be in the next position. This is the default.
|
||||||
ArgumentNext,
|
ArgumentNext,
|
||||||
|
@ -89,7 +89,7 @@ pub enum Position<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Enum of alignments which are supported.
|
/// Enum of alignments which are supported.
|
||||||
#[derive(Copy, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
pub enum Alignment {
|
pub enum Alignment {
|
||||||
/// The value will be aligned to the left.
|
/// The value will be aligned to the left.
|
||||||
AlignLeft,
|
AlignLeft,
|
||||||
|
@ -103,7 +103,7 @@ pub enum Alignment {
|
||||||
|
|
||||||
/// Various flags which can be applied to format strings. The meaning of these
|
/// Various flags which can be applied to format strings. The meaning of these
|
||||||
/// flags is defined by the formatters themselves.
|
/// flags is defined by the formatters themselves.
|
||||||
#[derive(Copy, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
pub enum Flag {
|
pub enum Flag {
|
||||||
/// A `+` will be used to denote positive numbers.
|
/// A `+` will be used to denote positive numbers.
|
||||||
FlagSignPlus,
|
FlagSignPlus,
|
||||||
|
@ -119,7 +119,7 @@ pub enum Flag {
|
||||||
|
|
||||||
/// A count is used for the precision and width parameters of an integer, and
|
/// A count is used for the precision and width parameters of an integer, and
|
||||||
/// can reference either an argument or a literal integer.
|
/// can reference either an argument or a literal integer.
|
||||||
#[derive(Copy, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
pub enum Count<'a> {
|
pub enum Count<'a> {
|
||||||
/// The count is specified explicitly.
|
/// The count is specified explicitly.
|
||||||
CountIs(usize),
|
CountIs(usize),
|
||||||
|
|
|
@ -213,7 +213,7 @@ pub enum Fail {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The type of failure that occurred.
|
/// The type of failure that occurred.
|
||||||
#[derive(Copy, PartialEq, Eq, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum FailType {
|
pub enum FailType {
|
||||||
ArgumentMissing_,
|
ArgumentMissing_,
|
||||||
|
@ -843,18 +843,18 @@ pub fn short_usage(program_name: &str, opts: &[OptGroup]) -> String {
|
||||||
line
|
line
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
enum SplitWithinState {
|
enum SplitWithinState {
|
||||||
A, // leading whitespace, initial state
|
A, // leading whitespace, initial state
|
||||||
B, // words
|
B, // words
|
||||||
C, // internal and trailing whitespace
|
C, // internal and trailing whitespace
|
||||||
}
|
}
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
enum Whitespace {
|
enum Whitespace {
|
||||||
Ws, // current char is whitespace
|
Ws, // current char is whitespace
|
||||||
Cr // current char is not whitespace
|
Cr // current char is not whitespace
|
||||||
}
|
}
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
enum LengthLimit {
|
enum LengthLimit {
|
||||||
UnderLim, // current char makes current substring still fit in limit
|
UnderLim, // current char makes current substring still fit in limit
|
||||||
OverLim // current char makes current substring no longer fit in limit
|
OverLim // current char makes current substring no longer fit in limit
|
||||||
|
|
|
@ -524,7 +524,7 @@ pub trait GraphWalk<'a, N, E> {
|
||||||
fn target(&'a self, edge: &E) -> N;
|
fn target(&'a self, edge: &E) -> N;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, PartialEq, Eq, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||||
pub enum RenderOption {
|
pub enum RenderOption {
|
||||||
NoEdgeLabels,
|
NoEdgeLabels,
|
||||||
NoNodeLabels,
|
NoNodeLabels,
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -239,7 +239,7 @@ pub trait Logger {
|
||||||
struct DefaultLogger { handle: Stderr }
|
struct DefaultLogger { handle: Stderr }
|
||||||
|
|
||||||
/// Wraps the log level with fmt implementations.
|
/// Wraps the log level with fmt implementations.
|
||||||
#[derive(Copy, PartialEq, PartialOrd, Debug)]
|
#[derive(Copy, Clone, PartialEq, PartialOrd, Debug)]
|
||||||
pub struct LogLevel(pub u32);
|
pub struct LogLevel(pub u32);
|
||||||
|
|
||||||
impl fmt::Display for LogLevel {
|
impl fmt::Display for LogLevel {
|
||||||
|
@ -355,7 +355,7 @@ pub struct LogRecord<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct LogLocation {
|
pub struct LogLocation {
|
||||||
pub module_path: &'static str,
|
pub module_path: &'static str,
|
||||||
pub file: &'static str,
|
pub file: &'static str,
|
||||||
|
|
|
@ -29,7 +29,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample};
|
||||||
/// Generate Normal Random
|
/// Generate Normal Random
|
||||||
/// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
|
/// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
|
||||||
/// College, Oxford
|
/// College, Oxford
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct Exp1(pub f64);
|
pub struct Exp1(pub f64);
|
||||||
|
|
||||||
// This could be done via `-rng.gen::<f64>().ln()` but that is slower.
|
// This could be done via `-rng.gen::<f64>().ln()` but that is slower.
|
||||||
|
@ -68,7 +68,7 @@ impl Rand for Exp1 {
|
||||||
/// let v = exp.ind_sample(&mut rand::thread_rng());
|
/// let v = exp.ind_sample(&mut rand::thread_rng());
|
||||||
/// println!("{} is from a Exp(2) distribution", v);
|
/// println!("{} is from a Exp(2) distribution", v);
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct Exp {
|
pub struct Exp {
|
||||||
/// `lambda` stored as `1/lambda`, since this is what we scale by.
|
/// `lambda` stored as `1/lambda`, since this is what we scale by.
|
||||||
lambda_inverse: f64
|
lambda_inverse: f64
|
||||||
|
|
|
@ -28,7 +28,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample};
|
||||||
/// Generate Normal Random
|
/// Generate Normal Random
|
||||||
/// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
|
/// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
|
||||||
/// College, Oxford
|
/// College, Oxford
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct StandardNormal(pub f64);
|
pub struct StandardNormal(pub f64);
|
||||||
|
|
||||||
impl Rand for StandardNormal {
|
impl Rand for StandardNormal {
|
||||||
|
@ -85,7 +85,7 @@ impl Rand for StandardNormal {
|
||||||
/// let v = normal.ind_sample(&mut rand::thread_rng());
|
/// let v = normal.ind_sample(&mut rand::thread_rng());
|
||||||
/// println!("{} is from a N(2, 9) distribution", v)
|
/// println!("{} is from a N(2, 9) distribution", v)
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct Normal {
|
pub struct Normal {
|
||||||
mean: f64,
|
mean: f64,
|
||||||
std_dev: f64,
|
std_dev: f64,
|
||||||
|
@ -134,7 +134,7 @@ impl IndependentSample<f64> for Normal {
|
||||||
/// let v = log_normal.ind_sample(&mut rand::thread_rng());
|
/// let v = log_normal.ind_sample(&mut rand::thread_rng());
|
||||||
/// println!("{} is from an ln N(2, 9) distribution", v)
|
/// println!("{} is from an ln N(2, 9) distribution", v)
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct LogNormal {
|
pub struct LogNormal {
|
||||||
norm: Normal
|
norm: Normal
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,7 +134,7 @@ pub trait Reseeder<R> {
|
||||||
|
|
||||||
/// Reseed an RNG using a `Default` instance. This reseeds by
|
/// Reseed an RNG using a `Default` instance. This reseeds by
|
||||||
/// replacing the RNG with the result of a `Default::default` call.
|
/// replacing the RNG with the result of a `Default::default` call.
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct ReseedWithDefault;
|
pub struct ReseedWithDefault;
|
||||||
|
|
||||||
impl<R: Rng + Default> Reseeder<R> for ReseedWithDefault {
|
impl<R: Rng + Default> Reseeder<R> for ReseedWithDefault {
|
||||||
|
|
|
@ -175,7 +175,7 @@ pub struct TaggedDoc<'a> {
|
||||||
pub doc: Doc<'a>,
|
pub doc: Doc<'a>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub enum EbmlEncoderTag {
|
pub enum EbmlEncoderTag {
|
||||||
// tags 00..1f are reserved for auto-serialization.
|
// tags 00..1f are reserved for auto-serialization.
|
||||||
// first NUM_IMPLICIT_TAGS tags are implicitly sized and lengths are not encoded.
|
// first NUM_IMPLICIT_TAGS tags are implicitly sized and lengths are not encoded.
|
||||||
|
@ -265,7 +265,7 @@ pub mod reader {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct Res {
|
pub struct Res {
|
||||||
pub val: usize,
|
pub val: usize,
|
||||||
pub next: usize
|
pub next: usize
|
||||||
|
|
|
@ -30,19 +30,19 @@ use html::render::{cache, CURRENT_LOCATION_KEY};
|
||||||
|
|
||||||
/// Helper to render an optional visibility with a space after it (if the
|
/// Helper to render an optional visibility with a space after it (if the
|
||||||
/// visibility is preset)
|
/// visibility is preset)
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct VisSpace(pub Option<ast::Visibility>);
|
pub struct VisSpace(pub Option<ast::Visibility>);
|
||||||
/// Similarly to VisSpace, this structure is used to render a function style with a
|
/// Similarly to VisSpace, this structure is used to render a function style with a
|
||||||
/// space after it.
|
/// space after it.
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct UnsafetySpace(pub ast::Unsafety);
|
pub struct UnsafetySpace(pub ast::Unsafety);
|
||||||
/// Wrapper struct for properly emitting a method declaration.
|
/// Wrapper struct for properly emitting a method declaration.
|
||||||
pub struct Method<'a>(pub &'a clean::SelfTy, pub &'a clean::FnDecl);
|
pub struct Method<'a>(pub &'a clean::SelfTy, pub &'a clean::FnDecl);
|
||||||
/// Similar to VisSpace, but used for mutability
|
/// Similar to VisSpace, but used for mutability
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct MutableSpace(pub clean::Mutability);
|
pub struct MutableSpace(pub clean::Mutability);
|
||||||
/// Similar to VisSpace, but used for mutability
|
/// Similar to VisSpace, but used for mutability
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct RawMutableSpace(pub clean::Mutability);
|
pub struct RawMutableSpace(pub clean::Mutability);
|
||||||
/// Wrapper struct for properly emitting the stability level.
|
/// Wrapper struct for properly emitting the stability level.
|
||||||
pub struct Stability<'a>(pub &'a Option<clean::Stability>);
|
pub struct Stability<'a>(pub &'a Option<clean::Stability>);
|
||||||
|
|
|
@ -225,7 +225,7 @@ struct Source<'a>(&'a str);
|
||||||
// Helper structs for rendering items/sidebars and carrying along contextual
|
// Helper structs for rendering items/sidebars and carrying along contextual
|
||||||
// information
|
// information
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
struct Item<'a> {
|
struct Item<'a> {
|
||||||
cx: &'a Context,
|
cx: &'a Context,
|
||||||
item: &'a clean::Item,
|
item: &'a clean::Item,
|
||||||
|
|
|
@ -27,7 +27,7 @@ use html::render::cache;
|
||||||
|
|
||||||
#[derive(RustcEncodable, RustcDecodable, PartialEq, Eq)]
|
#[derive(RustcEncodable, RustcDecodable, PartialEq, Eq)]
|
||||||
/// The counts for each stability level.
|
/// The counts for each stability level.
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct Counts {
|
pub struct Counts {
|
||||||
pub deprecated: u64,
|
pub deprecated: u64,
|
||||||
pub unstable: u64,
|
pub unstable: u64,
|
||||||
|
|
|
@ -62,7 +62,7 @@ pub trait FromHex {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Errors that can occur when decoding a hex encoded string
|
/// Errors that can occur when decoding a hex encoded string
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub enum FromHexError {
|
pub enum FromHexError {
|
||||||
/// The input contained a character not part of the hex format
|
/// The input contained a character not part of the hex format
|
||||||
InvalidHexCharacter(char, usize),
|
InvalidHexCharacter(char, usize),
|
||||||
|
|
|
@ -278,7 +278,7 @@ pub enum DecoderError {
|
||||||
ApplicationError(string::String)
|
ApplicationError(string::String)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub enum EncoderError {
|
pub enum EncoderError {
|
||||||
FmtError(fmt::Error),
|
FmtError(fmt::Error),
|
||||||
BadHashmapKey,
|
BadHashmapKey,
|
||||||
|
|
|
@ -87,6 +87,9 @@ struct RawBucket<K, V> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<K,V> Copy for RawBucket<K,V> {}
|
impl<K,V> Copy for RawBucket<K,V> {}
|
||||||
|
impl<K,V> Clone for RawBucket<K,V> {
|
||||||
|
fn clone(&self) -> RawBucket<K, V> { *self }
|
||||||
|
}
|
||||||
|
|
||||||
pub struct Bucket<K, V, M> {
|
pub struct Bucket<K, V, M> {
|
||||||
raw: RawBucket<K, V>,
|
raw: RawBucket<K, V>,
|
||||||
|
@ -95,6 +98,9 @@ pub struct Bucket<K, V, M> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<K,V,M:Copy> Copy for Bucket<K,V,M> {}
|
impl<K,V,M:Copy> Copy for Bucket<K,V,M> {}
|
||||||
|
impl<K,V,M:Copy> Clone for Bucket<K,V,M> {
|
||||||
|
fn clone(&self) -> Bucket<K,V,M> { *self }
|
||||||
|
}
|
||||||
|
|
||||||
pub struct EmptyBucket<K, V, M> {
|
pub struct EmptyBucket<K, V, M> {
|
||||||
raw: RawBucket<K, V>,
|
raw: RawBucket<K, V>,
|
||||||
|
@ -129,7 +135,7 @@ struct GapThenFull<K, V, M> {
|
||||||
|
|
||||||
/// A hash that is not zero, since we use a hash of zero to represent empty
|
/// A hash that is not zero, since we use a hash of zero to represent empty
|
||||||
/// buckets.
|
/// buckets.
|
||||||
#[derive(PartialEq, Copy)]
|
#[derive(PartialEq, Copy, Clone)]
|
||||||
pub struct SafeHash {
|
pub struct SafeHash {
|
||||||
hash: u64,
|
hash: u64,
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ use string::String;
|
||||||
use vec::Vec;
|
use vec::Vec;
|
||||||
|
|
||||||
/// A flag that specifies whether to use exponential (scientific) notation.
|
/// A flag that specifies whether to use exponential (scientific) notation.
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum ExponentFormat {
|
pub enum ExponentFormat {
|
||||||
/// Do not use exponential notation.
|
/// Do not use exponential notation.
|
||||||
ExpNone,
|
ExpNone,
|
||||||
|
@ -40,7 +40,7 @@ pub enum ExponentFormat {
|
||||||
|
|
||||||
/// The number of digits used for emitting the fractional part of a number, if
|
/// The number of digits used for emitting the fractional part of a number, if
|
||||||
/// any.
|
/// any.
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum SignificantDigits {
|
pub enum SignificantDigits {
|
||||||
/// All calculable digits will be printed.
|
/// All calculable digits will be printed.
|
||||||
///
|
///
|
||||||
|
@ -57,7 +57,7 @@ pub enum SignificantDigits {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// How to emit the sign of a number.
|
/// How to emit the sign of a number.
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum SignFormat {
|
pub enum SignFormat {
|
||||||
/// No sign will be printed. The exponent sign will also be emitted.
|
/// No sign will be printed. The exponent sign will also be emitted.
|
||||||
SignNone,
|
SignNone,
|
||||||
|
|
|
@ -391,7 +391,7 @@ impl Error for IoError {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A list specifying general categories of I/O error.
|
/// A list specifying general categories of I/O error.
|
||||||
#[derive(Copy, PartialEq, Eq, Clone, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||||
pub enum IoErrorKind {
|
pub enum IoErrorKind {
|
||||||
/// Any I/O error not part of this list.
|
/// Any I/O error not part of this list.
|
||||||
OtherIoError,
|
OtherIoError,
|
||||||
|
@ -1553,7 +1553,7 @@ impl<T: Buffer> BufferPrelude for T {
|
||||||
|
|
||||||
/// When seeking, the resulting cursor is offset from a base by the offset given
|
/// When seeking, the resulting cursor is offset from a base by the offset given
|
||||||
/// to the `seek` function. The base used is specified by this enumeration.
|
/// to the `seek` function. The base used is specified by this enumeration.
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum SeekStyle {
|
pub enum SeekStyle {
|
||||||
/// Seek from the beginning of the stream
|
/// Seek from the beginning of the stream
|
||||||
SeekSet,
|
SeekSet,
|
||||||
|
@ -1744,7 +1744,7 @@ pub enum FileType {
|
||||||
///
|
///
|
||||||
/// println!("byte size: {}", info.size);
|
/// println!("byte size: {}", info.size);
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Copy, Hash)]
|
#[derive(Copy, Clone, Hash)]
|
||||||
pub struct FileStat {
|
pub struct FileStat {
|
||||||
/// The size of the file, in bytes
|
/// The size of the file, in bytes
|
||||||
pub size: u64,
|
pub size: u64,
|
||||||
|
@ -1783,7 +1783,7 @@ pub struct FileStat {
|
||||||
/// structure. This information is not necessarily platform independent, and may
|
/// structure. This information is not necessarily platform independent, and may
|
||||||
/// have different meanings or no meaning at all on some platforms.
|
/// have different meanings or no meaning at all on some platforms.
|
||||||
#[unstable(feature = "io")]
|
#[unstable(feature = "io")]
|
||||||
#[derive(Copy, Hash)]
|
#[derive(Copy, Clone, Hash)]
|
||||||
pub struct UnstableFileStat {
|
pub struct UnstableFileStat {
|
||||||
/// The ID of the device containing the file.
|
/// The ID of the device containing the file.
|
||||||
pub device: u64,
|
pub device: u64,
|
||||||
|
|
|
@ -29,7 +29,7 @@ use sys;
|
||||||
use vec::Vec;
|
use vec::Vec;
|
||||||
|
|
||||||
/// Hints to the types of sockets that are desired when looking up hosts
|
/// Hints to the types of sockets that are desired when looking up hosts
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub enum SocketType {
|
pub enum SocketType {
|
||||||
Stream, Datagram, Raw
|
Stream, Datagram, Raw
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ pub enum SocketType {
|
||||||
/// to manipulate how a query is performed.
|
/// to manipulate how a query is performed.
|
||||||
///
|
///
|
||||||
/// The meaning of each of these flags can be found with `man -s 3 getaddrinfo`
|
/// The meaning of each of these flags can be found with `man -s 3 getaddrinfo`
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub enum Flag {
|
pub enum Flag {
|
||||||
AddrConfig,
|
AddrConfig,
|
||||||
All,
|
All,
|
||||||
|
@ -51,7 +51,7 @@ pub enum Flag {
|
||||||
|
|
||||||
/// A transport protocol associated with either a hint or a return value of
|
/// A transport protocol associated with either a hint or a return value of
|
||||||
/// `lookup`
|
/// `lookup`
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub enum Protocol {
|
pub enum Protocol {
|
||||||
TCP, UDP
|
TCP, UDP
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ pub enum Protocol {
|
||||||
///
|
///
|
||||||
/// For details on these fields, see their corresponding definitions via
|
/// For details on these fields, see their corresponding definitions via
|
||||||
/// `man -s 3 getaddrinfo`
|
/// `man -s 3 getaddrinfo`
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub struct Hint {
|
pub struct Hint {
|
||||||
pub family: usize,
|
pub family: usize,
|
||||||
pub socktype: Option<SocketType>,
|
pub socktype: Option<SocketType>,
|
||||||
|
@ -69,7 +69,7 @@ pub struct Hint {
|
||||||
pub flags: usize,
|
pub flags: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub struct Info {
|
pub struct Info {
|
||||||
pub address: SocketAddr,
|
pub address: SocketAddr,
|
||||||
pub family: usize,
|
pub family: usize,
|
||||||
|
|
|
@ -90,7 +90,7 @@ impl<R: Buffer> Buffer for LimitReader<R> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A `Writer` which ignores bytes written to it, like /dev/null.
|
/// A `Writer` which ignores bytes written to it, like /dev/null.
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[deprecated(since = "1.0.0", reason = "use std::io::sink() instead")]
|
#[deprecated(since = "1.0.0", reason = "use std::io::sink() instead")]
|
||||||
#[unstable(feature = "old_io")]
|
#[unstable(feature = "old_io")]
|
||||||
pub struct NullWriter;
|
pub struct NullWriter;
|
||||||
|
@ -103,7 +103,7 @@ impl Writer for NullWriter {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A `Reader` which returns an infinite stream of 0 bytes, like /dev/zero.
|
/// A `Reader` which returns an infinite stream of 0 bytes, like /dev/zero.
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[deprecated(since = "1.0.0", reason = "use std::io::repeat(0) instead")]
|
#[deprecated(since = "1.0.0", reason = "use std::io::repeat(0) instead")]
|
||||||
#[unstable(feature = "old_io")]
|
#[unstable(feature = "old_io")]
|
||||||
pub struct ZeroReader;
|
pub struct ZeroReader;
|
||||||
|
@ -130,7 +130,7 @@ impl Buffer for ZeroReader {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A `Reader` which is always at EOF, like /dev/null.
|
/// A `Reader` which is always at EOF, like /dev/null.
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
#[deprecated(since = "1.0.0", reason = "use std::io::empty() instead")]
|
#[deprecated(since = "1.0.0", reason = "use std::io::empty() instead")]
|
||||||
#[unstable(feature = "old_io")]
|
#[unstable(feature = "old_io")]
|
||||||
pub struct NullReader;
|
pub struct NullReader;
|
||||||
|
|
|
@ -25,7 +25,7 @@ use libc;
|
||||||
|
|
||||||
#[cfg(any(not(target_arch = "arm"), target_os = "ios"))]
|
#[cfg(any(not(target_arch = "arm"), target_os = "ios"))]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum _Unwind_Action {
|
pub enum _Unwind_Action {
|
||||||
_UA_SEARCH_PHASE = 1,
|
_UA_SEARCH_PHASE = 1,
|
||||||
_UA_CLEANUP_PHASE = 2,
|
_UA_CLEANUP_PHASE = 2,
|
||||||
|
|
|
@ -197,7 +197,7 @@ macro_rules! __thread_local_inner {
|
||||||
/// Indicator of the state of a thread local storage key.
|
/// Indicator of the state of a thread local storage key.
|
||||||
#[unstable(feature = "std_misc",
|
#[unstable(feature = "std_misc",
|
||||||
reason = "state querying was recently added")]
|
reason = "state querying was recently added")]
|
||||||
#[derive(Eq, PartialEq, Copy)]
|
#[derive(Eq, PartialEq, Copy, Clone)]
|
||||||
pub enum LocalKeyState {
|
pub enum LocalKeyState {
|
||||||
/// All keys are in this state whenever a thread starts. Keys will
|
/// All keys are in this state whenever a thread starts. Keys will
|
||||||
/// transition to the `Valid` state once the first call to `with` happens
|
/// transition to the `Valid` state once the first call to `with` happens
|
||||||
|
|
|
@ -184,7 +184,7 @@ pub mod attr {
|
||||||
/// Most attributes can only be turned on and must be turned off with term.reset().
|
/// Most attributes can only be turned on and must be turned off with term.reset().
|
||||||
/// The ones that can be turned off explicitly take a boolean value.
|
/// The ones that can be turned off explicitly take a boolean value.
|
||||||
/// Color is also represented as an attribute for convenience.
|
/// Color is also represented as an attribute for convenience.
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum Attr {
|
pub enum Attr {
|
||||||
/// Bold (or possibly bright) mode
|
/// Bold (or possibly bright) mode
|
||||||
Bold,
|
Bold,
|
||||||
|
|
|
@ -18,7 +18,7 @@ use std::ascii::OwnedAsciiExt;
|
||||||
use std::mem::replace;
|
use std::mem::replace;
|
||||||
use std::iter::repeat;
|
use std::iter::repeat;
|
||||||
|
|
||||||
#[derive(Copy, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
enum States {
|
enum States {
|
||||||
Nothing,
|
Nothing,
|
||||||
Percent,
|
Percent,
|
||||||
|
@ -35,7 +35,7 @@ enum States {
|
||||||
SeekIfEndPercent(isize)
|
SeekIfEndPercent(isize)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
enum FormatState {
|
enum FormatState {
|
||||||
FormatStateFlags,
|
FormatStateFlags,
|
||||||
FormatStateWidth,
|
FormatStateWidth,
|
||||||
|
@ -444,7 +444,7 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables)
|
||||||
Ok(output)
|
Ok(output)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
struct Flags {
|
struct Flags {
|
||||||
width: usize,
|
width: usize,
|
||||||
precision: usize,
|
precision: usize,
|
||||||
|
@ -461,7 +461,7 @@ impl Flags {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
enum FormatOp {
|
enum FormatOp {
|
||||||
FormatDigit,
|
FormatDigit,
|
||||||
FormatOctal,
|
FormatOctal,
|
||||||
|
|
|
@ -193,7 +193,7 @@ impl fmt::Debug for TestFn {
|
||||||
/// This is fed into functions marked with `#[bench]` to allow for
|
/// This is fed into functions marked with `#[bench]` to allow for
|
||||||
/// set-up & tear-down before running a piece of code repeatedly via a
|
/// set-up & tear-down before running a piece of code repeatedly via a
|
||||||
/// call to `iter`.
|
/// call to `iter`.
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct Bencher {
|
pub struct Bencher {
|
||||||
iterations: u64,
|
iterations: u64,
|
||||||
dur: Duration,
|
dur: Duration,
|
||||||
|
@ -280,7 +280,7 @@ pub fn test_main_static(args: env::Args, tests: &[TestDescAndFn]) {
|
||||||
test_main(&args, owned_tests)
|
test_main(&args, owned_tests)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum ColorConfig {
|
pub enum ColorConfig {
|
||||||
AutoColor,
|
AutoColor,
|
||||||
AlwaysColor,
|
AlwaysColor,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue