Skip to content

Commit a9e806e

Browse files
committed
---
yaml --- r: 34278 b: refs/heads/snap-stage3 c: 0100b02 h: refs/heads/master v: v3
1 parent 03214d8 commit a9e806e

File tree

5 files changed

+27
-22
lines changed

5 files changed

+27
-22
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 2452ee11abd1aab42adbf4e8e6455dd74e2a5aa9
4+
refs/heads/snap-stage3: 0100b02b3aade7f476c543957df1dbcee0d0b52f
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/tutorial-ffi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern mod crypto {
2222
2323
fn as_hex(data: ~[u8]) -> ~str {
2424
let mut acc = ~"";
25-
for data.each |byte| { acc += fmt!("%02x", byte as uint); }
25+
for data.each |&byte| { acc += fmt!("%02x", byte as uint); }
2626
return acc;
2727
}
2828
@@ -33,8 +33,8 @@ fn sha1(data: ~str) -> ~str unsafe {
3333
return as_hex(vec::from_buf(hash, 20));
3434
}
3535
36-
fn main(args: ~[~str]) {
37-
io::println(sha1(args[1]));
36+
fn main() {
37+
io::println(sha1(core::os::args()[1]));
3838
}
3939
~~~~
4040

branches/snap-stage3/src/test/bench/shootout-mandelbrot.rs

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,18 @@
1212
// http://shootout.alioth.debian.org/
1313
// u64q/program.php?test=mandelbrot&lang=python3&id=2
1414
//
15-
// takes 2 optional args:
15+
// takes 3 optional args:
1616
// square image size, defaults to 80_u
17+
// yield frequency, defaults to 10_u (yield every 10 spawns)
1718
// output path, default is "" (no output), "-" means stdout
1819
//
1920
// in the shootout, they use 16000 as image size
21+
// yield frequency doesn't seem to have much effect
2022
//
2123
// writes pbm image to output path
2224

25+
#[legacy_modes];
26+
2327
extern mod std;
2428
use io::WriterUtil;
2529
use std::map::HashMap;
@@ -47,7 +51,7 @@ impl cmplx : ops::Add<cmplx,cmplx> {
4751
}
4852
}
4953

50-
struct Line {i: uint, b: ~[u8]}
54+
type line = {i: uint, b: ~[u8]};
5155

5256
pure fn cabs(x: cmplx) -> f64
5357
{
@@ -83,7 +87,7 @@ fn fillbyte(x: cmplx, incr: f64) -> u8 {
8387
rv
8488
}
8589

86-
fn chanmb(i: uint, size: uint, ch: oldcomm::Chan<Line>) -> ()
90+
fn chanmb(i: uint, size: uint, ch: oldcomm::Chan<line>) -> ()
8791
{
8892
let mut crv = ~[];
8993
let incr = 2f64/(size as f64);
@@ -93,22 +97,22 @@ fn chanmb(i: uint, size: uint, ch: oldcomm::Chan<Line>) -> ()
9397
let x = cmplx {re: xincr*(j as f64) - 1.5f64, im: y};
9498
crv.push(fillbyte(x, incr));
9599
};
96-
oldcomm::send(ch, Line {i:i, b: move crv});
100+
oldcomm::send(ch, {i:i, b:crv});
97101
}
98102

99103
type devnull = {dn: int};
100104

101105
impl devnull: io::Writer {
102106
fn write(_b: &[const u8]) {}
103-
fn seek(_i: int, _s: io::SeekStyle) {}
107+
fn seek(+_i: int, +_s: io::SeekStyle) {}
104108
fn tell() -> uint {0_u}
105109
fn flush() -> int {0}
106110
fn get_type() -> io::WriterType { io::File }
107111
}
108112

109-
fn writer(path: ~str, writech: oldcomm::Chan<oldcomm::Chan<Line>>, size: uint)
113+
fn writer(path: ~str, writech: oldcomm::Chan<oldcomm::Chan<line>>, size: uint)
110114
{
111-
let p: oldcomm::Port<Line> = oldcomm::Port();
115+
let p: oldcomm::Port<line> = oldcomm::Port();
112116
let ch = oldcomm::Chan(&p);
113117
oldcomm::send(writech, ch);
114118
let cout: io::Writer = match path {
@@ -160,13 +164,16 @@ fn writer(path: ~str, writech: oldcomm::Chan<oldcomm::Chan<Line>>, size: uint)
160164
fn main() {
161165
let args = os::args();
162166
let args = if os::getenv(~"RUST_BENCH").is_some() {
163-
~[~"", ~"4000"]
167+
~[~"", ~"4000", ~"10"]
164168
} else {
165169
args
166170
};
167171

168-
let path = if vec::len(args) < 3_u { ~"" }
169-
else { copy args[2] }; // FIXME: bad for perf
172+
let path = if vec::len(args) < 4_u { ~"" }
173+
else { copy args[3] }; // FIXME: bad for perf
174+
175+
let yieldevery = if vec::len(args) < 3_u { 10_u }
176+
else { uint::from_str(args[2]).get() };
170177

171178
let size = if vec::len(args) < 2_u { 80_u }
172179
else { uint::from_str(args[1]).get() };
@@ -178,6 +185,10 @@ fn main() {
178185
};
179186
let ch = oldcomm::recv(writep);
180187
for uint::range(0_u, size) |j| {
181-
do task::spawn { chanmb(j, size, ch) };
188+
task::spawn(|| chanmb(j, size, ch) );
189+
if j % yieldevery == 0_u {
190+
debug!("Y %u", j);
191+
task::yield();
192+
};
182193
};
183194
}

branches/snap-stage3/src/test/run-pass/issue-3250.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

branches/snap-stage3/src/test/run-pass/trait-composition-trivial.rs

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

11+
// xfail-fast - ICE
1112
trait Foo {
1213
fn foo();
1314
}

0 commit comments

Comments
 (0)