Skip to content

Commit 8fc4fda

Browse files
committed
---
yaml --- r: 146861 b: refs/heads/try2 c: 6801bc8 h: refs/heads/master i: 146859: af4f4cf v: v3
1 parent 13e9f5c commit 8fc4fda

File tree

16 files changed

+33
-24
lines changed

16 files changed

+33
-24
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: 9e610573ba285619c9a59d8c1468624b6428492c
8+
refs/heads/try2: 6801bc8f552ce740deb60212903ba43de197689c
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/compiletest/compiletest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ pub fn is_test(config: &config, testfile: &Path) -> bool {
301301
return valid;
302302
}
303303

304-
pub fn make_test(config: &config, testfile: &Path,
305-
f: &fn()->test::TestFn) -> test::TestDescAndFn {
304+
pub fn make_test(config: &config, testfile: &Path, f: || -> test::TestFn)
305+
-> test::TestDescAndFn {
306306
test::TestDescAndFn {
307307
desc: test::TestDesc {
308308
name: make_test_name(config, testfile),

branches/try2/src/compiletest/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub fn is_test_ignored(config: &config, testfile: &Path) -> bool {
102102
!val
103103
}
104104

105-
fn iter_header(testfile: &Path, it: &fn(&str) -> bool) -> bool {
105+
fn iter_header(testfile: &Path, it: |&str| -> bool) -> bool {
106106
use std::io::buffered::BufferedReader;
107107
use std::io::File;
108108

branches/try2/src/compiletest/runtest.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,9 +730,12 @@ fn compose_and_run(config: &config, testfile: &Path,
730730
prog, args, procenv, input);
731731
}
732732
733-
fn make_compile_args(config: &config, props: &TestProps, extras: ~[~str],
734-
xform: &fn(&config, (&Path)) -> Path,
735-
testfile: &Path) -> ProcArgs {
733+
fn make_compile_args(config: &config,
734+
props: &TestProps,
735+
extras: ~[~str],
736+
xform: |&config, &Path| -> Path,
737+
testfile: &Path)
738+
-> ProcArgs {
736739
let xform_file = xform(config, testfile);
737740
// FIXME (#9639): This needs to handle non-utf8 paths
738741
let mut args = ~[testfile.as_str().unwrap().to_owned(),

branches/try2/src/librustuv/addrinfo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl Drop for Addrinfo {
120120
}
121121
}
122122

123-
fn each_ai_flag(_f: &fn(c_int, ai::Flag)) {
123+
fn each_ai_flag(_f: |c_int, ai::Flag|) {
124124
/* XXX: do we really want to support these?
125125
unsafe {
126126
f(uvll::rust_AI_ADDRCONFIG(), ai::AddrConfig);

branches/try2/src/librustuv/file.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ impl Drop for FsRequest {
294294
}
295295
}
296296

297-
fn execute(f: &fn(*uvll::uv_fs_t, uvll::uv_fs_cb) -> c_int)
297+
fn execute(f: |*uvll::uv_fs_t, uvll::uv_fs_cb| -> c_int)
298298
-> Result<FsRequest, UvError>
299299
{
300300
let mut req = FsRequest {
@@ -326,9 +326,8 @@ fn execute(f: &fn(*uvll::uv_fs_t, uvll::uv_fs_cb) -> c_int)
326326
}
327327
}
328328

329-
fn execute_nop(f: &fn(*uvll::uv_fs_t, uvll::uv_fs_cb) -> c_int)
330-
-> Result<(), UvError>
331-
{
329+
fn execute_nop(f: |*uvll::uv_fs_t, uvll::uv_fs_cb| -> c_int)
330+
-> Result<(), UvError> {
332331
execute(f).map(|_| {})
333332
}
334333

branches/try2/src/librustuv/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ impl Drop for ForbidUnwind {
196196
}
197197
}
198198

199-
fn wait_until_woken_after(slot: *mut Option<BlockedTask>, f: &fn()) {
199+
fn wait_until_woken_after(slot: *mut Option<BlockedTask>, f: ||) {
200200
let _f = ForbidUnwind::new("wait_until_woken_after");
201201
unsafe {
202202
assert!((*slot).is_none());

branches/try2/src/librustuv/net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use uvll::sockaddr;
3434
/// Generic functions related to dealing with sockaddr things
3535
////////////////////////////////////////////////////////////////////////////////
3636

37-
fn socket_addr_as_sockaddr<T>(addr: SocketAddr, f: &fn(*sockaddr) -> T) -> T {
37+
fn socket_addr_as_sockaddr<T>(addr: SocketAddr, f: |*sockaddr| -> T) -> T {
3838
let malloc = match addr.ip {
3939
Ipv4Addr(*) => uvll::rust_malloc_ip4_addr,
4040
Ipv6Addr(*) => uvll::rust_malloc_ip6_addr,

branches/try2/src/librustuv/process.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ unsafe fn set_stdio(dst: *uvll::uv_stdio_container_t,
148148
}
149149

150150
/// Converts the program and arguments to the argv array expected by libuv
151-
fn with_argv<T>(prog: &str, args: &[~str], f: &fn(**libc::c_char) -> T) -> T {
151+
fn with_argv<T>(prog: &str, args: &[~str], f: |**libc::c_char| -> T) -> T {
152152
// First, allocation space to put all the C-strings (we need to have
153153
// ownership of them somewhere
154154
let mut c_strs = vec::with_capacity(args.len() + 1);
@@ -167,7 +167,7 @@ fn with_argv<T>(prog: &str, args: &[~str], f: &fn(**libc::c_char) -> T) -> T {
167167
}
168168

169169
/// Converts the environment to the env array expected by libuv
170-
fn with_env<T>(env: Option<&[(~str, ~str)]>, f: &fn(**libc::c_char) -> T) -> T {
170+
fn with_env<T>(env: Option<&[(~str, ~str)]>, f: |**libc::c_char| -> T) -> T {
171171
let env = match env {
172172
Some(s) => s,
173173
None => { return f(ptr::null()); }

branches/try2/src/librustuv/uvio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl EventLoop for UvEventLoop {
161161
~AsyncWatcher::new(self.uvio.uv_loop(), f) as ~RemoteCallback
162162
}
163163

164-
fn io<'a>(&'a mut self, f: &fn(&'a mut IoFactory)) {
164+
fn io<'a>(&'a mut self, f: |&'a mut IoFactory|) {
165165
f(&mut self.uvio as &mut IoFactory)
166166
}
167167
}

branches/try2/src/libsyntax/parse/obsolete.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ pub enum ObsoleteSyntax {
4343
ObsoleteStructWildcard,
4444
ObsoleteVecDotDotWildcard,
4545
ObsoleteBoxedClosure,
46+
ObsoleteClosureType,
4647
}
4748

4849
impl to_bytes::IterBytes for ObsoleteSyntax {
@@ -134,6 +135,11 @@ impl ParserObsoleteMethods for Parser {
134135
"managed closures have been removed and owned closures are \
135136
now written `proc()`"
136137
),
138+
ObsoleteClosureType => (
139+
"closure type",
140+
"closures are now written `|A| -> B` rather than `&fn(A) -> \
141+
B`."
142+
),
137143
};
138144

139145
self.report(sp, kind, kind_str, desc);

branches/try2/src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,7 @@ impl Parser {
12861286
return self.parse_ty_closure(Some(sigil), Some(lifetime));
12871287
}
12881288

1289-
token::IDENT(*) if sigil == ast::BorrowedSigil => {
1289+
token::IDENT(*) => {
12901290
if self.token_is_old_style_closure_keyword() {
12911291
self.obsolete(*self.last_span, ObsoleteBoxedClosure);
12921292
return self.parse_ty_closure(Some(sigil), None);
@@ -1311,6 +1311,7 @@ impl Parser {
13111311
let opt_lifetime = self.parse_opt_lifetime();
13121312

13131313
if self.token_is_old_style_closure_keyword() {
1314+
self.obsolete(*self.last_span, ObsoleteClosureType);
13141315
return self.parse_ty_closure(Some(BorrowedSigil), opt_lifetime);
13151316
}
13161317

branches/try2/src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
// except according to those terms.
1010

1111
struct X {
12-
field: &'static fn:Send(),
12+
field: 'static ||:Send,
1313
}
1414

15-
fn foo(blk: &'static fn:()) -> X {
15+
fn foo(blk: 'static ||:) -> X {
1616
return X { field: blk }; //~ ERROR expected bounds `Send` but found no bounds
1717
}
1818

branches/try2/src/test/compile-fail/once-cant-call-twice-on-stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ extern mod extra;
1616
use extra::arc;
1717
use std::util;
1818

19-
fn foo(blk: &once fn()) {
19+
fn foo(blk: once ||) {
2020
blk();
2121
blk(); //~ ERROR use of moved value
2222
}

branches/try2/src/test/compile-fail/once-fn-subtyping.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
#[feature(once_fns)];
1212
fn main() {
13-
let f: &once fn() = ||();
13+
let f: once || = ||();
1414
let g: || = f; //~ ERROR mismatched types
1515
let h: || = ||();
16-
let i: &once fn() = h; // ok
16+
let i: once || = h; // ok
1717
}

branches/try2/src/test/run-pass/once-move-out-on-stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extern mod extra;
1717
use extra::arc;
1818
use std::util;
1919

20-
fn foo(blk: &once fn()) {
20+
fn foo(blk: once ||) {
2121
blk();
2222
}
2323

0 commit comments

Comments
 (0)