Skip to content

Commit 2382216

Browse files
committed
---
yaml --- r: 160031 b: refs/heads/try c: ceff2ca h: refs/heads/master i: 160029: ea891b4 160027: 0e9c9e9 160023: 2953818 160015: e9158fb 159999: 13d4cc4 v: v3
1 parent f83dd67 commit 2382216

File tree

232 files changed

+2467
-2774
lines changed

Some content is hidden

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

232 files changed

+2467
-2774
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: e09d98603e608c9e47d4c89f7b4dca87a4b56da3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 9c96a79a74f10bed18b031ce0ac4126c56d6cfb3
5-
refs/heads/try: 6f7081fad5889c7b41460103fc8abc98f3285c60
5+
refs/heads/try: ceff2ca1fc57d60fa3af2372d49a23055aa441bc
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/mk/dist.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ $(PKG_EXE): rust.iss modpath.iss upgrade.iss LICENSE.txt rust-logo.ico \
125125
dist-prepare-win
126126
$(CFG_PYTHON) $(S)src/etc/make-win-dist.py tmp/dist/win $(CFG_BUILD)
127127
@$(call E, ISCC: $@)
128-
$(Q)$(CFG_ISCC) $<
128+
$(Q)"$(CFG_ISCC)" $<
129129

130130
$(eval $(call DEF_PREPARE,win))
131131

branches/try/mk/main.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ CFG_GIT_DIR := $(CFG_SRC_DIR).git
5252
# so we use a hack: define $(SPACE) which contains space character.
5353
SPACE :=
5454
SPACE +=
55-
ifneq ($(CFG_GIT),)
55+
ifneq ($(wildcard $(subst $(SPACE),\$(SPACE),$(CFG_GIT))),)
5656
ifneq ($(wildcard $(subst $(SPACE),\$(SPACE),$(CFG_GIT_DIR))),)
5757
CFG_VER_DATE = $(shell git --git-dir='$(CFG_GIT_DIR)' log -1 --pretty=format:'%ci')
5858
CFG_VER_HASH = $(shell git --git-dir='$(CFG_GIT_DIR)' rev-parse HEAD)

