Skip to content

Commit f9d7e70

Browse files
committed
---
yaml --- r: 93907 b: refs/heads/try c: 4068139 h: refs/heads/master i: 93905: 298edbf 93903: 1b4e222 v: v3
1 parent 37f4278 commit f9d7e70

File tree

149 files changed

+267
-291
lines changed

Some content is hidden

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

149 files changed

+267
-291
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: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 9f9efae790bba41f08befc2af47ef235b03dd8a9
5+
refs/heads/try: 406813957b65a1627e9b26f73019868a7da1ae79
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/etc/combine-tests.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,25 @@
55
# can run it "fast": spawning zillions of windows processes is our major build
66
# bottleneck (and it doesn't hurt to run faster on other platforms as well).
77

8-
import sys
9-
import os
10-
import codecs
11-
8+
import sys, os, re, codecs
129

1310
def scrub(b):
14-
if sys.version_info >= (3,) and type(b) == bytes:
15-
return b.decode('ascii')
16-
else:
17-
return b
11+
if sys.version_info >= (3,) and type(b) == bytes:
12+
return b.decode('ascii')
13+
else:
14+
return b
1815

1916
src_dir = scrub(os.getenv("CFG_SRC_DIR"))
2017
if not src_dir:
21-
raise Exception("missing env var CFG_SRC_DIR")
18+
raise Exception("missing env var CFG_SRC_DIR")
2219

2320
run_pass = os.path.join(src_dir, "src", "test", "run-pass")
2421
run_pass = os.path.abspath(run_pass)
2522
stage2_tests = []
2623

2724
for t in os.listdir(run_pass):
2825
if t.endswith(".rs") and not (
29-
t.startswith(".") or t.startswith("#") or t.startswith("~")):
26+
t.startswith(".") or t.startswith("#") or t.startswith("~")):
3027
f = codecs.open(os.path.join(run_pass, t), "r", "utf8")
3128
s = f.read()
3229
if not ("xfail-test" in s or
@@ -44,11 +41,10 @@ def scrub(b):
4441
c.write("// AUTO-GENERATED FILE: DO NOT EDIT\n")
4542
c.write("#[link(name=\"run_pass_stage2\", vers=\"0.1\")];\n")
4643
c.write("#[feature(globs, macro_rules, struct_variant, managed_boxes)];\n")
47-
c.write("#[allow(attribute_usage)];\n")
4844
for t in stage2_tests:
4945
p = os.path.join(run_pass, t)
5046
p = p.replace("\\", "\\\\")
51-
c.write("#[path = \"%s\"]" % p)
47+
c.write("#[path = \"%s\"]" % p);
5248
c.write("pub mod t_%d;\n" % i)
5349
i += 1
5450
c.close()
@@ -60,10 +56,10 @@ def scrub(b):
6056
d.write("extern mod extra;\n")
6157
d.write("extern mod run_pass_stage2;\n")
6258
d.write("use run_pass_stage2::*;\n")
63-
d.write("use std::io;\n")
64-
d.write("use std::io::Writer;\n")
65-
d.write("fn main() {\n")
66-
d.write(" let mut out = io::stdout();\n")
59+
d.write("use std::io;\n");
60+
d.write("use std::io::Writer;\n");
61+
d.write("fn main() {\n");
62+
d.write(" let mut out = io::stdout();\n");
6763
i = 0
6864
for t in stage2_tests:
6965
p = os.path.join("test", "run-pass", t)

branches/try/src/librustuv/addrinfo.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,14 @@ pub fn accum_addrinfo(addr: &Addrinfo) -> ~[ai::Info] {
184184
}
185185
}
186186

