Skip to content

Commit 35126e4

Browse files
committed
---
yaml --- r: 159343 b: refs/heads/master c: 4963afd h: refs/heads/master i: 159341: 9088ff4 159339: 60ad6f9 159335: 64b3355 159327: 1a80f50 v: v3
1 parent 70d56b2 commit 35126e4

File tree

185 files changed

+1872
-1988
lines changed

Some content is hidden

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

185 files changed

+1872
-1988
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 0ab861aa2dc972e13d98c24db603f125688d5e43
2+
refs/heads/master: 4963afdc7b6adeee74abd306d3933a58bbec522b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 9c96a79a74f10bed18b031ce0ac4126c56d6cfb3
55
refs/heads/try: f58aad6dce273570fb130b4df008ef9acd5a5be2

trunk/src/doc/guide-lifetimes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ expensive. So we'd like to define a function that takes the points just as
5151
a reference.
5252

5353
~~~
54+
# use std::num::Float;
5455
# struct Point {x: f64, y: f64}
5556
# fn sqrt(f: f64) -> f64 { 0.0 }
5657
fn compute_distance(p1: &Point, p2: &Point) -> f64 {

trunk/src/doc/guide-tasks.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ Here is another example showing how futures allow you to background
225225
computations. The workload will be distributed on the available cores.
226226

227227
```{rust}
228+
# use std::num::Float;
228229
# use std::sync::Future;
229230
fn partial_sum(start: uint) -> f64 {
230231
let mut local_sum = 0f64;
@@ -262,6 +263,7 @@ several computations on a single large vector of floats. Each task needs the
262263
full vector to perform its duty.
263264

264265
```{rust}
266+
use std::num::Float;
265267
use std::rand;
266268
use std::sync::Arc;
267269

trunk/src/doc/guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5274,7 +5274,7 @@ let result = task::try(proc() {
52745274

52755275
This task will randomly panic or succeed. `task::try` returns a `Result`
52765276
type, so we can handle the response like any other computation that may
5277-
panic.
5277+
fail.
52785278

52795279
# Macros
52805280

trunk/src/etc/make-win-dist.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def make_win_dist(dist_root, target_triple):
6262
"libcomctl32.a",
6363
"libcomdlg32.a",
6464
"libcrypt32.a",
65-
"libctl3d32.a",
6665
"libgdi32.a",
6766
"libimagehlp.a",
6867
"libiphlpapi.a",

trunk/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ syn keyword rustTrait FromIterator IntoIterator Extend ExactSize
9797
syn keyword rustTrait Iterator DoubleEndedIterator
9898
syn keyword rustTrait RandomAccessIterator CloneableIterator
9999
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator
100-
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul CheckedDiv
101-
syn keyword rustTrait Signed Unsigned Primitive Int Float
100+
syn keyword rustTrait NumCast Int SignedInt UnsignedInt Float
102101
syn keyword rustTrait FloatMath ToPrimitive FromPrimitive
103102
syn keyword rustTrait Box
104103
syn keyword rustTrait GenericPath Path PosixPath WindowsPath

trunk/src/liballoc/boxed.rs

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -65,50 +65,12 @@ impl<T: Clone> Clone for Box<T> {
6565
}
6666
}
6767

68-
// NOTE(stage0): remove impl after a snapshot
69-
#[cfg(stage0)]
70-
impl<T:PartialEq> PartialEq for Box<T> {
71-
#[inline]
72-
fn eq(&self, other: &Box<T>) -> bool { *(*self) == *(*other) }
73-
#[inline]
74-
fn ne(&self, other: &Box<T>) -> bool { *(*self) != *(*other) }
75-
}
76-
// NOTE(stage0): remove impl after a snapshot
77-
#[cfg(stage0)]
78-
impl<T:PartialOrd> PartialOrd for Box<T> {
79-
#[inline]
80-
fn partial_cmp(&self, other: &Box<T>) -> Option<Ordering> {
81-
(**self).partial_cmp(&**other)
82-
}
83-
#[inline]
84-
fn lt(&self, other: &Box<T>) -> bool { *(*self) < *(*other) }
85-
#[inline]
86-
fn le(&self, other: &Box<T>) -> bool { *(*self) <= *(*other) }
87-
#[inline]
88-
fn ge(&self, other: &Box<T>) -> bool { *(*self) >= *(*other) }
89-
#[inline]
90-
fn gt(&self, other: &Box<T>) -> bool { *(*self) > *(*other) }
91-
}
92-
// NOTE(stage0): remove impl after a snapshot
93-
#[cfg(stage0)]
94-
impl<T: Ord> Ord for Box<T> {
95-
#[inline]
96-
fn cmp(&self, other: &Box<T>) -> Ordering {
97-
(**self).cmp(&**other)
98-
}
99-
}
100-
// NOTE(stage0): remove impl after a snapshot
101-
#[cfg(stage0)]
102-
impl<T: Eq> Eq for Box<T> {}
103-
104-
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
10568
impl<Sized? T: PartialEq> PartialEq for Box<T> {
10669
#[inline]
10770
fn eq(&self, other: &Box<T>) -> bool { PartialEq::eq(&**self, &**other) }
10871
#[inline]
10972
fn ne(&self, other: &Box<T>) -> bool { PartialEq::ne(&**self, &**other) }
11073
}
111-
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
11274
impl<Sized? T: PartialOrd> PartialOrd for Box<T> {
11375
#[inline]
11476
fn partial_cmp(&self, other: &Box<T>) -> Option<Ordering> {
@@ -123,14 +85,12 @@ impl<Sized? T: PartialOrd> PartialOrd for Box<T> {
12385
#[inline]
12486
fn gt(&self, other: &Box<T>) -> bool { PartialOrd::gt(&**self, &**other) }
12587
}
126-
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
12788
impl<Sized? T: Ord> Ord for Box<T> {
12889
#[inline]
12990
fn cmp(&self, other: &Box<T>) -> Ordering {
13091
Ord::cmp(&**self, &**other)
13192
}
13293
}
133-
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
13494
impl<Sized? T: Eq> Eq for Box<T> {}
13595

13696
/// Extension methods for an owning `Any` trait object.

trunk/src/libarena/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use std::cmp;
3838
use std::intrinsics::{TyDesc, get_tydesc};
3939
use std::intrinsics;
4040
use std::mem;
41-
use std::num;
41+
use std::num::{Int, UnsignedInt};
4242
use std::ptr;
4343
use std::rc::Rc;
4444
use std::rt::heap::{allocate, deallocate};
@@ -132,7 +132,7 @@ impl Drop for Arena {
132132

133133
#[inline]
134134
fn round_up(base: uint, align: uint) -> uint {
135-
(base.checked_add(&(align - 1))).unwrap() & !(align - 1)
135+
(base.checked_add(align - 1)).unwrap() & !(align - 1)
136136
}
137137

138138
// Walk down a chunk, running the destructors for any objects stored
@@ -187,7 +187,7 @@ impl Arena {
187187
self.chunks.borrow_mut().push(self.copy_head.borrow().clone());
188188

189189
*self.copy_head.borrow_mut() =
190-
chunk(num::next_power_of_two(new_min_chunk_size + 1u), true);
190+
chunk((new_min_chunk_size + 1u).next_power_of_two(), true);
191191

192192
return self.alloc_copy_inner(n_bytes, align);
193193
}
@@ -228,7 +228,7 @@ impl Arena {
228228
self.chunks.borrow_mut().push(self.head.borrow().clone());
229229

230230
*self.head.borrow_mut() =
231-
chunk(num::next_power_of_two(new_min_chunk_size + 1u), false);
231+
chunk((new_min_chunk_size + 1u).next_power_of_two(), false);
232232

233233
return self.alloc_noncopy_inner(n_bytes, align);
234234
}
@@ -376,8 +376,8 @@ fn calculate_size<T>(capacity: uint) -> uint {
376376
let mut size = mem::size_of::<TypedArenaChunk<T>>();
377377
size = round_up(size, mem::min_align_of::<T>());
378378
let elem_size = mem::size_of::<T>();
379-
let elems_size = elem_size.checked_mul(&capacity).unwrap();
380-
size = size.checked_add(&elems_size).unwrap();
379+
let elems_size = elem_size.checked_mul(capacity).unwrap();
380+
size = size.checked_add(elems_size).unwrap();
381381
size
382382
}
383383

@@ -432,7 +432,7 @@ impl<T> TypedArenaChunk<T> {
432432
#[inline]
433433
fn end(&self) -> *const u8 {
434434
unsafe {
435-
let size = mem::size_of::<T>().checked_mul(&self.capacity).unwrap();
435+
let size = mem::size_of::<T>().checked_mul(self.capacity).unwrap();
436436
self.start().offset(size as int)
437437
}
438438
}
@@ -481,7 +481,7 @@ impl<T> TypedArena<T> {
481481
fn grow(&self) {
482482
unsafe {
483483
let chunk = *self.first.borrow_mut();
484-
let new_capacity = (*chunk).capacity.checked_mul(&2).unwrap();
484+
let new_capacity = (*chunk).capacity.checked_mul(2).unwrap();
485485
let chunk = TypedArenaChunk::<T>::new(chunk, new_capacity);
486486
self.ptr.set((*chunk).start() as *const T);
487487
self.end.set((*chunk).end() as *const T);

trunk/src/libcollections/bit.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
//!
2323
//! ```
2424
//! use std::collections::{BitvSet, Bitv};
25+
//! use std::num::Float;
2526
//! use std::iter;
2627
//!
2728
//! let max_prime = 10000;
@@ -69,6 +70,7 @@ use core::default::Default;
6970
use core::fmt;
7071
use core::iter::{Chain, Enumerate, Repeat, Skip, Take};
7172
use core::iter;
73+
use core::num::Int;
7274
use core::slice;
7375
use core::u32;
7476
use std::hash;

trunk/src/libcollections/enum_set.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
1616
use core::prelude::*;
1717
use core::fmt;
18+
use core::num::Int;
1819

1920
// FIXME(contentions): implement union family of methods? (general design may be wrong here)
2021

trunk/src/libcollections/hash/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ use alloc::boxed::Box;
6969
use alloc::rc::Rc;
7070
use core::intrinsics::TypeId;
7171
use core::mem;
72+
use core::num::Int;
7273

7374
use vec::Vec;
7475

trunk/src/libcollections/str.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -534,13 +534,6 @@ impl<'a> PartialOrd for MaybeOwned<'a> {
534534
}
535535

536536
impl<'a> Ord for MaybeOwned<'a> {
537-
// NOTE(stage0): remove method after a snapshot
538-
#[cfg(stage0)]
539-
#[inline]
540-
fn cmp(&self, other: &MaybeOwned) -> Ordering {
541-
self.as_slice().cmp(&other.as_slice())
542-
}
543-
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
544537
#[inline]
545538
fn cmp(&self, other: &MaybeOwned) -> Ordering {
546539
self.as_slice().cmp(other.as_slice())

trunk/src/libcollections/vec.rs

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use core::default::Default;
2121
use core::fmt;
2222
use core::kinds::marker::{ContravariantLifetime, InvariantType};
2323
use core::mem;
24-
use core::num;
24+
use core::num::{Int, UnsignedInt};
2525
use core::ops;
2626
use core::ptr;
2727
use core::raw::Slice as RawSlice;
@@ -161,7 +161,7 @@ impl<T> Vec<T> {
161161
} else if capacity == 0 {
162162
Vec::new()
163163
} else {
164-
let size = capacity.checked_mul(&mem::size_of::<T>())
164+
let size = capacity.checked_mul(mem::size_of::<T>())
165165
.expect("capacity overflow");
166166
let ptr = unsafe { allocate(size, mem::min_align_of::<T>()) };
167167
Vec { ptr: ptr as *mut T, len: 0, cap: capacity }
@@ -506,13 +506,6 @@ impl<T: PartialEq> PartialEq for Vec<T> {
506506

507507
#[unstable = "waiting on PartialOrd stability"]
508508
impl<T: PartialOrd> PartialOrd for Vec<T> {
509-
// NOTE(stage0): remove method after a snapshot
510-
#[cfg(stage0)]
511-
#[inline]
512-
fn partial_cmp(&self, other: &Vec<T>) -> Option<Ordering> {
513-
self.as_slice().partial_cmp(&other.as_slice())
514-
}
515-
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
516509
#[inline]
517510
fn partial_cmp(&self, other: &Vec<T>) -> Option<Ordering> {
518511
self.as_slice().partial_cmp(other.as_slice())
@@ -530,13 +523,6 @@ impl<T: PartialEq, V: AsSlice<T>> Equiv<V> for Vec<T> {
530523

531524
#[unstable = "waiting on Ord stability"]
532525
impl<T: Ord> Ord for Vec<T> {
533-
// NOTE(stage0): remove method after a snapshot
534-
#[cfg(stage0)]
535-
#[inline]
536-
fn cmp(&self, other: &Vec<T>) -> Ordering {
537-
self.as_slice().cmp(&other.as_slice())
538-
}
539-
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
540526
#[inline]
541527
fn cmp(&self, other: &Vec<T>) -> Ordering {
542528
self.as_slice().cmp(other.as_slice())
@@ -601,11 +587,11 @@ impl<T> Vec<T> {
601587
#[unstable = "matches collection reform specification, waiting for dust to settle"]
602588
pub fn reserve(&mut self, additional: uint) {
603589
if self.cap - self.len < additional {
604-
match self.len.checked_add(&additional) {
590+
match self.len.checked_add(additional) {
605591
None => panic!("Vec::reserve: `uint` overflow"),
606592
// if the checked_add
607593
Some(new_cap) => {
608-
let amort_cap = num::next_power_of_two(new_cap);
594+
let amort_cap = new_cap.next_power_of_two();
609595
// next_power_of_two will overflow to exactly 0 for really big capacities
610596
if amort_cap == 0 {
611597
self.grow_capacity(new_cap);
@@ -638,7 +624,7 @@ impl<T> Vec<T> {
638624
#[unstable = "matches collection reform specification, waiting for dust to settle"]
639625
pub fn reserve_exact(&mut self, additional: uint) {
640626
if self.cap - self.len < additional {
641-
match self.len.checked_add(&additional) {
627+
match self.len.checked_add(additional) {
642628
None => panic!("Vec::reserve: `uint` overflow"),
643629
Some(new_cap) => self.grow_capacity(new_cap)
644630
}
@@ -971,7 +957,7 @@ impl<T> Vec<T> {
971957
pub fn push(&mut self, value: T) {
972958
if mem::size_of::<T>() == 0 {
973959
// zero-size types consume no memory, so we can't rely on the address space running out
974-
self.len = self.len.checked_add(&1).expect("length overflow");
960+
self.len = self.len.checked_add(1).expect("length overflow");
975961
unsafe { mem::forget(value); }
976962
return
977963
}
@@ -1064,7 +1050,7 @@ impl<T> Vec<T> {
10641050
if mem::size_of::<T>() == 0 { return }
10651051

10661052
if capacity > self.cap {
1067-
let size = capacity.checked_mul(&mem::size_of::<T>())
1053+
let size = capacity.checked_mul(mem::size_of::<T>())
10681054
.expect("capacity overflow");
10691055
unsafe {
10701056
self.ptr = alloc_or_realloc(self.ptr, self.cap * mem::size_of::<T>(), size);

0 commit comments

Comments
 (0)