Skip to content

Commit ea1d41d

Browse files
committed
---
yaml --- r: 145854 b: refs/heads/try2 c: 2b978af h: refs/heads/master v: v3
1 parent 6fd30a0 commit ea1d41d

Some content is hidden

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

109 files changed

+2298
-1077
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 3c62ed657831aaed21033b6d24bd136786cf1f19
8+
refs/heads/try2: 2b978af227492b878a02b69300b3e7e3ce9ca7c5
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/Makefile.in

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,17 @@ CFG_VERSION = $(CFG_RELEASE)
147147
# numbers and dots here
148148
CFG_VERSION_WIN = 0.9
149149

150-
ifneq ($(wildcard $(CFG_GIT)),)
151-
ifneq ($(wildcard $(CFG_GIT_DIR)),)
152-
CFG_VERSION += $(shell git --git-dir=$(CFG_GIT_DIR) log -1 \
150+
# since $(CFG_GIT) may contain spaces (especially on Windows),
151+
# we need to escape them. (" " to r"\ ")
152+
# Note that $(subst ...) ignores space after `subst`,
153+
# so we use a hack: define $(SPACE) which contains space character.
154+
SPACE :=
155+
SPACE +=
156+
ifneq ($(wildcard $(subst $(SPACE),\$(SPACE),$(CFG_GIT))),)
157+
ifneq ($(wildcard $(subst $(SPACE),\$(SPACE),$(CFG_GIT_DIR))),)
158+
CFG_VERSION += $(shell git --git-dir='$(CFG_GIT_DIR)' log -1 \
153159
--pretty=format:'(%h %ci)')
154-
CFG_VER_HASH = $(shell git --git-dir=$(CFG_GIT_DIR) rev-parse HEAD)
160+
CFG_VER_HASH = $(shell git --git-dir='$(CFG_GIT_DIR)' rev-parse HEAD)
155161
endif
156162
endif
157163

branches/try2/mk/rt.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ RUNTIME_CXXS_$(1)_$(2) := \
8686
rt/sync/lock_and_signal.cpp \
8787
rt/sync/rust_thread.cpp \
8888
rt/rust_builtin.cpp \
89-
rt/rust_rng.cpp \
9089
rt/rust_upcall.cpp \
9190
rt/rust_uv.cpp \
9291
rt/miniz.cpp \

branches/try2/src/compiletest/compiletest.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ pub fn parse_config(args: ~[~str]) -> config {
109109
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
110110
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
111111
rustc_path: opt_path(matches, "rustc-path"),
112-
clang_path: matches.opt_str("clang-path").map_move(|s| Path(s)),
113-
llvm_bin_path: matches.opt_str("llvm-bin-path").map_move(|s| Path(s)),
112+
clang_path: matches.opt_str("clang-path").map(|s| Path(s)),
113+
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| Path(s)),
114114
src_base: opt_path(matches, "src-base"),
115115
build_base: opt_path(matches, "build-base"),
116116
aux_base: opt_path(matches, "aux-base"),
@@ -123,10 +123,10 @@ pub fn parse_config(args: ~[~str]) -> config {
123123
} else {
124124
None
125125
},
126-
logfile: matches.opt_str("logfile").map_move(|s| Path(s)),
127-
save_metrics: matches.opt_str("save-metrics").map_move(|s| Path(s)),
126+
logfile: matches.opt_str("logfile").map(|s| Path(s)),
127+
save_metrics: matches.opt_str("save-metrics").map(|s| Path(s)),
128128
ratchet_metrics:
129-
matches.opt_str("ratchet-metrics").map_move(|s| Path(s)),
129+
matches.opt_str("ratchet-metrics").map(|s| Path(s)),
130130
ratchet_noise_percent:
131131
matches.opt_str("ratchet-noise-percent").and_then(|s| from_str::<f64>(s)),
132132
runtool: matches.opt_str("runtool"),

branches/try2/src/libextra/base64.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ impl<'self> ToBase64 for &'self [u8] {
6464
*
6565
* ```rust
6666
* extern mod extra;
67-
* use extra::base64::{ToBase64, standard};
67+
* use extra::base64::{ToBase64, STANDARD};
6868
*
6969
* fn main () {
70-
* let str = [52,32].to_base64(standard);
71-
* println!("{}", str);
70+
* let str = [52,32].to_base64(STANDARD);
71+
* println!("base 64 output: {}", str);
7272
* }
7373
* ```
7474
*/
@@ -172,16 +172,19 @@ impl<'self> FromBase64 for &'self str {
172172
*
173173
* ```rust
174174
* extern mod extra;
175-
* use extra::base64::{ToBase64, FromBase64, standard};
175+
* use extra::base64::{ToBase64, FromBase64, STANDARD};
176176
* use std::str;
177177
*
178178
* fn main () {
179-
* let hello_str = "Hello, World".to_base64(standard);
180-
* println!("{}", hello_str);
181-
* let bytes = hello_str.from_base64();
182-
* println!("{:?}", bytes);
183-
* let result_str = str::from_utf8(bytes);
184-
* println!("{}", result_str);
179+
* let hello_str = bytes!("Hello, World").to_base64(STANDARD);
180+
* println!("base64 output: {}", hello_str);
181+
* let res = hello_str.from_base64();
182+
* if res.is_ok() {
183+
* let optBytes = str::from_utf8_opt(res.unwrap());
184+
* if optBytes.is_some() {
185+
* println!("decoded from base64: {}", optBytes.unwrap());
186+
* }
187+
* }
185188
* }
186189
* ```
187190
*/

branches/try2/src/libextra/bitv.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,16 +1524,16 @@ mod tests {
15241524
}
15251525

15261526
fn rng() -> rand::IsaacRng {
1527-
let seed = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
1528-
rand::IsaacRng::new_seeded(seed)
1527+
let seed = &[1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
1528+
rand::SeedableRng::from_seed(seed)
15291529
}
15301530

15311531
#[bench]
15321532
fn bench_uint_small(b: &mut BenchHarness) {
15331533
let mut r = rng();
15341534
let mut bitv = 0 as uint;
15351535
do b.iter {
1536-
bitv |= (1 << ((r.next() as uint) % uint::bits));
1536+
bitv |= (1 << ((r.next_u32() as uint) % uint::bits));
15371537
}
15381538
}
15391539

@@ -1542,7 +1542,7 @@ mod tests {
15421542
let mut r = rng();
15431543
let mut bitv = SmallBitv::new(uint::bits);
15441544
do b.iter {
1545-
bitv.set((r.next() as uint) % uint::bits, true);
1545+
bitv.set((r.next_u32() as uint) % uint::bits, true);
15461546
}
15471547
}
15481548

@@ -1551,7 +1551,7 @@ mod tests {
15511551
let mut r = rng();
15521552
let mut bitv = BigBitv::new(~[0]);
15531553
do b.iter {
1554-
bitv.set((r.next() as uint) % uint::bits, true);
1554+
bitv.set((r.next_u32() as uint) % uint::bits, true);
15551555
}
15561556
}
15571557

@@ -1562,7 +1562,7 @@ mod tests {
15621562
storage.grow(BENCH_BITS / uint::bits, &0u);
15631563
let mut bitv = BigBitv::new(storage);
15641564
do b.iter {
1565-
bitv.set((r.next() as uint) % BENCH_BITS, true);
1565+
bitv.set((r.next_u32() as uint) % BENCH_BITS, true);
15661566
}
15671567
}
15681568

@@ -1571,7 +1571,7 @@ mod tests {
15711571
let mut r = rng();
15721572
let mut bitv = Bitv::new(BENCH_BITS, false);
15731573
do b.iter {
1574-
bitv.set((r.next() as uint) % BENCH_BITS, true);
1574+
bitv.set((r.next_u32() as uint) % BENCH_BITS, true);
15751575
}
15761576
}
15771577

@@ -1580,7 +1580,7 @@ mod tests {
15801580
let mut r = rng();
15811581
let mut bitv = Bitv::new(uint::bits, false);
15821582
do b.iter {
1583-
bitv.set((r.next() as uint) % uint::bits, true);
1583+
bitv.set((r.next_u32() as uint) % uint::bits, true);
15841584
}
15851585
}
15861586

@@ -1589,7 +1589,7 @@ mod tests {
15891589
let mut r = rng();
15901590
let mut bitv = BitvSet::new();
15911591
do b.iter {
1592-
bitv.insert((r.next() as uint) % uint::bits);
1592+
bitv.insert((r.next_u32() as uint) % uint::bits);
15931593
}
15941594
}
15951595

@@ -1598,7 +1598,7 @@ mod tests {
15981598
let mut r = rng();
15991599
let mut bitv = BitvSet::new();
16001600
do b.iter {
1601-
bitv.insert((r.next() as uint) % BENCH_BITS);
1601+
bitv.insert((r.next_u32() as uint) % BENCH_BITS);
16021602
}
16031603
}
16041604

branches/try2/src/libextra/comm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl<T: Send> GenericPort<T> for SyncPort<T> {
114114
}
115115

116116
fn try_recv(&self) -> Option<T> {
117-
do self.duplex_stream.try_recv().map_move |val| {
117+
do self.duplex_stream.try_recv().map |val| {
118118
self.duplex_stream.try_send(());
119119
val
120120
}

branches/try2/src/libextra/dlist.rs

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl<T> DList<T> {
165165
/// Remove the first Node and return it, or None if the list is empty
166166
#[inline]
167167
fn pop_front_node(&mut self) -> Option<~Node<T>> {
168-
do self.list_head.take().map_move |mut front_node| {
168+
do self.list_head.take().map |mut front_node| {
169169
self.length -= 1;
170170
match front_node.next.take() {
171171
Some(node) => self.list_head = link_with_prev(node, Rawlink::none()),
@@ -191,7 +191,7 @@ impl<T> DList<T> {
191191
/// Remove the last Node and return it, or None if the list is empty
192192
#[inline]
193193
fn pop_back_node(&mut self) -> Option<~Node<T>> {
194-
do self.list_tail.resolve().map_move_default(None) |tail| {
194+
do self.list_tail.resolve().map_default(None) |tail| {
195195
self.length -= 1;
196196
self.list_tail = tail.prev;
197197
match tail.prev.resolve() {
@@ -206,25 +206,27 @@ impl<T> Deque<T> for DList<T> {
206206
/// Provide a reference to the front element, or None if the list is empty
207207
#[inline]
208208
fn front<'a>(&'a self) -> Option<&'a T> {
209-
self.list_head.map(|head| &head.value)
209+
self.list_head.as_ref().map(|head| &head.value)
210210
}
211211

212212
/// Provide a mutable reference to the front element, or None if the list is empty
213213
#[inline]
214214
fn front_mut<'a>(&'a mut self) -> Option<&'a mut T> {
215-
self.list_head.map_mut(|head| &mut head.value)
215+
self.list_head.as_mut().map(|head| &mut head.value)
216216
}
217217

218218
/// Provide a reference to the back element, or None if the list is empty
219219
#[inline]
220220
fn back<'a>(&'a self) -> Option<&'a T> {
221-
self.list_tail.resolve_immut().map(|tail| &tail.value)
221+
let tmp = self.list_tail.resolve_immut(); // FIXME: #3511: shouldn't need variable
222+
tmp.as_ref().map(|tail| &tail.value)
222223
}
223224

224225
/// Provide a mutable reference to the back element, or None if the list is empty
225226
#[inline]
226227
fn back_mut<'a>(&'a mut self) -> Option<&'a mut T> {
227-
self.list_tail.resolve().map_mut(|tail| &mut tail.value)
228+
let mut tmp = self.list_tail.resolve(); // FIXME: #3511: shouldn't need variable
229+
tmp.as_mut().map(|tail| &mut tail.value)
228230
}
229231

230232
/// Add an element first in the list
@@ -238,7 +240,7 @@ impl<T> Deque<T> for DList<T> {
238240
///
239241
/// O(1)
240242
fn pop_front(&mut self) -> Option<T> {
241-
self.pop_front_node().map_move(|~Node{value, _}| value)
243+
self.pop_front_node().map(|~Node{value, _}| value)
242244
}
243245

244246
/// Add an element last in the list
@@ -252,7 +254,7 @@ impl<T> Deque<T> for DList<T> {
252254
///
253255
/// O(1)
254256
fn pop_back(&mut self) -> Option<T> {
255-
self.pop_back_node().map_move(|~Node{value, _}| value)
257+
self.pop_back_node().map(|~Node{value, _}| value)
256258
}
257259
}
258260

@@ -268,7 +270,7 @@ impl<T> DList<T> {
268270
/// If the list is empty, do nothing.
269271
#[inline]
270272
pub fn rotate_forward(&mut self) {
271-
do self.pop_back_node().map_move |tail| {
273+
do self.pop_back_node().map |tail| {
272274
self.push_front_node(tail)
273275
};
274276
}
@@ -278,7 +280,7 @@ impl<T> DList<T> {
278280
/// If the list is empty, do nothing.
279281
#[inline]
280282
pub fn rotate_backward(&mut self) {
281-
do self.pop_front_node().map_move |head| {
283+
do self.pop_front_node().map |head| {
282284
self.push_back_node(head)
283285
};
284286
}
@@ -442,7 +444,7 @@ impl<'self, A> Iterator<&'self A> for DListIterator<'self, A> {
442444
if self.nelem == 0 {
443445
return None;
444446
}
445-
do self.head.map |head| {
447+
do self.head.as_ref().map |head| {
446448
self.nelem -= 1;
447449
self.head = &head.next;
448450
&head.value
@@ -461,7 +463,8 @@ impl<'self, A> DoubleEndedIterator<&'self A> for DListIterator<'self, A> {
461463
if self.nelem == 0 {
462464
return None;
463465
}
464-
do self.tail.resolve().map_move |prev| {
466+
let tmp = self.tail.resolve_immut(); // FIXME: #3511: shouldn't need variable
467+
do tmp.as_ref().map |prev| {
465468
self.nelem -= 1;
466469
self.tail = prev.prev;
467470
&prev.value
@@ -477,7 +480,7 @@ impl<'self, A> Iterator<&'self mut A> for MutDListIterator<'self, A> {
477480
if self.nelem == 0 {
478481
return None;
479482
}
480-
do self.head.resolve().map_move |next| {
483+
do self.head.resolve().map |next| {
481484
self.nelem -= 1;
482485
self.head = match next.next {
483486
Some(ref mut node) => Rawlink::some(&mut **node),
@@ -499,7 +502,7 @@ impl<'self, A> DoubleEndedIterator<&'self mut A> for MutDListIterator<'self, A>
499502
if self.nelem == 0 {
500503
return None;
501504
}
502-
do self.tail.resolve().map_move |prev| {
505+
do self.tail.resolve().map |prev| {
503506
self.nelem -= 1;
504507
self.tail = prev.prev;
505508
&mut prev.value
@@ -554,7 +557,7 @@ impl<'self, A> ListInsertion<A> for MutDListIterator<'self, A> {
554557
if self.nelem == 0 {
555558
return None
556559
}
557-
self.head.resolve().map_move(|head| &mut head.value)
560+
self.head.resolve().map(|head| &mut head.value)
558561
}
559562
}
560563

branches/try2/src/libextra/fileinput.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,7 @@ mod test {
596596
|i| format!("tmp/lib-fileinput-test-next-file-{}.tmp", i)),true);
597597
598598
for (i, filename) in filenames.iter().enumerate() {
599-
let contents =
600-
vec::from_fn(3, |j| format!("{} {}", i, j + 1));
599+
let contents = vec::from_fn(3, |j| format!("{} {}", i, j + 1));
601600
make_file(filename.get_ref(), contents);
602601
}
603602

branches/try2/src/libextra/num/bigint.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ impl BigUint {
698698
#[inline]
699699
pub fn new(v: ~[BigDigit]) -> BigUint {
700700
// omit trailing zeros
701-
let new_len = v.iter().rposition(|n| *n != 0).map_move_default(0, |p| p + 1);
701+
let new_len = v.iter().rposition(|n| *n != 0).map_default(0, |p| p + 1);
702702

703703
if new_len == v.len() { return BigUint { data: v }; }
704704
let mut v = v;
@@ -1417,7 +1417,7 @@ impl BigInt {
14171417
start = 1;
14181418
}
14191419
return BigUint::parse_bytes(buf.slice(start, buf.len()), radix)
1420-
.map_move(|bu| BigInt::from_biguint(sign, bu));
1420+
.map(|bu| BigInt::from_biguint(sign, bu));
14211421
}
14221422
14231423
/// Converts this `BigInt` into a `BigUint`, if it's not negative.
@@ -2507,7 +2507,7 @@ mod bigint_tests {
25072507
#[test]
25082508
fn test_from_str_radix() {
25092509
fn check(s: &str, ans: Option<int>) {
2510-
let ans = ans.map_move(|n| {
2510+
let ans = ans.map(|n| {
25112511
let x: BigInt = FromPrimitive::from_int(n).unwrap();
25122512
x
25132513
});

branches/try2/src/libextra/smallintmap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl<V> SmallIntMap<V> {
158158
{
159159
let values = replace(&mut self.v, ~[]);
160160
values.move_iter().enumerate().filter_map(|(i, v)| {
161-
v.map_move(|v| (i, v))
161+
v.map(|v| (i, v))
162162
})
163163
}
164164
}

branches/try2/src/libextra/term.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl Terminal {
127127
let inf = ti.unwrap();
128128
let nc = if inf.strings.find_equiv(&("setaf")).is_some()
129129
&& inf.strings.find_equiv(&("setab")).is_some() {
130-
inf.numbers.find_equiv(&("colors")).map_move_default(0, |&n| n)
130+
inf.numbers.find_equiv(&("colors")).map_default(0, |&n| n)
131131
} else { 0 };
132132

133133
return Ok(Terminal {out: out, ti: inf, num_colors: nc});
@@ -220,7 +220,7 @@ impl Terminal {
220220
cap = self.ti.strings.find_equiv(&("op"));
221221
}
222222
}
223-
let s = do cap.map_move_default(Err(~"can't find terminfo capability `sgr0`")) |op| {
223+
let s = do cap.map_default(Err(~"can't find terminfo capability `sgr0`")) |op| {
224224
expand(*op, [], &mut Variables::new())
225225
};
226226
if s.is_ok() {

0 commit comments

Comments
 (0)