187-
// cannot give tcp/ip permission without help of apk
188-
#[cfg(test, not(target_os="android"))]
187+
#[cfg(test)]
189188
mod test {
190189
use std::io::net::ip::{SocketAddr, Ipv4Addr};
191190
use super::*;
192191
use super::super::local_loop;
193192

194193
#[test]
194+
#[ignore(cfg(target_os="android"))] // cannot give tcp/ip permission without help of apk
195195
fn getaddrinfo_test() {
196196
match GetAddrInfoRequest::run(local_loop(), Some("localhost"), None, None) {
197197
Ok(infos) => {
@@ -208,12 +208,4 @@ mod test {
208208
Err(e) => fail!("{:?}", e),
209209
}
210210
}
211-
212-
#[test]
213-
fn issue_10663() {
214-
// Something should happen here, but this certainly shouldn't cause
215-
// everything to die. The actual outcome we don't care too much about.
216-
GetAddrInfoRequest::run(local_loop(), Some("irc.n0v4.com"), None,
217-
None);
218-
}
219211
}

branches/try/src/librustuv/net.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,12 @@ pub fn sockaddr_to_socket_addr(addr: *sockaddr) -> SocketAddr {
5959
fail!("unknown address?");
6060
};
6161
let ip_name = {
62-
// apparently there's an off-by-one in libuv?
63-
let ip_size = ip_size + 1;
6462
let buf = vec::from_elem(ip_size + 1 /*null terminated*/, 0u8);
6563
let buf_ptr = vec::raw::to_ptr(buf);
66-
let ret = if uvll::rust_is_ipv4_sockaddr(addr) == 1 {
67-
uvll::uv_ip4_name(addr, buf_ptr as *c_char, ip_size as size_t)
64+
if uvll::rust_is_ipv4_sockaddr(addr) == 1 {
65+
uvll::uv_ip4_name(addr, buf_ptr as *c_char, ip_size as size_t);
6866
} else {
69-
uvll::uv_ip6_name(addr, buf_ptr as *c_char, ip_size as size_t)
70-
};
71-
if ret != 0 {
72-
fail!("error parsing sockaddr: {}", UvError(ret).desc());
67+
uvll::uv_ip6_name(addr, buf_ptr as *c_char, ip_size as size_t);
7368
}
7469
buf
7570
};

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
#[link(name="cci_impl_lib", vers="0.0")];
1212

1313
trait uint_helpers {
14-
fn to(&self, v: uint, f: &fn(uint));
14+
fn to(&self, v: uint, f: |uint|);
1515
}
1616

1717
impl uint_helpers for uint {
1818
#[inline]
19-
fn to(&self, v: uint, f: &fn(uint)) {
19+
fn to(&self, v: uint, f: |uint|) {
2020
let mut i = *self;
2121
while i < v {
2222
f(i);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#[link(name="cci_iter_lib", vers="0.0")];
1212

1313
#[inline]
14-
pub fn iter<T>(v: &[T], f: &fn(&T)) {
14+
pub fn iter<T>(v: &[T], f: |&T|) {
1515
let mut i = 0u;
1616
let n = v.len();
1717
while i < n {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#[link(name="cci_no_inline_lib", vers="0.0")];
1212

1313
// same as cci_iter_lib, more-or-less, but not marked inline
14-
pub fn iter(v: ~[uint], f: &fn(uint)) {
14+
pub fn iter(v: ~[uint], f: |uint|) {
1515
let mut i = 0u;
1616
let n = v.len();
1717
while i < n {

branches/try/src/test/bench/core-map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::trie::TrieMap;
1919
use std::uint;
2020
use std::vec;
2121

22-
fn timed(label: &str, f: &fn()) {
22+
fn timed(label: &str, f: ||) {
2323
let start = time::precise_time_s();
2424
f();
2525
let end = time::precise_time_s();

branches/try/src/test/bench/core-set.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct Results {
2727
delete_strings: f64
2828
}
2929

30-
fn timed(result: &mut f64, op: &fn()) {
30+
fn timed(result: &mut f64, op: ||) {
3131
let start = extra::time::precise_time_s();
3232
op();
3333
let end = extra::time::precise_time_s();
@@ -36,13 +36,12 @@ fn timed(result: &mut f64, op: &fn()) {
3636

3737
impl Results {
3838
pub fn bench_int<T:MutableSet<uint>,
39-
R: rand::Rng>(
40-
&mut self,
41-
rng: &mut R,
42-
num_keys: uint,
43-
rand_cap: uint,
44-
f: &fn() -> T) {
45-
{
39+
R: rand::Rng>(
40+
&mut self,
41+
rng: &mut R,
42+
num_keys: uint,
43+
rand_cap: uint,
44+
f: || -> T) { {
4645
let mut set = f();
4746
do timed(&mut self.sequential_ints) {
4847
for i in range(0u, num_keys) {
@@ -79,11 +78,11 @@ impl Results {
7978
}
8079

8180
pub fn bench_str<T:MutableSet<~str>,
82-
R:rand::Rng>(
83-
&mut self,
84-
rng: &mut R,
85-
num_keys: uint,
86-
f: &fn() -> T) {
81+
R:rand::Rng>(
82+
&mut self,
83+
rng: &mut R,
84+
num_keys: uint,
85+
f: || -> T) {
8786
{
8887
let mut set = f();
8988
do timed(&mut self.sequential_strings) {

branches/try/src/test/bench/core-std.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn main() {
4040
bench!(argv, is_utf8_multibyte);
4141
}
4242

43-
fn maybe_run_test(argv: &[~str], name: ~str, test: &fn()) {
43+
fn maybe_run_test(argv: &[~str], name: ~str, test: ||) {
4444
let mut run_test = false;
4545

4646
if os::getenv("RUST_BENCH").is_some() {

branches/try/src/test/bench/shootout-k-nucleotide-pipes.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ fn update_freq(mm: &mut HashMap<~[u8], uint>, key: &[u8]) {
104104
// given a ~[u8], for each window call a function
105105
// i.e., for "hello" and windows of size four,
106106
// run it("hell") and it("ello"), then return "llo"
107-
fn windows_with_carry(bb: &[u8], nn: uint,
108-
it: &fn(window: &[u8])) -> ~[u8] {
107+
fn windows_with_carry(bb: &[u8], nn: uint, it: |window: &[u8]|) -> ~[u8] {
109108
let mut ii = 0u;
110109

111110
let len = bb.len();

branches/try/src/test/bench/shootout-k-nucleotide.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl Table {
154154
}
155155
}
156156

157-
fn each(&self, f: &fn(entry: &Entry) -> bool) {
157+
fn each(&self, f: |entry: &Entry| -> bool) {
158158
for self.items.each |item| {
159159
match *item {
160160
None => {}

branches/try/src/test/compile-fail/access-mode-in-closures.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
struct sty(~[int]);
1313

14-
fn unpack(_unpack: &fn(v: &sty) -> ~[int]) {}
14+
fn unpack(_unpack: |v: &sty| -> ~[int]) {}
1515

1616
fn main() {
1717
let _foo = unpack(|s| {

branches/try/src/test/compile-fail/block-coerce-no-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn main() {
1515
fn f(f: extern fn(extern fn(extern fn()))) {
1616
}
1717

18-
fn g(f: extern fn(&fn())) {
18+
fn g(f: extern fn(||)) {
1919
}
2020

2121
f(g);

branches/try/src/test/compile-fail/block-coerce-no.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
// Make sure that fn-to-block coercion isn't incorrectly lifted over
1212
// other tycons.
1313

14-
fn coerce(b: &fn()) -> extern fn() {
15-
fn lol(f: extern fn(v: &fn()) -> extern fn(),
16-
g: &fn()) -> extern fn() { return f(g); }
14+
fn coerce(b: ||) -> extern fn() {
15+
fn lol(f: extern fn(v: ||) -> extern fn(),
16+
g: ||) -> extern fn() { return f(g); }
1717
fn fn_id(f: extern fn()) -> extern fn() { return f }
1818
return lol(fn_id, b);
1919
//~^ ERROR mismatched types

branches/try/src/test/compile-fail/borrowck-assign-comp-idx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn a() {
2424
info!("{}", *q);
2525
}
2626

27-
fn borrow(_x: &[int], _f: &fn()) {}
27+
fn borrow(_x: &[int], _f: ||) {}
2828

2929
fn b() {
3030
// here we alias the mutable vector into an imm slice and try to

branches/try/src/test/compile-fail/borrowck-autoref-3261.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
struct X(Either<(uint,uint),extern fn()>);
1212

1313
impl X {
14-
pub fn with(&self, blk: &fn(x: &Either<(uint,uint),extern fn()>)) {
14+
pub fn with(&self, blk: |x: &Either<(uint,uint),extern fn()>|) {
1515
blk(&**self)
1616
}
1717
}

branches/try/src/test/compile-fail/borrowck-insert-during-each.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct Foo {
1515
}
1616

1717
impl Foo {
18-
pub fn foo(&mut self, fun: &fn(&int)) {
18+
pub fn foo(&mut self, fun: |&int|) {
1919
for f in self.n.iter() {
2020
fun(f);
2121
}

branches/try/src/test/compile-fail/borrowck-lend-flow-if.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
fn borrow(_v: &int) {}
1818
fn borrow_mut(_v: &mut int) {}
1919
fn cond() -> bool { fail!() }
20-
fn for_func(_f: &fn() -> bool) { fail!() }
20+
fn for_func(_f: || -> bool) { fail!() }
2121
fn produce<T>() -> T { fail!(); }
2222

2323
fn inc(v: &mut ~int) {

branches/try/src/test/compile-fail/borrowck-lend-flow-loop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ fn while_aliased_mut_cond(cond: bool, cond2: bool) {
111111
}
112112
}
113113

114-
fn loop_break_pops_scopes<'r>(_v: &'r mut [uint], f: &fn(&'r mut uint) -> bool) {
114+
fn loop_break_pops_scopes<'r>(_v: &'r mut [uint], f: |&'r mut uint| -> bool) {
115115
// Here we check that when you break out of an inner loop, the
116116
// borrows that go out of scope as you exit the inner loop are
117117
// removed from the bitset.
@@ -127,7 +127,7 @@ fn loop_break_pops_scopes<'r>(_v: &'r mut [uint], f: &fn(&'r mut uint) -> bool)
127127
}
128128
}
129129

130-
fn loop_loop_pops_scopes<'r>(_v: &'r mut [uint], f: &fn(&'r mut uint) -> bool) {
130+
fn loop_loop_pops_scopes<'r>(_v: &'r mut [uint], f: |&'r mut uint| -> bool) {
131131
// Similar to `loop_break_pops_scopes` but for the `loop` keyword
132132

133133
while cond() {

branches/try/src/test/compile-fail/borrowck-lend-flow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
fn borrow(_v: &int) {}
1818
fn borrow_mut(_v: &mut int) {}
1919
fn cond() -> bool { fail!() }
20-
fn for_func(_f: &fn() -> bool) { fail!() }
20+
fn for_func(_f: || -> bool) { fail!() }
2121
fn produce<T>() -> T { fail!(); }
2222

2323
fn inc(v: &mut ~int) {

branches/try/src/test/compile-fail/borrowck-loan-blocks-move-cc.rs

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

1111
use std::task;
1212

13-
fn borrow(v: &int, f: &fn(x: &int)) {
13+
fn borrow(v: &int, f: |x: &int|) {
1414
f(v);
1515
}
1616

branches/try/src/test/compile-fail/borrowck-loan-blocks-mut-uniq.rs

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

11-
fn borrow(v: &int, f: &fn(x: &int)) {
11+
fn borrow(v: &int, f: |x: &int|) {
1212
f(v);
1313
}
1414

branches/try/src/test/compile-fail/borrowck-loan-rcvr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ struct point { x: int, y: int }
1212

1313
trait methods {
1414
fn impurem(&self);
15-
fn blockm(&self, f: &fn());
15+
fn blockm(&self, f: ||);
1616
}
1717

1818
impl methods for point {
1919
fn impurem(&self) {
2020
}
2121

22-
fn blockm(&self, f: &fn()) { f() }
22+
fn blockm(&self, f: ||) { f() }
2323
}
2424

2525
fn a() {

branches/try/src/test/compile-fail/borrowck-loan-vec-content.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// (locally rooted) mutable, unique vector, and that we then prevent
1313
// modifications to the contents.
1414

15-
fn takes_imm_elt(_v: &int, f: &fn()) {
15+
fn takes_imm_elt(_v: &int, f: ||) {
1616
f();
1717
}
1818

branches/try/src/test/compile-fail/borrowck-move-in-irrefut-pat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
fn with(f: &fn(&~str)) {}
1+
fn with(f: |&~str|) {}
22

33
fn arg_item(&_x: &~str) {}
44
//~^ ERROR cannot move out of dereference of & pointer

branches/try/src/test/compile-fail/closure-bounds-not-builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
trait Foo {}
33

4-
fn take(f: &fn:Foo()) {
4+
fn take(f: ||:Foo) {
55
//~^ ERROR only the builtin traits can be used as closure or object bounds
66
}
77

0 commit comments

Comments
 (0)