Skip to content

Commit 1a1d008

Browse files
committed
---
yaml --- r: 71927 b: refs/heads/dist-snap c: 2f8b36f h: refs/heads/master i: 71925: 6d86d24 71923: 2388535 71919: d80959c v: v3
1 parent 1e669fb commit 1a1d008

Some content is hidden

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

45 files changed

+1610
-450
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10-
refs/heads/dist-snap: aff558998ef98b4c80cace32538ba23ee67a4d6d
10+
refs/heads/dist-snap: 2f8b36fc16178b298b23dfa199067ec2dd91df93
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/compiletest/compiletest.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#[allow(deprecated_mode)];
1818
#[allow(deprecated_pattern)];
1919

20-
extern mod core(vers = "0.7-rc");
21-
extern mod std(vers = "0.7-rc");
20+
extern mod core(vers = "0.7-pre");
21+
extern mod std(vers = "0.7-pre");
2222

2323
use core::*;
2424

branches/dist-snap/src/driver/driver.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@
99
// except according to those terms.
1010

1111
#[no_core];
12-
extern mod core(vers = "0.7-rc");
12+
extern mod core(vers = "0.7-pre");
1313

1414
#[cfg(rustpkg)]
15-
extern mod this(name = "rustpkg", vers = "0.7-rc");
15+
extern mod this(name = "rustpkg", vers = "0.7-pre");
1616

1717
#[cfg(fuzzer)]
18-
extern mod this(name = "fuzzer", vers = "0.7-rc");
18+
extern mod this(name = "fuzzer", vers = "0.7-pre");
1919

2020
#[cfg(rustdoc)]
21-
extern mod this(name = "rustdoc", vers = "0.7-rc");
21+
extern mod this(name = "rustdoc", vers = "0.7-pre");
2222

2323
#[cfg(rusti)]
24-
extern mod this(name = "rusti", vers = "0.7-rc");
24+
extern mod this(name = "rusti", vers = "0.7-pre");
2525

2626
#[cfg(rust)]
27-
extern mod this(name = "rust", vers = "0.7-rc");
27+
extern mod this(name = "rust", vers = "0.7-pre");
2828

2929
#[cfg(rustc)]
30-
extern mod this(name = "rustc", vers = "0.7-rc");
30+
extern mod this(name = "rustc", vers = "0.7-pre");
3131

3232
fn main() { this::main() }

branches/dist-snap/src/etc/kate/rust.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<!ENTITY rustIdent "[a-zA-Z_][a-zA-Z_0-9]*">
88
<!ENTITY rustIntSuf "([iu](8|16|32|64)?)?">
99
]>
10-
<language name="Rust" version="0.7-rc" kateversion="2.4" section="Sources" extensions="*.rs;*.rc" mimetype="text/x-rust" priority="15">
10+
<language name="Rust" version="0.7-pre" kateversion="2.4" section="Sources" extensions="*.rs;*.rc" mimetype="text/x-rust" priority="15">
1111
<highlighting>
1212
<list name="fn">
1313
<item> fn </item>

branches/dist-snap/src/libcore/core.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ they contained the following prologue:
4848

4949

5050
#[link(name = "core",
51-
vers = "0.7-rc",
51+
vers = "0.7-pre",
5252
uuid = "c70c24a7-5551-4f73-8e37-380b11d80be8",
5353
url = "https://github.com/mozilla/rust/tree/master/src/libcore")];
5454

@@ -66,7 +66,7 @@ they contained the following prologue:
6666
#[allow(deprecated_drop)];
6767

6868
// Make core testable by not duplicating lang items. See #2912
69-
#[cfg(test)] extern mod realcore(name = "core", vers = "0.7-rc");
69+
#[cfg(test)] extern mod realcore(name = "core", vers = "0.7-pre");
7070
#[cfg(test)] pub use kinds = realcore::kinds;
7171
#[cfg(test)] pub use ops = realcore::ops;
7272
#[cfg(test)] pub use cmp = realcore::cmp;

branches/dist-snap/src/libcore/iter.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,3 +344,29 @@ pub fn copy_seq<T:Copy,IT:BaseIter<T>,BT:Buildable<T>>(v: &IT) -> BT {
344344
for v.each |x| { push(*x); }
345345
}
346346
}
347+
348+
/**
349+
* Helper function to transform an internal iterator into an owned vector.
350+
*
351+
* # Example:
352+
*
353+
* ~~~
354+
* let v = ~[1, 2, 3];
355+
* let v2 = do iter_to_vec |f| { v.each(|e| f(*e)) };
356+
* if v != v2 { fail!() }
357+
* ~~~
358+
*/
359+
#[inline(always)]
360+
pub fn iter_to_vec<T>(pusher: &fn(it: &fn(T) -> bool)) -> ~[T] {
361+
let mut v = ~[];
362+
let pushf = |e| {v.push(e); true};
363+
pusher(pushf);
364+
v
365+
}
366+
367+
#[test]
368+
fn test_iter_to_vec() {
369+
let v = ~[1, 2, 3];
370+
let v2 = do iter_to_vec |f| { v.each(|e| f(*e)) };
371+
if v != v2 { fail!() }
372+
}