branches/try/src/doc/guide-lifetimes.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ 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;
5554
# struct Point {x: f64, y: f64}
5655
# fn sqrt(f: f64) -> f64 { 0.0 }
5756
fn compute_distance(p1: &Point, p2: &Point) -> f64 {

branches/try/src/doc/guide-tasks.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ 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;
229228
# use std::sync::Future;
230229
fn partial_sum(start: uint) -> f64 {
231230
let mut local_sum = 0f64;
@@ -263,7 +262,6 @@ several computations on a single large vector of floats. Each task needs the
263262
full vector to perform its duty.
264263

265264
```{rust}
266-
use std::num::Float;
267265
use std::rand;
268266
use std::sync::Arc;
269267

branches/try/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-
fail.
5277+
panic.
52785278

52795279
# Macros
52805280

branches/try/src/etc/emacs/rust-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
"false" "fn" "for"
177177
"if" "impl" "in"
178178
"let" "loop"
179-
"match" "mod" "move" "mut"
179+
"match" "mod" "mut"
180180
"priv" "proc" "pub"
181181
"ref" "return"
182182
"self" "static" "struct" "super"

branches/try/src/etc/kate/rust.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
<item> loop </item>
3535
<item> match </item>
3636
<item> mod </item>
37-
<item> move </item>
3837
<item> mut </item>
3938
<item> priv </item>
4039
<item> pub </item>

branches/try/src/etc/make-win-dist.py

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def find_files(files, path):
2323
return found
2424

2525
def make_win_dist(dist_root, target_triple):
26-
# Ask gcc where it keeps its stuff
26+
# Ask gcc where it keeps its' stuff
2727
gcc_out = subprocess.check_output(["gcc.exe", "-print-search-dirs"])
2828
bin_path = os.environ["PATH"].split(os.pathsep)
2929
lib_path = []
@@ -42,47 +42,11 @@ def make_win_dist(dist_root, target_triple):
4242
else:
4343
rustc_dlls.append("libgcc_s_seh-1.dll")
4444

45-
target_libs = [ # MinGW libs
46-
"crtbegin.o",
47-
"crtend.o",
48-
"crt2.o",
49-
"dllcrt2.o",
50-
"libgcc.a",
51-
"libgcc_eh.a",
52-
"libgcc_s.a",
53-
"libm.a",
54-
"libmingw32.a",
55-
"libmingwex.a",
56-
"libstdc++.a",
57-
"libiconv.a",
58-
"libmoldname.a",
59-
# Windows import libs
60-
"libadvapi32.a",
61-
"libbcrypt.a",
62-
"libcomctl32.a",
63-
"libcomdlg32.a",
64-
"libcrypt32.a",
65-
"libgdi32.a",
66-
"libimagehlp.a",
67-
"libiphlpapi.a",
68-
"libkernel32.a",
69-
"libmsvcrt.a",
70-
"libodbc32.a",
71-
"libole32.a",
72-
"liboleaut32.a",
73-
"libopengl32.a",
74-
"libpsapi.a",
75-
"librpcrt4.a",
76-
"libsetupapi.a",
77-
"libshell32.a",
78-
"libuser32.a",
79-
"libuuid.a",
80-
"libwinhttp.a",
81-
"libwinmm.a",
82-
"libwinspool.a",
83-
"libws2_32.a",
84-
"libwsock32.a",
85-
]
45+
target_libs = ["crtbegin.o", "crtend.o", "crt2.o", "dllcrt2.o",
46+
"libadvapi32.a", "libcrypt32.a", "libgcc.a", "libgcc_eh.a", "libgcc_s.a",
47+
"libimagehlp.a", "libiphlpapi.a", "libkernel32.a", "libm.a", "libmingw32.a",
48+
"libmingwex.a", "libmsvcrt.a", "libpsapi.a", "libshell32.a", "libstdc++.a",
49+
"libuser32.a", "libws2_32.a", "libiconv.a", "libmoldname.a"]
8650

8751
# Find mingw artifacts we want to bundle
8852
target_tools = find_files(target_tools, bin_path)
@@ -95,14 +59,14 @@ def make_win_dist(dist_root, target_triple):
9559
shutil.copy(src, dist_bin_dir)
9660

9761
# Copy platform tools to platform-specific bin directory
98-
target_bin_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "bin")
62+
target_bin_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "gcc", "bin")
9963
if not os.path.exists(target_bin_dir):
10064
os.makedirs(target_bin_dir)
10165
for src in target_tools:
10266
shutil.copy(src, target_bin_dir)
10367

10468
# Copy platform libs to platform-spcific lib directory
105-
target_lib_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "lib")
69+
target_lib_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "gcc", "lib")
10670
if not os.path.exists(target_lib_dir):
10771
os.makedirs(target_lib_dir)
10872
for src in target_libs:

branches/try/src/etc/vim/syntax/rust.vim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
2323
syn keyword rustKeyword continue
2424
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
2525
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
26-
syn keyword rustKeyword for in if impl let
26+
syn keyword rustKeyword for in if impl let move
2727
syn keyword rustKeyword loop once proc pub
2828
syn keyword rustKeyword return super
2929
syn keyword rustKeyword unsafe virtual where while
3030
syn keyword rustKeyword use nextgroup=rustModPath skipwhite skipempty
3131
" FIXME: Scoped impl's name is also fallen in this category
3232
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty
33-
syn keyword rustStorage move mut ref static const
33+
syn keyword rustStorage mut ref static const
3434

3535
syn keyword rustInvalidBareKeyword crate
3636

@@ -97,7 +97,8 @@ 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 NumCast Int SignedInt UnsignedInt Float
100+
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul CheckedDiv
101+
syn keyword rustTrait Signed Unsigned Primitive Int Float
101102
syn keyword rustTrait FloatMath ToPrimitive FromPrimitive
102103
syn keyword rustTrait Box
103104
syn keyword rustTrait GenericPath Path PosixPath WindowsPath

branches/try/src/liballoc/boxed.rs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,50 @@ 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
68105
impl<Sized? T: PartialEq> PartialEq for Box<T> {
69106
#[inline]
70107
fn eq(&self, other: &Box<T>) -> bool { PartialEq::eq(&**self, &**other) }
71108
#[inline]
72109
fn ne(&self, other: &Box<T>) -> bool { PartialEq::ne(&**self, &**other) }
73110
}
111+
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
74112
impl<Sized? T: PartialOrd> PartialOrd for Box<T> {
75113
#[inline]
76114
fn partial_cmp(&self, other: &Box<T>) -> Option<Ordering> {
@@ -85,12 +123,14 @@ impl<Sized? T: PartialOrd> PartialOrd for Box<T> {
85123
#[inline]
86124
fn gt(&self, other: &Box<T>) -> bool { PartialOrd::gt(&**self, &**other) }
87125
}
126+
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
88127
impl<Sized? T: Ord> Ord for Box<T> {
89128
#[inline]
90129
fn cmp(&self, other: &Box<T>) -> Ordering {
91130
Ord::cmp(&**self, &**other)
92131
}
93132
}
133+
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
94134
impl<Sized? T: Eq> Eq for Box<T> {}
95135

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

branches/try/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::{Int, UnsignedInt};
41+
use std::num;
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((new_min_chunk_size + 1u).next_power_of_two(), true);
190+
chunk(num::next_power_of_two(new_min_chunk_size + 1u), 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((new_min_chunk_size + 1u).next_power_of_two(), false);
231+
chunk(num::next_power_of_two(new_min_chunk_size + 1u), 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);

branches/try/src/libcollections/bit.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
//!
2323
//! ```
2424
//! use std::collections::{BitvSet, Bitv};
25-
//! use std::num::Float;
2625
//! use std::iter;
2726
//!
2827
//! let max_prime = 10000;
@@ -70,7 +69,6 @@ use core::default::Default;
7069
use core::fmt;
7170
use core::iter::{Chain, Enumerate, Repeat, Skip, Take};
7271
use core::iter;
73-
use core::num::Int;
7472
use core::slice;
7573
use core::u32;
7674
use std::hash;

branches/try/src/libcollections/enum_set.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
1616
use core::prelude::*;
1717
use core::fmt;
18-
use core::num::Int;
1918

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

@@ -487,7 +486,7 @@ mod test {
487486
unsafe { mem::transmute(v) }
488487
}
489488
}
490-
let mut set = EnumSet::new();
491-
set.insert(V64);
489+
let mut set = EnumSet::empty();
490+
set.add(V64);
492491
}
493492
}

branches/try/src/libcollections/hash/mod.rs

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

7473
use vec::Vec;
7574

branches/try/src/libcollections/str.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,13 @@ 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
537544
#[inline]
538545
fn cmp(&self, other: &MaybeOwned) -> Ordering {
539546
self.as_slice().cmp(other.as_slice())

0 commit comments

Comments
 (0)