Skip to content

Commit 11de71b

Browse files
author
lucy
committed
---
yaml --- r: 152135 b: refs/heads/try2 c: 1b3a030 h: refs/heads/master i: 152133: 471daf9 152131: e641c93 152127: 320b8a7 v: v3
1 parent 211a44a commit 11de71b

Some content is hidden

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

87 files changed

+1182
-1412
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: 25951b22420c5ecb1428a225a4dbb9e7529cf181
8+
refs/heads/try2: 1b3a03009215b518572b03dd4bf02dbcba129527
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ config.mk
6060
/rt/
6161
/rustllvm/
6262
/test/
63+
/build
6364
/inst/
6465
/mingw-build/
6566
src/.DS_Store

branches/try2/mk/crates.mk

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ DEPS_core :=
6060
DEPS_rlibc :=
6161
DEPS_alloc := core libc native:jemalloc
6262
DEPS_debug := std
63-
DEPS_std := core rand libc alloc native:rustrt native:backtrace
63+
DEPS_std := core libc alloc native:rustrt native:backtrace
6464
DEPS_graphviz := std
65-
DEPS_green := std native:context_switch
65+
DEPS_green := std rand native:context_switch
6666
DEPS_rustuv := std native:uv native:uv_support
6767
DEPS_native := std
6868
DEPS_syntax := std term serialize collections log fmt_macros debug
@@ -77,16 +77,16 @@ DEPS_glob := std
7777
DEPS_serialize := std collections log
7878
DEPS_term := std collections log
7979
DEPS_semver := std
80-
DEPS_uuid := std serialize
80+
DEPS_uuid := std serialize rand
8181
DEPS_sync := std alloc
8282
DEPS_getopts := std
83-
DEPS_collections := std debug
83+
DEPS_collections := std rand debug
8484
DEPS_fourcc := syntax std
8585
DEPS_hexfloat := syntax std
86-
DEPS_num := std
86+
DEPS_num := std rand
8787
DEPS_test := std collections getopts serialize term time regex
8888
DEPS_time := std serialize sync
89-
DEPS_rand := core
89+
DEPS_rand := std
9090
DEPS_url := std collections
9191
DEPS_workcache := std serialize collections log
9292
DEPS_log := std sync
@@ -104,7 +104,6 @@ TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
104104
ONLY_RLIB_core := 1
105105
ONLY_RLIB_rlibc := 1
106106
ONLY_RLIB_alloc := 1
107-
ONLY_RLIB_rand := 1
108107

109108
################################################################################
110109
# You should not need to edit below this line

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,10 @@ Here is a small example showing how to use Arcs. We wish to run concurrently sev
329329
a single large vector of floats. Each task needs the full vector to perform its duty.
330330

