Skip to content

Commit 49089d5

Browse files
committed
---
yaml --- r: 162301 b: refs/heads/auto c: ca4f536 h: refs/heads/master i: 162299: 3ec4c21 v: v3
1 parent 8aa2987 commit 49089d5

File tree

294 files changed

+671
-2642
lines changed

Some content is hidden

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

294 files changed

+671
-2642
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: c56e59c722ac5de216ec70f0d1834963ae197ddb
13+
refs/heads/auto: ca4f53655e82a0a0e1d613b16108720bb7a50fde
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/compiletest/common.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ pub enum Mode {
2525
Codegen
2626
}
2727

28-
impl Copy for Mode {}
29-
3028
impl FromStr for Mode {
3129
fn from_str(s: &str) -> Option<Mode> {
3230
match s {

branches/auto/src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ pub fn make_test(config: &Config, testfile: &Path, f: || -> test::TestFn)
346346
desc: test::TestDesc {
347347
name: make_test_name(config, testfile),
348348
ignore: header::is_test_ignored(config, testfile),
349-
should_fail: test::ShouldFail::No,
349+
should_fail: false
350350
},
351351
testfn: f(),
352352
}

branches/auto/src/doc/guide-testing.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,6 @@ fn test_out_of_bounds_failure() {
8989
}
9090
~~~
9191

92-
`#[should_fail]` tests can be fragile as it's hard to guarantee that the test
93-
didn't fail for an unexpected reason. To help with this, an optional `expected`
94-
parameter can be added to the `should_fail` attribute. The test harness will
95-
make sure that the failure message contains the provided text. A safer version
96-
of the example above would be:
97-
98-
~~~test_harness
99-
#[test]
100-
#[should_fail(expected = "index out of bounds")]
101-
fn test_out_of_bounds_failure() {
102-
let v: &[int] = &[];
103-
v[0];
104-
}
105-
~~~
106-
10792
A test runner built with the `--test` flag supports a limited set of
10893
arguments to control which tests are run:
10994

branches/auto/src/doc/guide-unsafe.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,6 @@ extern {
661661
fn abort() -> !;
662662
}
663663
664-
#[lang = "owned_box"]
665-
pub struct Box<T>(*mut T);
666-
667664
#[lang="exchange_malloc"]
668665
unsafe fn allocate(size: uint, _align: uint) -> *mut u8 {
669666
let p = libc::malloc(size as libc::size_t) as *mut u8;

branches/auto/src/doc/reference.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,6 @@ Implementations are defined with the keyword `impl`.
16601660

16611661
```
16621662
# struct Point {x: f64, y: f64};
1663-
# impl Copy for Point {}
16641663
# type Surface = int;
16651664
# struct BoundingBox {x: f64, y: f64, width: f64, height: f64};
16661665
# trait Shape { fn draw(&self, Surface); fn bounding_box(&self) -> BoundingBox; }
@@ -1670,8 +1669,6 @@ struct Circle {
16701669
center: Point,
16711670
}
16721671
1673-
impl Copy for Circle {}
1674-
16751672
impl Shape for Circle {
16761673
fn draw(&self, s: Surface) { do_draw_circle(s, *self); }
16771674
fn bounding_box(&self) -> BoundingBox {
@@ -1794,7 +1791,6 @@ default visibility with the `priv` keyword. When an item is declared as `pub`,
17941791
it can be thought of as being accessible to the outside world. For example:
17951792

17961793
```
1797-
# #![allow(missing_copy_implementations)]
17981794
# fn main() {}
17991795
// Declare a private struct
18001796
struct Foo;

branches/auto/src/libarena/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ impl<T> TypedArena<T> {
466466
}
467467

468468
let ptr: &mut T = unsafe {
469-
let ptr: &mut T = mem::transmute(self.ptr.clone());
469+
let ptr: &mut T = mem::transmute(self.ptr);
470470
ptr::write(ptr, object);
471471
self.ptr.set(self.ptr.get().offset(1));
472472
ptr

branches/auto/src/libcollections/binary_heap.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
//! position: uint
3636
//! }
3737
//!
38-
//! impl Copy for State {}
39-
//!
4038
//! // The priority queue depends on `Ord`.
4139
//! // Explicitly implement the trait so the queue becomes a min-heap
4240
//! // instead of a max-heap.

branches/auto/src/libcollections/btree/map.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,38 +1068,12 @@ impl<K, V> BTreeMap<K, V> {
10681068
}
10691069

10701070
/// Gets an iterator over the keys of the map.
1071-
///
1072-
/// # Example
1073-
///
1074-
/// ```
1075-
/// use std::collections::BTreeMap;
1076-
///
1077-
/// let mut a = BTreeMap::new();
1078-
/// a.insert(1u, "a");
1079-
/// a.insert(2u, "b");
1080-
///
1081-
/// let keys: Vec<uint> = a.keys().cloned().collect();
1082-
/// assert_eq!(keys, vec![1u,2,]);
1083-
/// ```
10841071
#[unstable = "matches collection reform specification, waiting for dust to settle"]
10851072
pub fn keys<'a>(&'a self) -> Keys<'a, K, V> {
10861073
self.iter().map(|(k, _)| k)
10871074
}
10881075

10891076
/// Gets an iterator over the values of the map.
1090-
///
1091-
/// # Example
1092-
///
1093-
/// ```
1094-
/// use std::collections::BTreeMap;
1095-
///
1096-
/// let mut a = BTreeMap::new();
1097-
/// a.insert(1u, "a");
1098-
/// a.insert(2u, "b");
1099-
///
1100-
/// let values: Vec<&str> = a.values().cloned().collect();
1101-
/// assert_eq!(values, vec!["a","b"]);
1102-
/// ```
11031077
#[unstable = "matches collection reform specification, waiting for dust to settle"]
11041078
pub fn values<'a>(&'a self) -> Values<'a, K, V> {
11051079
self.iter().map(|(_, v)| v)

branches/auto/src/libcollections/dlist.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@ pub struct DList<T> {
3939
}
4040

4141
type Link<T> = Option<Box<Node<T>>>;
42-
43-
struct Rawlink<T> {
44-
p: *mut T,
45-
}
46-
47-
impl<T> Copy for Rawlink<T> {}
42+
struct Rawlink<T> { p: *mut T }
4843

4944
struct Node<T> {
5045
next: Link<T>,
@@ -64,8 +59,6 @@ impl<'a, T> Clone for Items<'a, T> {
6459
fn clone(&self) -> Items<'a, T> { *self }
6560
}
6661

67-
impl<'a,T> Copy for Items<'a,T> {}
68-
6962
/// An iterator over mutable references to the items of a `DList`.
7063
pub struct MutItems<'a, T:'a> {
7164
list: &'a mut DList<T>,

branches/auto/src/libcollections/enum_set.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ pub struct EnumSet<E> {
2727
bits: uint
2828
}
2929

30-
impl<E> Copy for EnumSet<E> {}
31-
3230
impl<E:CLike+fmt::Show> fmt::Show for EnumSet<E> {
3331
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
3432
try!(write!(fmt, "{{"));
@@ -271,8 +269,6 @@ mod test {
271269
A, B, C
272270
}
273271

274-
impl Copy for Foo {}
275-
276272
impl CLike for Foo {
277273
fn to_uint(&self) -> uint {
278274
*self as uint
@@ -481,9 +477,6 @@ mod test {
481477
V50, V51, V52, V53, V54, V55, V56, V57, V58, V59,
482478
V60, V61, V62, V63, V64, V65, V66, V67, V68, V69,
483479
}
484-
485-
impl Copy for Bar {}
486-
487480
impl CLike for Bar {
488481
fn to_uint(&self) -> uint {
489482
*self as uint

branches/auto/src/libcollections/hash/sip.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ pub struct SipState {
4343
ntail: uint, // how many bytes in tail are valid
4444
}
4545

46-
impl Copy for SipState {}
47-
4846
// sadly, these macro definitions can't appear later,
4947
// because they're needed in the following defs;
5048
// this design could be improved.
@@ -213,7 +211,6 @@ impl Default for SipState {
213211

214212
/// `SipHasher` computes the SipHash algorithm from a stream of bytes.
215213
#[deriving(Clone)]
216-
#[allow(missing_copy_implementations)]
217214
pub struct SipHasher {
218215
k0: u64,
219216
k1: u64,

branches/auto/src/libcollections/slice.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ use self::Direction::*;
9191
use alloc::boxed::Box;
9292
use core::borrow::{BorrowFrom, BorrowFromMut, ToOwned};
9393
use core::cmp;
94-
use core::kinds::{Copy, Sized};
94+
use core::kinds::Sized;
9595
use core::mem::size_of;
9696
use core::mem;
9797
use core::prelude::{Clone, Greater, Iterator, IteratorExt, Less, None, Option};
@@ -177,16 +177,12 @@ impl ElementSwaps {
177177

178178
enum Direction { Pos, Neg }
179179

180-
impl Copy for Direction {}
181-
182180
/// An `Index` and `Direction` together.
183181
struct SizeDirection {
184182
size: uint,
185183
dir: Direction,
186184
}
187185

188-
impl Copy for SizeDirection {}
189-
190186
impl Iterator<(uint, uint)> for ElementSwaps {
191187
#[inline]
192188
fn next(&mut self) -> Option<(uint, uint)> {
@@ -1486,17 +1482,11 @@ mod tests {
14861482
fn clone(&self) -> S {
14871483
self.f.set(self.f.get() + 1);
14881484
if self.f.get() == 10 { panic!() }
1489-
S {
1490-
f: self.f.clone(),
1491-
boxes: self.boxes.clone(),
1492-
}
1485+
S { f: self.f, boxes: self.boxes.clone() }
14931486
}
14941487
}
14951488

1496-
let s = S {
1497-
f: Cell::new(0),
1498-
boxes: (box 0, Rc::new(0)),
1499-
};
1489+
let s = S { f: Cell::new(0), boxes: (box 0, Rc::new(0)) };
15001490
let _ = Vec::from_elem(100, s);
15011491
}
15021492

branches/auto/src/libcollections/str.rs

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -228,32 +228,24 @@ impl<'a> Iterator<char> for Decompositions<'a> {
228228
_ => self.sorted = false
229229
}
230230

231+
let decomposer = match self.kind {
232+
Canonical => unicode::char::decompose_canonical,
233+
Compatible => unicode::char::decompose_compatible
234+
};
235+
231236
if !self.sorted {
232237
for ch in self.iter {
233238
let buffer = &mut self.buffer;
234239
let sorted = &mut self.sorted;
235-
{
236-
let callback = |d| {
237-
let class =
238-
unicode::char::canonical_combining_class(d);
239-
if class == 0 && !*sorted {
240-
canonical_sort(buffer.as_mut_slice());
241-
*sorted = true;
242-
}
243-
buffer.push((d, class));
244-
};
245-
match self.kind {
246-
Canonical => {
247-
unicode::char::decompose_canonical(ch, callback)
248-
}
249-
Compatible => {
250-
unicode::char::decompose_compatible(ch, callback)
251-
}
240+
decomposer(ch, |d| {
241+
let class = unicode::char::canonical_combining_class(d);
242+
if class == 0 && !*sorted {
243+
canonical_sort(buffer.as_mut_slice());
244+
*sorted = true;
252245
}
253-
}
254-
if *sorted {
255-
break
256-
}
246+
buffer.push((d, class));
247+
});
248+
if *sorted { break }
257249
}
258250
}
259251

branches/auto/src/libcollections/vec.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,15 @@ impl<T> Vec<T> {
218218
}
219219
}
220220

221-
/// Creates a `Vec<T>` directly from the raw components of another vector.
221+
/// Creates a `Vec<T>` directly from the raw constituents.
222222
///
223-
/// This is highly unsafe, due to the number of invariants that aren't checked.
223+
/// This is highly unsafe:
224+
///
225+
/// - if `ptr` is null, then `length` and `capacity` should be 0
226+
/// - `ptr` must point to an allocation of size `capacity`
227+
/// - there must be `length` valid instances of type `T` at the
228+
/// beginning of that allocation
229+
/// - `ptr` must be allocated by the default `Vec` allocator
224230
///
225231
/// # Example
226232
///
@@ -682,12 +688,11 @@ impl<T> Vec<T> {
682688
Some(new_cap) => {
683689
let amort_cap = new_cap.next_power_of_two();
684690
// next_power_of_two will overflow to exactly 0 for really big capacities
685-
let cap = if amort_cap == 0 {
686-
new_cap
691+
if amort_cap == 0 {
692+
self.grow_capacity(new_cap);
687693
} else {
688-
amort_cap
689-
};
690-
self.grow_capacity(cap)
694+
self.grow_capacity(amort_cap);
695+
}
691696
}
692697
}
693698
}

branches/auto/src/libcore/atomic.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ pub use self::Ordering::*;
1717
use intrinsics;
1818
use std::kinds::marker;
1919
use cell::UnsafeCell;
20-
use kinds::Copy;
2120

2221
/// A boolean type which can be safely shared between threads.
2322
#[stable]
@@ -82,8 +81,6 @@ pub enum Ordering {
8281
SeqCst,
8382
}
8483

85-
impl Copy for Ordering {}
86-
8784
/// An `AtomicBool` initialized to `false`.
8885
#[unstable = "may be renamed, pending conventions for static initalizers"]
8986
pub const INIT_ATOMIC_BOOL: AtomicBool =

branches/auto/src/libcore/char.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,4 +519,3 @@ impl Iterator<char> for DefaultEscapedChars {
519519
}
520520
}
521521
}
522-

branches/auto/src/libcore/cmp.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@
4343

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

46-
use kinds::{Copy, Sized};
47-
use option::{Option, Some, None};
46+
use kinds::Sized;
47+
use option::Option;
48+
use option::Option::{Some, None};
4849

4950
/// Trait for values that can be compared for equality and inequality.
5051
///
@@ -105,8 +106,6 @@ pub enum Ordering {
105106
Greater = 1i,
106107
}
107108

108-
impl Copy for Ordering {}
109-
110109
impl Ordering {
111110
/// Reverse the `Ordering`, so that `Less` becomes `Greater` and
112111
/// vice versa.

0 commit comments

Comments
 (0)