Skip to content

Commit bd81f1b

Browse files
committed
---
yaml --- r: 163683 b: refs/heads/snap-stage3 c: 8920181 h: refs/heads/master i: 163681: 0f9a053 163679: 77db970 v: v3
1 parent 661a420 commit bd81f1b

File tree

207 files changed

+3687
-3684
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+3687
-3684
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 95c2ed31aeb66b2662933200dbfd661a573b1f49
4+
refs/heads/snap-stage3: 8920181052c8b66bcc73d0552bbd5fafc8b41378
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/libcollections/binary_heap.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@
2929
//! use std::collections::BinaryHeap;
3030
//! use std::uint;
3131
//!
32-
//! #[deriving(Copy, Eq, PartialEq)]
32+
//! #[deriving(Eq, PartialEq)]
3333
//! struct State {
3434
//! cost: uint,
3535
//! position: uint
3636
//! }
3737
//!
38+
//! impl Copy for State {}
39+
//!
3840
//! // The priority queue depends on `Ord`.
3941
//! // Explicitly implement the trait so the queue becomes a min-heap
4042
//! // instead of a max-heap.

branches/snap-stage3/src/libcollections/btree/set.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,8 +762,8 @@ mod test {
762762
expected: &'b [int],
763763
}
764764

765-
impl<'a, 'b, 'c> FnMut(&'c int) -> bool for Counter<'a, 'b> {
766-
extern "rust-call" fn call_mut(&mut self, (&x,): (&'c int,)) -> bool {
765+
impl<'a, 'b> FnMut(&int) -> bool for Counter<'a, 'b> {
766+
extern "rust-call" fn call_mut(&mut self, (&x,): (&int,)) -> bool {
767767
assert_eq!(x, self.expected[*self.i]);
768768
*self.i += 1;
769769
true

branches/snap-stage3/src/libcollections/enum_set.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,14 @@ mod test {
301301

302302
use super::{EnumSet, CLike};
303303

304-
#[deriving(Copy, PartialEq, Show)]
304+
#[deriving(PartialEq, Show)]
305305
#[repr(uint)]
306306
enum Foo {
307307
A, B, C
308308
}
309309

310+
impl Copy for Foo {}
311+
310312
impl CLike for Foo {
311313
fn to_uint(&self) -> uint {
312314
*self as uint
@@ -505,7 +507,6 @@ mod test {
505507
#[should_fail]
506508
fn test_overflow() {
507509
#[allow(dead_code)]
508-
#[deriving(Copy)]
509510
#[repr(uint)]
510511
enum Bar {
511512
V00, V01, V02, V03, V04, V05, V06, V07, V08, V09,
@@ -517,6 +518,8 @@ mod test {
517518
V60, V61, V62, V63, V64, V65, V66, V67, V68, V69,
518519
}
519520

521+
impl Copy for Bar {}
522+
520523
impl CLike for Bar {
521524
fn to_uint(&self) -> uint {
522525
*self as uint

branches/snap-stage3/src/libcollections/slice.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ use alloc::boxed::Box;
9191
use core::borrow::{BorrowFrom, BorrowFromMut, ToOwned};
9292
use core::cmp;
9393
use core::iter::{range_step, MultiplicativeIterator};
94-
use core::kinds::Sized;
94+
use core::kinds::{Copy, Sized};
9595
use core::mem::size_of;
9696
use core::mem;
9797
use core::ops::FnMut;
@@ -177,16 +177,18 @@ impl ElementSwaps {
177177
}
178178
}
179179

180-
#[deriving(Copy)]
181180
enum Direction { Pos, Neg }
182181

182+
impl Copy for Direction {}
183+
183184
/// An `Index` and `Direction` together.
184-
#[deriving(Copy)]
185185
struct SizeDirection {
186186
size: uint,
187187
dir: Direction,
188188
}
189189

190+
impl Copy for SizeDirection {}
191+
190192
impl Iterator<(uint, uint)> for ElementSwaps {
191193
#[inline]
192194
fn next(&mut self) -> Option<(uint, uint)> {

branches/snap-stage3/src/libcore/atomic.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub use self::Ordering::*;
1616

1717
use intrinsics;
1818
use cell::UnsafeCell;
19+
use kinds::Copy;
1920

2021
/// A boolean type which can be safely shared between threads.
2122
#[stable]
@@ -52,7 +53,6 @@ pub struct AtomicPtr<T> {
5253
/// Rust's memory orderings are [the same as
5354
/// C++'s](http://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync).
5455
#[stable]
55-
#[deriving(Copy)]
5656
pub enum Ordering {
5757
/// No ordering constraints, only atomic operations.
5858
#[stable]
@@ -77,6 +77,8 @@ pub enum Ordering {
7777
SeqCst,
7878
}
7979

80+
impl Copy for Ordering {}
81+
8082
/// An `AtomicBool` initialized to `false`.
8183
#[unstable = "may be renamed, pending conventions for static initalizers"]
8284
pub const INIT_ATOMIC_BOOL: AtomicBool =

branches/snap-stage3/src/libcore/cmp.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
pub use self::Ordering::*;
4545

46-
use kinds::Sized;
46+
use kinds::{Copy, Sized};
4747
use option::Option::{mod, Some, None};
4848

4949
/// Trait for values that can be compared for equality and inequality.
@@ -94,7 +94,7 @@ pub trait Eq<Sized? Rhs = Self> for Sized?: PartialEq<Rhs> {
9494
}
9595

9696
/// An ordering is, e.g, a result of a comparison between two values.
97-
#[deriving(Clone, Copy, PartialEq, Show)]
97+
#[deriving(Clone, PartialEq, Show)]
9898
#[stable]
9999
pub enum Ordering {
100100
/// An ordering where a compared value is less [than another].
@@ -105,6 +105,8 @@ pub enum Ordering {
105105
Greater = 1i,
106106
}
107107

108+
impl Copy for Ordering {}
109+
108110
impl Ordering {
109111
/// Reverse the `Ordering`, so that `Less` becomes `Greater` and
110112
/// vice versa.

branches/snap-stage3/src/libcore/fmt/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ pub type Result = result::Result<(), Error>;
4444
/// occurred. Any extra information must be arranged to be transmitted through
4545
/// some other means.
4646
#[experimental = "core and I/O reconciliation may alter this definition"]
47-
#[deriving(Copy)]
4847
pub struct Error;
4948

49+
impl Copy for Error {}
50+
5051
/// A collection of methods that are required to format a message into a stream.
5152
///
5253
/// This trait is the type which this modules requires when formatting
@@ -103,7 +104,6 @@ enum Void {}
103104
/// compile time it is ensured that the function and the value have the correct
104105
/// types, and then this struct is used to canonicalize arguments to one type.
105106
#[experimental = "implementation detail of the `format_args!` macro"]
106-
#[deriving(Copy)]
107107
pub struct Argument<'a> {
108108
value: &'a Void,
109109
formatter: fn(&Void, &mut Formatter) -> Result,
@@ -137,6 +137,8 @@ impl<'a> Argument<'a> {
137137
}
138138
}
139139

140+
impl<'a> Copy for Argument<'a> {}
141+
140142
impl<'a> Arguments<'a> {
141143
/// When using the format_args!() macro, this function is used to generate the
142144
/// Arguments structure.

branches/snap-stage3/src/libcore/fmt/num.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
use fmt;
1818
use iter::DoubleEndedIteratorExt;
19+
use kinds::Copy;
1920
use num::{Int, cast};
2021
use slice::SliceExt;
2122

@@ -108,12 +109,14 @@ radix! { UpperHex, 16, "0x", x @ 0 ... 9 => b'0' + x,
108109
x @ 10 ... 15 => b'A' + (x - 10) }
109110

110111
/// A radix with in the range of `2..36`.
111-
#[deriving(Clone, Copy, PartialEq)]
112+
#[deriving(Clone, PartialEq)]
112113
#[unstable = "may be renamed or move to a different module"]
113114
pub struct Radix {
114115
base: u8,
115116
}
116117

118+
impl Copy for Radix {}
119+
117120
impl Radix {
118121
fn new(base: u8) -> Radix {
119122
assert!(2 <= base && base <= 36, "the base must be in the range of 2..36: {}", base);
@@ -134,9 +137,10 @@ impl GenericRadix for Radix {
134137

135138
/// A helper type for formatting radixes.
136139
#[unstable = "may be renamed or move to a different module"]
137-
#[deriving(Copy)]
138140
pub struct RadixFmt<T, R>(T, R);
139141

142+
impl<T,R> Copy for RadixFmt<T,R> where T: Copy, R: Copy {}
143+
140144
/// Constructs a radix formatter in the range of `2..36`.
141145
///
142146
/// # Example

branches/snap-stage3/src/libcore/fmt/rt.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@ pub use self::Alignment::*;
2020
pub use self::Count::*;
2121
pub use self::Position::*;
2222
pub use self::Flag::*;
23+
use kinds::Copy;
2324

2425
#[doc(hidden)]
25-
#[deriving(Copy)]
2626
pub struct Argument<'a> {
2727
pub position: Position,
2828
pub format: FormatSpec,
2929
}
3030

31+
impl<'a> Copy for Argument<'a> {}
32+
3133
#[doc(hidden)]
32-
#[deriving(Copy)]
3334
pub struct FormatSpec {
3435
pub fill: char,
3536
pub align: Alignment,
@@ -38,8 +39,10 @@ pub struct FormatSpec {
3839
pub width: Count,
3940
}
4041

42+
impl Copy for FormatSpec {}
43+
4144
/// Possible alignments that can be requested as part of a formatting directive.
42-
#[deriving(Copy, PartialEq)]
45+
#[deriving(PartialEq)]
4346
pub enum Alignment {
4447
/// Indication that contents should be left-aligned.
4548
AlignLeft,
@@ -51,24 +54,27 @@ pub enum Alignment {
5154
AlignUnknown,
5255
}
5356

57+
impl Copy for Alignment {}
58+
5459
#[doc(hidden)]
55-
#[deriving(Copy)]
5660
pub enum Count {
5761
CountIs(uint), CountIsParam(uint), CountIsNextParam, CountImplied,
5862
}
5963

64+
impl Copy for Count {}
65+
6066
#[doc(hidden)]
61-
#[deriving(Copy)]
6267
pub enum Position {
6368
ArgumentNext, ArgumentIs(uint)
6469
}
6570

71+
impl Copy for Position {}
72+
6673
/// Flags which can be passed to formatting via a directive.
6774
///
6875
/// These flags are discovered through the `flags` field of the `Formatter`
6976
/// structure. The flag in that structure is a union of these flags into a
7077
/// `uint` where each flag's discriminant is the corresponding bit.
71-
#[deriving(Copy)]
7278
pub enum Flag {
7379
/// A flag which enables number formatting to always print the sign of a
7480
/// number.
@@ -83,3 +89,5 @@ pub enum Flag {
8389
/// being aware of the sign to be printed.
8490
FlagSignAwareZeroPad,
8591
}
92+
93+
impl Copy for Flag {}

branches/snap-stage3/src/libcore/hash/sip.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ use default::Default;
3030
use super::{Hash, Hasher, Writer};
3131

3232
/// `SipState` computes a SipHash 2-4 hash over a stream of bytes.
33-
#[deriving(Copy)]
3433
pub struct SipState {
3534
k0: u64,
3635
k1: u64,
@@ -43,6 +42,8 @@ pub struct SipState {
4342
ntail: uint, // how many bytes in tail are valid
4443
}
4544

45+
impl Copy for SipState {}
46+
4647
// sadly, these macro definitions can't appear later,
4748
// because they're needed in the following defs;
4849
// this design could be improved.

branches/snap-stage3/src/libcore/intrinsics.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@
4242
#![experimental]
4343
#![allow(missing_docs)]
4444

45+
use kinds::Copy;
46+
4547
pub type GlueFn = extern "Rust" fn(*const i8);
4648

4749
#[lang="ty_desc"]
48-
#[deriving(Copy)]
4950
pub struct TyDesc {
5051
// sizeof(T)
5152
pub size: uint,
@@ -60,6 +61,8 @@ pub struct TyDesc {
6061
pub name: &'static str,
6162
}
6263

64+
impl Copy for TyDesc {}
65+
6366
extern "rust-intrinsic" {
6467

6568
// NB: These intrinsics take unsafe pointers because they mutate aliased
@@ -537,11 +540,13 @@ extern "rust-intrinsic" {
537540
/// `TypeId` represents a globally unique identifier for a type
538541
#[lang="type_id"] // This needs to be kept in lockstep with the code in trans/intrinsic.rs and
539542
// middle/lang_items.rs
540-
#[deriving(Clone, Copy, PartialEq, Eq, Show)]
543+
#[deriving(Clone, PartialEq, Eq, Show)]
541544
pub struct TypeId {
542545
t: u64,
543546
}
544547

548+
impl Copy for TypeId {}
549+
545550
impl TypeId {
546551
/// Returns the `TypeId` of the type this generic function has been instantiated with
547552
pub fn of<T: 'static>() -> TypeId {

0 commit comments

Comments
 (0)