Skip to content

Commit 69e8018

Browse files
committed
---
yaml --- r: 104539 b: refs/heads/try c: 9cc26cf h: refs/heads/master i: 104537: 5455d21 104535: 70f5b7c v: v3
1 parent a3b3d76 commit 69e8018

Some content is hidden

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

60 files changed

+313
-1419
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: 62f1d68439dcfd509eaca29887afa97f22938373
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
5-
refs/heads/try: fd83b2be2643152ecbba88400985609c4633a184
5+
refs/heads/try: 9cc26cfdf43adffe51acdc5ef9886cb5e1844d46
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/doc/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ li {list-style-type: none; }
4343
* [The `sync` library for concurrency-enabled mechanisms and primitives](sync/index.html)
4444
* [The `syntax` library, the Rust parser](syntax/index.html)
4545
* [The `term` terminal-handling library](term/index.html)
46-
* [The `test` library](test/index.html)
4746
* [The `uuid` 128-bit universally unique identifier library](uuid/index.html)
4847

4948
# Tooling

branches/try/src/libgreen/sched.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,8 +1394,6 @@ mod test {
13941394
});
13951395
}
13961396

1397-
// FIXME: #9407: ignore-test
1398-
#[ignore]
13991397
#[test]
14001398
fn dont_starve_1() {
14011399
let mut pool = SchedPool::new(PoolConfig {

branches/try/src/libstd/rt/crate_map.rs

Lines changed: 8 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use cast;
1211
use cmp::TotalOrd;
1312
use container::MutableSet;
1413
use iter::Iterator;
@@ -36,61 +35,27 @@ pub struct CrateMap<'a> {
3635
event_loop_factory: Option<fn() -> ~EventLoop>,
3736
}
3837

39-
// When working on android, apparently weak symbols don't work so well for
40-
// finding the crate map, and neither does dlopen + dlsym. This is mainly a
41-
// problem when integrating a shared library with an existing application.
42-
// Standalone binaries do not appear to have this problem. The reasons are a
43-
// little mysterious, and more information can be found in #11731.
44-
//
45-
// For now we provide a way to tell libstd about the crate map manually that's
46-
// checked before the normal weak symbol/dlopen paths. In theory this is useful
47-
// on other platforms where our dlopen/weak linkage strategy mysteriously fails
48-
// but the crate map can be specified manually.
49-
static mut MANUALLY_PROVIDED_CRATE_MAP: *CrateMap<'static> =
50-
0 as *CrateMap<'static>;
51-
#[no_mangle]
52-
#[cfg(not(test))]
53-
pub extern fn rust_set_crate_map(map: *CrateMap<'static>) {
54-
unsafe { MANUALLY_PROVIDED_CRATE_MAP = map; }
55-
}
56-
57-
fn manual_crate_map() -> Option<&'static CrateMap<'static>> {
58-
unsafe {
59-
if MANUALLY_PROVIDED_CRATE_MAP.is_null() {
60-
None
61-
} else {
62-
Some(cast::transmute(MANUALLY_PROVIDED_CRATE_MAP))
63-
}
64-
}
65-
}
66-
6738
#[cfg(not(windows))]
6839
pub fn get_crate_map() -> Option<&'static CrateMap<'static>> {
6940
extern {
7041
#[crate_map]
7142
static CRATE_MAP: CrateMap<'static>;
7243
}
7344

74-
manual_crate_map().or_else(|| {
75-
let ptr: (*CrateMap) = &'static CRATE_MAP;
76-
if ptr.is_null() {
77-
None
78-
} else {
79-
Some(&'static CRATE_MAP)
80-
}
81-
})
45+
let ptr: (*CrateMap) = &'static CRATE_MAP;
46+
if ptr.is_null() {
47+
return None;
48+
} else {
49+
return Some(&'static CRATE_MAP);
50+
}
8251
}
8352

8453
#[cfg(windows)]
8554
pub fn get_crate_map() -> Option<&'static CrateMap<'static>> {
55+
use cast::transmute;
8656
use c_str::ToCStr;
8757
use unstable::dynamic_lib::dl;
8858

89-
match manual_crate_map() {
90-
Some(cm) => return Some(cm),
91-
None => {}
92-
}
93-
9459
let sym = unsafe {
9560
let module = dl::open_internal();
9661
let rust_crate_map_toplevel = if cfg!(target_arch = "x86") {
@@ -109,7 +74,7 @@ pub fn get_crate_map() -> Option<&'static CrateMap<'static>> {
10974
return None;
11075
} else {
11176
unsafe {
112-
return Some(cast::transmute(sym));
77+
return Some(transmute(sym));
11378
}
11479
}
11580
}

branches/try/src/test/auxiliary/private_variant_1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010

1111
mod super_sekrit {
1212
pub enum sooper_sekrit {
13-
pub quux, priv baz
13+
quux, priv baz
1414
}
1515
}

branches/try/src/test/bench/shootout-fannkuch-redux.rs

Lines changed: 51 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-test reading from os::args()[1] - bogus!
12-
13-
use std::from_str::FromStr;
1411
use std::os;
15-
use std::vec::MutableVector;
1612
use std::vec;
1713

1814
fn max(a: i32, b: i32) -> i32 {
@@ -23,7 +19,6 @@ fn max(a: i32, b: i32) -> i32 {
2319
}
2420
}
2521

26-
#[inline(never)]
2722
fn fannkuch_redux(n: i32) -> i32 {
2823
let mut perm = vec::from_elem(n as uint, 0i32);
2924
let mut perm1 = vec::from_fn(n as uint, |i| i as i32);
@@ -34,74 +29,70 @@ fn fannkuch_redux(n: i32) -> i32 {
3429

3530
let mut r = n;
3631
loop {
37-
unsafe {
38-
while r != 1 {
39-
count.unsafe_set((r-1) as uint, r);
40-
r -= 1;
41-
}
42-
43-
for (perm_i, perm1_i) in perm.mut_iter().zip(perm1.iter()) {
44-
*perm_i = *perm1_i;
45-
}
32+
while r != 1 {
33+
count[r - 1] = r;
34+
r -= 1;
35+
}
4636

47-
let mut flips_count: i32 = 0;
48-
let mut k: i32;
49-
loop {
50-
k = *perm.unsafe_ref(0);
51-
if k == 0 {
52-
break;
53-
}
37+
for (perm_i, perm1_i) in perm.mut_iter().zip(perm1.iter()) {
38+
*perm_i = *perm1_i;
39+
}
5440

55-
let k2 = (k+1) >> 1;
56-
for i in range(0i32, k2) {
57-
let (perm_i, perm_k_i) = {
58-
(*perm.unsafe_ref(i as uint),
59-
*perm.unsafe_ref((k-i) as uint))
60-
};
61-
perm.unsafe_set(i as uint, perm_k_i);
62-
perm.unsafe_set((k-i) as uint, perm_i);
63-
}
64-
flips_count += 1;
41+
let mut flips_count: i32 = 0;
42+
let mut k: i32;
43+
loop {
44+
k = perm[0];
45+
if k == 0 {
46+
break;
6547
}
6648

67-
max_flips_count = max(max_flips_count, flips_count);
68-
checksum += if perm_count % 2 == 0 {
69-
flips_count
70-
} else {
71-
-flips_count
72-
};
49+
let k2 = (k+1) >> 1;
50+
for i in range(0i32, k2) {
51+
perm.swap(i as uint, (k - i) as uint);
52+
}
53+
flips_count += 1;
54+
}
7355

74-
// Use incremental change to generate another permutation.
75-
loop {
76-
if r == n {
77-
println!("{}", checksum);
78-
return max_flips_count;
79-
}
56+
max_flips_count = max(max_flips_count, flips_count);
57+
checksum += if perm_count % 2 == 0 {
58+
flips_count
59+
} else {
60+
-flips_count
61+
};
8062

81-
let perm0 = perm1[0];
82-
let mut i: i32 = 0;
83-
while i < r {
84-
let j = i + 1;
85-
let perm1_j = { *perm1.unsafe_ref(j as uint) };
86-
perm1.unsafe_set(i as uint, perm1_j);
87-
i = j;
88-
}
89-
perm1.unsafe_set(r as uint, perm0);
63+
// Use incremental change to generate another permutation.
64+
loop {
65+
if r == n {
66+
println!("{}", checksum);
67+
return max_flips_count;
68+
}
9069

91-
let count_r = { *count.unsafe_ref(r as uint) };
92-
count.unsafe_set(r as uint, count_r - 1);
93-
if *count.unsafe_ref(r as uint) > 0 {
94-
break;
95-
}
96-
r += 1;
70+
let perm0 = perm1[0];
71+
let mut i: i32 = 0;
72+
while i < r {
73+
let j = i + 1;
74+
perm1[i] = perm1[j];
75+
i = j;
9776
}
77+
perm1[r] = perm0;
9878

99-
perm_count += 1;
79+
count[r] -= 1;
80+
if count[r] > 0 {
81+
break;
82+
}
83+
r += 1;
10084
}
85+
86+
perm_count += 1;
10187
}
10288
}
10389

10490
fn main() {
105-
let n: i32 = FromStr::from_str(os::args()[1]).unwrap();
91+
let args = os::args();
92+
let n = if args.len() > 1 {
93+
from_str::<i32>(args[1]).unwrap()
94+
} else {
95+
2
96+
};
10697
println!("Pfannkuchen({}) = {}", n as int, fannkuch_redux(n) as int);
10798
}

0 commit comments

Comments
 (0)