branches/dist-snap/src/libcore/rand.rs

Lines changed: 9 additions & 183 deletions
Original file line numberDiff line numberDiff line change
@@ -150,21 +150,7 @@ pub struct Weighted<T> {
150150

151151
pub trait RngUtil {
152152
fn gen<T:Rand>(&self) -> T;
153-
/**
154-
* Return a random int
155-
*
156-
* *Example*
157-
*
158-
* ~~~
159-
*
160-
* use core::rand::RngUtil;
161-
*
162-
* fn main() {
163-
* rng = rand::Rng();
164-
* println(fmt!("%d",rng.gen_int()));
165-
* }
166-
* ~~~
167-
*/
153+
/// Return a random int
168154
fn gen_int(&self) -> int;
169155
fn gen_int_range(&self, start: int, end: int) -> int;
170156
/// Return a random i8
@@ -190,21 +176,7 @@ pub trait RngUtil {
190176
fn gen_u32(&self) -> u32;
191177
/// Return a random u64
192178
fn gen_u64(&self) -> u64;
193-
/**
194-
* Return random float in the interval [0,1]
195-
*
196-
* *Example*
197-
*
198-
* ~~~
199-
*
200-
* use core::rand::RngUtil;
201-
*
202-
* fn main() {
203-
* rng = rand::Rng();
204-
* println(fmt!("%f",rng.gen_float()));
205-
* }
206-
* ~~~
207-
*/
179+
/// Return a random float in the interval [0,1]
208180
fn gen_float(&self) -> float;
209181
/// Return a random f32 in the interval [0,1]
210182
fn gen_f32(&self) -> f32;
@@ -216,184 +188,38 @@ pub trait RngUtil {
216188
* Return a char randomly chosen from chars, failing if chars is empty
217189
*/
218190
fn gen_char_from(&self, chars: &str) -> char;
219-
/**
220-
* Return a random bool
221-
*
222-
* *Example*
223-
*
224-
* ~~~
225-
*
226-
* use core::rand::RngUtil;
227-
*
228-
* fn main() {
229-
* rng = rand::Rng();
230-
* println(fmt!("%b",rng.gen_bool()));
231-
* }
232-
* ~~~
233-
*/
191+
/// Return a random bool
234192
fn gen_bool(&self) -> bool;
235-
/**
236-
* Return a bool with a 1 in n chance of true
237-
*
238-
* *Example*
239-
*
240-
* ~~~
241-
*
242-
* use core::rand::RngUtil;
243-
*
244-
* fn main() {
245-
* rng = rand::Rng();
246-
* println(fmt!("%b",rng.gen_weighted_bool(3)));
247-
* }
248-
* ~~~
249-
*/
193+
/// Return a bool with a 1 in n chance of true
250194
fn gen_weighted_bool(&self, n: uint) -> bool;
251195
/**
252196
* Return a random string of the specified length composed of A-Z,a-z,0-9
253-
*
254-
* *Example*
255-
*
256-
* ~~~
257-
*
258-
* use core::rand::RngUtil;
259-
*
260-
* fn main() {
261-
* rng = rand::Rng();
262-
* println(rng.gen_str(8));
263-
* }
264-
* ~~~
265197
*/
266198
fn gen_str(&self, len: uint) -> ~str;
267-
/**
268-
* Return a random byte string of the specified length
269-
*
270-
* *Example*
271-
*
272-
* ~~~
273-
*
274-
* use core::rand::RngUtil;
275-
*
276-
* fn main() {
277-
* rng = rand::Rng();
278-
* println(fmt!("%?",rng.gen_bytes(8)));
279-
* }
280-
* ~~~
281-
*/
199+
/// Return a random byte string of the specified length
282200
fn gen_bytes(&self, len: uint) -> ~[u8];
283-
///
284-
/**
285-
* Choose an item randomly, failing if values is empty
286-
*
287-
* *Example*
288-
*
289-
* ~~~
290-
*
291-
* use core::rand::RngUtil;
292-
*
293-
* fn main() {
294-
* rng = rand::Rng();
295-
* println(fmt!("%d",rng.choose([1,2,4,8,16,32])));
296-
* }
297-
* ~~~
298-
*/
201+
/// Choose an item randomly, failing if values is empty
299202
fn choose<T:Copy>(&self, values: &[T]) -> T;
300203
/// Choose Some(item) randomly, returning None if values is empty
301204
fn choose_option<T:Copy>(&self, values: &[T]) -> Option<T>;
302205
/**
303206
* Choose an item respecting the relative weights, failing if the sum of
304207
* the weights is 0
305-
*
306-
* *Example*
307-
*
308-
* ~~~
309-
*
310-
* use core::rand::RngUtil;
311-
*
312-
* fn main() {
313-
* rng = rand::Rng();
314-
* let x = [rand::Weighted {weight: 4, item: 'a'},
315-
* rand::Weighted {weight: 2, item: 'b'},
316-
* rand::Weighted {weight: 2, item: 'c'}];
317-
* println(fmt!("%c",rng.choose_weighted(x)));
318-
* }
319-
* ~~~
320208
*/
321209
fn choose_weighted<T:Copy>(&self, v : &[Weighted<T>]) -> T;
322210
/**
323211
* Choose Some(item) respecting the relative weights, returning none if
324212
* the sum of the weights is 0
325-
*
326-
* *Example*
327-
*
328-
* ~~~
329-
*
330-
* use core::rand::RngUtil;
331-
*
332-
* fn main() {
333-
* rng = rand::Rng();
334-
* let x = [rand::Weighted {weight: 4, item: 'a'},
335-
* rand::Weighted {weight: 2, item: 'b'},
336-
* rand::Weighted {weight: 2, item: 'c'}];
337-
* println(fmt!("%?",rng.choose_weighted_option(x)));
338-
* }
339-
* ~~~
340213
*/
341214
fn choose_weighted_option<T:Copy>(&self, v: &[Weighted<T>]) -> Option<T>;
342215
/**
343216
* Return a vec containing copies of the items, in order, where
344217
* the weight of the item determines how many copies there are
345-
*
346-
* *Example*
347-
*
348-
* ~~~
349-
*
350-
* use core::rand::RngUtil;
351-
*
352-
* fn main() {
353-
* rng = rand::Rng();
354-
* let x = [rand::Weighted {weight: 4, item: 'a'},
355-
* rand::Weighted {weight: 2, item: 'b'},
356-
* rand::Weighted {weight: 2, item: 'c'}];
357-
* println(fmt!("%?",rng.weighted_vec(x)));
358-
* }
359-
* ~~~
360218
*/
361219
fn weighted_vec<T:Copy>(&self, v: &[Weighted<T>]) -> ~[T];
362-
/**
363-
* Shuffle a vec
364-
*
365-
* *Example*
366-
*
367-
* ~~~
368-
*
369-
* use core::rand::RngUtil;
370-
*
371-
* fn main() {
372-
* rng = rand::Rng();
373-
* println(fmt!("%?",rng.shuffle([1,2,3])));
374-
* }
375-
* ~~~
376-
*/
220+
/// Shuffle a vec
377221
fn shuffle<T:Copy>(&self, values: &[T]) -> ~[T];
378-
/**
379-
* Shuffle a mutable vec in place
380-
*
381-
* *Example*
382-
*
383-
* ~~~
384-
*
385-
* use core::rand::RngUtil;
386-
*
387-
* fn main() {
388-
* rng = rand::Rng();
389-
* let mut y = [1,2,3];
390-
* rng.shuffle_mut(y);
391-
* println(fmt!("%?",y));
392-
* rng.shuffle_mut(y);
393-
* println(fmt!("%?",y));
394-
* }
395-
* ~~~
396-
*/
222+
/// Shuffle a mutable vec in place
397223
fn shuffle_mut<T>(&self, values: &mut [T]);
398224
}
399225

@@ -511,7 +337,7 @@ impl RngUtil for @Rng {
511337
self.next() & 1u32 == 1u32
512338
}
513339

514-
/// Return a bool with a 1-in-n chance of true
340+
/// Return a bool with a 1 in n chance of true
515341
fn gen_weighted_bool(&self, n: uint) -> bool {
516342
if n == 0u {
517343
true

branches/dist-snap/src/libfuzzer/fuzzer.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
#[link(name = "fuzzer",
13-
vers = "0.7-rc",
13+
vers = "0.7-pre",
1414
uuid = "d6418797-2736-4833-bd82-d3c684b7c1b0",
1515
url = "https://github.com/mozilla/rust/tree/master/src/libfuzzer")];
1616

@@ -26,9 +26,9 @@
2626
#[allow(deprecated_mode)];
2727
#[allow(deprecated_pattern)];
2828

29-
extern mod core(vers = "0.7-rc");
30-
extern mod std(vers = "0.7-rc");
31-
extern mod syntax(vers = "0.7-rc");
29+
extern mod core(vers = "0.7-pre");
30+
extern mod std(vers = "0.7-pre");
31+
extern mod syntax(vers = "0.7-pre");
3232

3333
use core::*;
3434
use core::io::WriterUtil;

branches/dist-snap/src/librust/rust.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
// FIXME #2238 Make run only accept source that emits an executable
1414

1515
#[link(name = "rust",
16-
vers = "0.7-rc",
16+
vers = "0.7-pre",
1717
uuid = "4a24da33-5cc8-4037-9352-2cbe9bd9d27c",
1818
url = "https://github.com/mozilla/rust/tree/master/src/rust")];
1919

2020
#[license = "MIT/ASL2"];
2121
#[crate_type = "lib"];
2222

23-
extern mod core(vers = "0.7-rc");
23+
extern mod core(vers = "0.7-pre");
2424

2525
use core::run;
2626

0 commit comments

Comments
 (0)