331331
~~~
332+
extern crate rand;
332333
extern crate sync;
333334
334335
use sync::Arc;
335-
use std::rand;
336336
337337
fn pnorm(nums: &[f64], p: uint) -> f64 {
338338
nums.iter().fold(0.0, |a, b| a + b.powf(p as f64)).powf(1.0 / (p as f64))
@@ -358,7 +358,7 @@ created by the line
358358

359359
~~~
360360
# extern crate sync;
361-
# use std::rand;
361+
# extern crate rand;
362362
# use sync::Arc;
363363
# fn main() {
364364
# let numbers = Vec::from_fn(1000000, |_| rand::random::<f64>());
@@ -372,7 +372,7 @@ reference to the underlying vector as if it were local.
372372

373373
~~~
374374
# extern crate sync;
375-
# use std::rand;
375+
# extern crate rand;
376376
# use sync::Arc;
377377
# fn pnorm(nums: &[f64], p: uint) -> f64 { 4.0 }
378378
# fn main() {

branches/try2/src/doc/rust.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,6 @@ Unsafe operations are those that potentially violate the memory-safety guarantee
10361036
The following language level features cannot be used in the safe subset of Rust:
10371037

10381038
- Dereferencing a [raw pointer](#pointer-types).
1039-
- Reading or writing a [mutable static variable](#mutable-statics).
10401039
- Calling an unsafe function (including an intrinsic or foreign function).
10411040

10421041
##### Unsafe functions

branches/try2/src/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ let ys = xs;
11121112
11131113
xs = Nil;
11141114
1115-
// `xs` can be used again
1115+
// `xs` can't be used again
11161116
~~~
11171117

11181118
A destructor call will only occur for a variable that has not been moved from,

branches/try2/src/liballoc/arc.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ impl<T: Send + Share + Clone> Arc<T> {
160160
// reference count is guaranteed to be 1 at this point, and we required
161161
// the Arc itself to be `mut`, so we're returning the only possible
162162
// reference to the inner data.
163-
let inner = unsafe { &mut *self._ptr };
164-
&mut inner.data
163+
unsafe { mem::transmute::<&_, &mut _>(self.deref()) }
165164
}
166165
}
167166

branches/try2/src/libcollections/bitv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,8 @@ mod tests {
980980
use bitv;
981981

982982
use std::uint;
983-
use std::rand;
984-
use std::rand::Rng;
983+
use rand;
984+
use rand::Rng;
985985

986986
static BENCH_BITS : uint = 1 << 14;
987987

branches/try2/src/libcollections/deque.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ pub mod bench {
4444
extern crate test;
4545
use self::test::Bencher;
4646
use std::container::MutableMap;
47-
use std::rand;
48-
use std::rand::Rng;
47+
use rand;
48+
use rand::Rng;
4949

5050
pub fn insert_rand_n<M:MutableMap<uint,uint>>(n: uint,
5151
map: &mut M,

branches/try2/src/libcollections/dlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ mod tests {
610610
extern crate test;
611611
use self::test::Bencher;
612612
use deque::Deque;
613-
use std::rand;
613+
use rand;
614614
use super::{DList, Node, ListInsertion};
615615

616616
pub fn check_links<T>(list: &DList<T>) {

branches/try2/src/libcollections/hashmap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ use std::iter::{range, range_inclusive};
2424
use std::mem::replace;
2525
use std::num;
2626
use std::option::{Option, Some, None};
27-
use std::rand;
28-
use std::rand::Rng;
27+
use rand;
28+
use rand::Rng;
2929
use std::result::{Ok, Err};
3030
use std::slice::ImmutableVector;
3131

branches/try2/src/libcollections/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#![deny(deprecated_owned_vector)]
2626

27+
extern crate rand;
2728
extern crate debug;
2829

2930
#[cfg(test)] extern crate test;

branches/try2/src/libcollections/treemap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,8 +1000,8 @@ impl<T: TotalOrd> Extendable<T> for TreeSet<T> {
10001000
mod test_treemap {
10011001
use super::{TreeMap, TreeNode};
10021002

1003-
use std::rand::Rng;
1004-
use std::rand;
1003+
use rand::Rng;
1004+
use rand;
10051005

10061006
#[test]
10071007
fn find_empty() {

branches/try2/src/libcollections/trie.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ mod test_map {
915915
mod bench_map {
916916
extern crate test;
917917
use super::TrieMap;
918-
use std::rand::{weak_rng, Rng};
918+
use rand::{weak_rng, Rng};
919919
use self::test::Bencher;
920920

921921
#[bench]

branches/try2/src/libcore/any.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ mod tests {
119119
use prelude::*;
120120
use super::*;
121121
use realstd::owned::{Box, AnyOwnExt};
122-
use realstd::str::Str;
122+
use realstd::str::{Str, StrAllocating};
123123

124124
#[deriving(Eq, Show)]
125125
struct Test;

branches/try2/src/libcore/char.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ mod test {
607607
use slice::ImmutableVector;
608608
use option::{Some, None};
609609
use realstd::string::String;
610-
use realstd::str::Str;
610+
use realstd::str::{Str, StrAllocating};
611611

612612
#[test]
613613
fn test_is_lowercase() {

branches/try2/src/libcore/cmp.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
//! assert!(SketchyNum {num: 25} != SketchyNum {num: 57});
3838
//! ```
3939
40-
pub use PartialEq = cmp::Eq;
41-
pub use PartialOrd = cmp::Ord;
42-
4340
/// Trait for values that can be compared for equality and inequality.
4441
///
4542
/// This trait allows partial equality, where types can be unordered instead of

branches/try2/src/libcore/fmt/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ pub fn argument<'a, T>(f: extern "Rust" fn(&T, &mut Formatter) -> Result,
596596
#[cfg(test)]
597597
pub fn format(args: &Arguments) -> ::realstd::string::String {
598598
use str;
599+
use realstd::str::StrAllocating;
599600
use realstd::io::MemWriter;
600601

601602
fn mywrite<T: ::realstd::io::Writer>(t: &mut T, b: &[u8]) {

branches/try2/src/libcore/fmt/num.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ mod tests {
194194
use fmt::radix;
195195
use super::{Binary, Octal, Decimal, LowerHex, UpperHex};
196196
use super::{GenericRadix, Radix};
197-
use realstd::str::Str;
197+
use realstd::str::{Str, StrAllocating};
198198

199199
#[test]
200200
fn test_radix_base() {
@@ -399,71 +399,71 @@ mod bench {
399399
mod uint {
400400
use super::test::Bencher;
401401
use fmt::radix;
402-
use realstd::rand::{weak_rng, Rng};
402+
use rand::{XorShiftRng, Rng};
403403

404404
#[bench]
405405
fn format_bin(b: &mut Bencher) {
406-
let mut rng = weak_rng();
406+
let mut rng = XorShiftRng::new().unwrap();
407407
b.iter(|| { format!("{:t}", rng.gen::<uint>()); })
408408
}
409409

410410
#[bench]
411411
fn format_oct(b: &mut Bencher) {
412-
let mut rng = weak_rng();
412+
let mut rng = XorShiftRng::new().unwrap();
413413
b.iter(|| { format!("{:o}", rng.gen::<uint>()); })
414414
}
415415

416416
#[bench]
417417
fn format_dec(b: &mut Bencher) {
418-
let mut rng = weak_rng();
418+
let mut rng = XorShiftRng::new().unwrap();
419419
b.iter(|| { format!("{:u}", rng.gen::<uint>()); })
420420
}
421421

422422
#[bench]
423423
fn format_hex(b: &mut Bencher) {
424-
let mut rng = weak_rng();
424+
let mut rng = XorShiftRng::new().unwrap();
425425
b.iter(|| { format!("{:x}", rng.gen::<uint>()); })
426426
}
427427

428428
#[bench]
429429
fn format_base_36(b: &mut Bencher) {
430-
let mut rng = weak_rng();
430+
let mut rng = XorShiftRng::new().unwrap();
431431
b.iter(|| { format!("{}", radix(rng.gen::<uint>(), 36)); })
432432
}
433433
}
434434

435435
mod int {
436436
use super::test::Bencher;
437437
use fmt::radix;
438-
use realstd::rand::{weak_rng, Rng};
438+
use rand::{XorShiftRng, Rng};
439439

440440
#[bench]
441441
fn format_bin(b: &mut Bencher) {
442-
let mut rng = weak_rng();
442+
let mut rng = XorShiftRng::new().unwrap();
443443
b.iter(|| { format!("{:t}", rng.gen::<int>()); })
444444
}
445445

446446
#[bench]
447447
fn format_oct(b: &mut Bencher) {
448-
let mut rng = weak_rng();
448+
let mut rng = XorShiftRng::new().unwrap();
449449
b.iter(|| { format!("{:o}", rng.gen::<int>()); })
450450
}
451451

452452
#[bench]
453453
fn format_dec(b: &mut Bencher) {
454-
let mut rng = weak_rng();
454+
let mut rng = XorShiftRng::new().unwrap();
455455
b.iter(|| { format!("{:d}", rng.gen::<int>()); })
456456
}
457457

458458
#[bench]
459459
fn format_hex(b: &mut Bencher) {
460-
let mut rng = weak_rng();
460+
let mut rng = XorShiftRng::new().unwrap();
461461
b.iter(|| { format!("{:x}", rng.gen::<int>()); })
462462
}
463463

464464
#[bench]
465465
fn format_base_36(b: &mut Bencher) {
466-
let mut rng = weak_rng();
466+
let mut rng = XorShiftRng::new().unwrap();
467467
b.iter(|| { format!("{}", radix(rng.gen::<int>(), 36)); })
468468
}
469469
}

branches/try2/src/libcore/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
#[cfg(test)] extern crate realcore = "core";
6060
#[cfg(test)] extern crate libc;
6161
#[cfg(test)] extern crate native;
62+
#[cfg(test)] extern crate rand;
6263
#[cfg(test)] extern crate realstd = "std";
6364

6465
#[cfg(test)] pub use cmp = realcore::cmp;

branches/try2/src/libcore/result.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,10 +637,11 @@ pub fn fold_<T,E,Iter:Iterator<Result<T,E>>>(iterator: Iter) -> Result<(),E> {
637637
#[cfg(test)]
638638
mod tests {
639639
use realstd::vec::Vec;
640+
use realstd::string::String;
640641

641642
use result::{collect, fold, fold_};
642643
use prelude::*;
643-
use realstd::str::Str;
644+
use realstd::str::{Str, StrAllocating};
644645
use iter::range;
645646

646647
pub fn op1() -> Result<int, &'static str> { Ok(666) }

branches/try2/src/libcore/tuple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ mod tests {
294294
use super::*;
295295
use clone::Clone;
296296
use cmp::*;
297-
use realstd::str::Str;
297+
use realstd::str::{Str, StrAllocating};
298298

299299
#[test]
300300
fn test_clone() {

branches/try2/src/libflate/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,10 @@ pub fn inflate_bytes_zlib(bytes: &[u8]) -> Option<CVec<u8>> {
108108

109109
#[cfg(test)]
110110
mod tests {
111+
extern crate rand;
112+
111113
use super::{inflate_bytes, deflate_bytes};
112-
use std::rand;
113-
use std::rand::Rng;
114+
use self::rand::Rng;
114115

115116
#[test]
116117
#[allow(deprecated_owned_vector)]
@@ -119,8 +120,7 @@ mod tests {
119120
let mut words = vec!();
120121
for _ in range(0, 20) {
121122
let range = r.gen_range(1u, 10);
122-
let v = r.gen_iter::<u8>().take(range).collect::<Vec<u8>>();
123-
words.push(v);
123+
words.push(r.gen_vec::<u8>(range));
124124
}
125125
for _ in range(0, 20) {
126126
let mut input = vec![];

branches/try2/src/libgreen/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@
212212

213213
#[cfg(test)] #[phase(syntax, link)] extern crate log;
214214
#[cfg(test)] extern crate rustuv;
215+
extern crate rand;
215216
extern crate libc;
216217
extern crate alloc;
217218

0 commit comments

Comments
 (0)