Skip to content

Commit ebcdd4b

Browse files
committed
---
yaml --- r: 104541 b: refs/heads/try c: 818203e h: refs/heads/master i: 104539: 69e8018 v: v3
1 parent fa880ae commit ebcdd4b

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

+1301
-412
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: fc1c06d7b1202a0cc7c09bcfeca88ada3fbfb091
5+
refs/heads/try: 818203e9d25f99cb6fcdf7210c512bfb09f0956f
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,8 @@ mod test {
13941394
});
13951395
}
13961396

1397+
// FIXME: #9407: ignore-test
1398+
#[ignore]
13971399
#[test]
13981400
fn dont_starve_1() {
13991401
let mut pool = SchedPool::new(PoolConfig {

branches/try/src/librustc/middle/typeck/check/mod.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,18 +2087,6 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt,
20872087
};
20882088
check_expr(fcx, rhs);
20892089

2090-
// If the or operator is used it might be that the user forgot to
2091-
// supply the do keyword. Let's be more helpful in that situation.
2092-
if op == ast::BiOr {
2093-
match ty::get(lhs_resolved_t).sty {
2094-
ty::ty_bare_fn(_) | ty::ty_closure(_) => {
2095-
tcx.sess.span_note(
2096-
ex.span, "did you forget the `do` keyword for the call?");
2097-
}
2098-
_ => ()
2099-
}
2100-
}
2101-
21022090
ty::mk_err()
21032091
}
21042092

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-
quux, priv baz
13+
pub quux, priv baz
1414
}
1515
}

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

Lines changed: 60 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
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;
1114
use std::os;
15+
use std::vec::MutableVector;
1216
use std::vec;
1317

1418
fn max(a: i32, b: i32) -> i32 {
@@ -19,6 +23,7 @@ fn max(a: i32, b: i32) -> i32 {
1923
}
2024
}
2125

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

3035
let mut r = n;
3136
loop {
32-
while r != 1 {
33-
count[r - 1] = r;
34-
r -= 1;
35-
}
36-
37-
for (perm_i, perm1_i) in perm.mut_iter().zip(perm1.iter()) {
38-
*perm_i = *perm1_i;
39-
}
40-
41-
let mut flips_count: i32 = 0;
42-
let mut k: i32;
43-
loop {
44-
k = perm[0];
45-
if k == 0 {
46-
break;
37+
unsafe {
38+
while r != 1 {
39+
count.unsafe_set((r-1) as uint, r);
40+
r -= 1;
4741
}
4842

49-
let k2 = (k+1) >> 1;
50-
for i in range(0i32, k2) {
51-
perm.swap(i as uint, (k - i) as uint);
43+
for (perm_i, perm1_i) in perm.mut_iter().zip(perm1.iter()) {
44+
*perm_i = *perm1_i;
5245
}
53-
flips_count += 1;
54-
}
5546

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-
};
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+
}
6254

63-
// Use incremental change to generate another permutation.
64-
loop {
65-
if r == n {
66-
println!("{}", checksum);
67-
return max_flips_count;
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;
6865
}
6966

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;
76-
}
77-
perm1[r] = perm0;
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+
};
73+
74+
// Use incremental change to generate another permutation.
75+
loop {
76+
if r == n {
77+
println!("{}", checksum);
78+
return max_flips_count;
79+
}
80+
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);
7890

79-
count[r] -= 1;
80-
if count[r] > 0 {
81-
break;
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;
8297
}
83-
r += 1;
84-
}
8598

86-
perm_count += 1;
99+
perm_count += 1;
100+
}
87101
}
88102
}
89103

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

0 commit comments

Comments
 (0)