]> git.lizzy.rs Git - rust.git/commitdiff
librustc: Convert `~fn()` to `proc()` everywhere.
authorPatrick Walton <pcwalton@mimiga.net>
Tue, 19 Nov 2013 01:40:54 +0000 (17:40 -0800)
committerPatrick Walton <pcwalton@mimiga.net>
Tue, 19 Nov 2013 02:27:31 +0000 (18:27 -0800)
43 files changed:
doc/po/ja/tutorial-tasks.md.po
doc/po/ja/tutorial.md.po
doc/po/tutorial-tasks.md.pot
doc/po/tutorial.md.pot
doc/tutorial-tasks.md
doc/tutorial.md
src/libextra/task_pool.rs
src/librustuv/net.rs
src/test/bench/task-perf-linked-failure.rs
src/test/compile-fail/borrowck-call-sendfn.rs
src/test/compile-fail/borrowck-move-by-capture.rs
src/test/compile-fail/borrowck-move-moved-value-into-closure.rs
src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs
src/test/compile-fail/kindck-nonsendable-1.rs
src/test/compile-fail/kindck-send.rs
src/test/compile-fail/moves-sru-moved-field.rs
src/test/compile-fail/once-cant-move-out-of-non-once-on-heap.rs [deleted file]
src/test/compile-fail/regions-infer-region-in-fn-but-not-type.rs
src/test/debug-info/lexical-scope-in-unique-closure.rs
src/test/debug-info/var-captured-in-sendable-closure.rs
src/test/pretty/fn-types.rs
src/test/run-fail/unwind-box-fn-unique.rs
src/test/run-pass/block-arg-call-as.rs
src/test/run-pass/borrowck-move-by-capture-ok.rs
src/test/run-pass/cap-clause-move.rs
src/test/run-pass/clone-with-exterior.rs
src/test/run-pass/closure-bounds-can-capture-chan.rs
src/test/run-pass/explicit-self-generic.rs
src/test/run-pass/issue-2190-1.rs
src/test/run-pass/issue-2190.rs
src/test/run-pass/issue-3424.rs
src/test/run-pass/issue-3609.rs
src/test/run-pass/issue-6141-leaking-owned-fn.rs [deleted file]
src/test/run-pass/newlambdas-ret-infer.rs
src/test/run-pass/newlambdas-ret-infer2.rs
src/test/run-pass/operator-overloading.rs
src/test/run-pass/sendfn-generic-fn.rs [deleted file]
src/test/run-pass/sendfn-spawn-with-fn-arg.rs
src/test/run-pass/swap-overlapping.rs
src/test/run-pass/task-killjoin-rsrc.rs
src/test/run-pass/tempfile.rs
src/test/run-pass/uniq-cc-generic.rs
src/test/run-pass/uniq-cc.rs

index 9cea63f0d0b5d36ac5fd344ddfa0f85bfac5a62a..2276d0052a643956d297b9d39653be2cb77e77ec 100644 (file)
@@ -213,7 +213,7 @@ msgstr ""
 #. type: Plain text
 #: doc/tutorial-tasks.md:102
 msgid ""
-"The `spawn` function has a very simple type signature: `fn spawn(f: ~fn())`. "
+"The `spawn` function has a very simple type signature: `fn spawn(f: proc())`. "
 "Because it accepts only owned closures, and owned closures contain only "
 "owned data, `spawn` can safely move the entire closure and all its "
 "associated state into an entirely different task for execution. Like any "
index 26dc7bf0db86629a3af10be5ea4df5abc50f1e59..2b4e6e2c148cbd373c1e7cf38660834cf4c562d4 100644 (file)
@@ -3509,13 +3509,13 @@ msgstr "## 所有クロージャ"
 #. type: Plain text
 #: doc/tutorial.md:1510
 msgid ""
-"Owned closures, written `~fn` in analogy to the `~` pointer type, hold on to "
+"Owned closures, written `proc`, hold on to "
 "things that can safely be sent between processes. They copy the values they "
 "close over, much like managed closures, but they also own them: that is, no "
 "other code can access them. Owned closures are used in concurrent code, "
 "particularly for spawning [tasks][tasks]."
 msgstr ""
-"`~` ポインタ型と同様に `~fn` 型  で書き表される所有クロージャは安全にプロセス"
+"`~` `proc` で書き表される所有クロージャは安全にプロセス"
 "間で送信することができます。所有クローじゃはマネージドクロージャと全く同じよ"
 "うに閉じ込める値をコピーしますが、値を所有します。つまり、他のコードは閉じ込"
 "められた値にアクセスできなくなります。所有クロージャは並列プログラム、特に "
@@ -3666,11 +3666,11 @@ msgstr ""
 #: doc/tutorial.md:1582
 msgid ""
 "`do` is a convenient way to create tasks with the `task::spawn` function.  "
-"`spawn` has the signature `spawn(fn: ~fn())`. In other words, it is a "
+"`spawn` has the signature `spawn(fn: proc())`. In other words, it is a "
 "function that takes an owned closure that takes no arguments."
 msgstr ""
 "`task::spawn` 関数を用いてタスクを生成する場合、 `do` を用いると便利です。"
-"`spawn` は、 `spawn(fn: ~fn())` という方を持っています。言い換えると、"
+"`spawn` は、 `spawn(fn: proc())` という方を持っています。言い換えると、"
 "`spawn` は「引数をとらない所有クロージャ」を引数としてとる関数ということで"
 "す。"
 
index 483cde9d7d016cd0824f86679027ab8dd22704f0..7a15fe196923f7070e321ed0d88ecc88fe380b04 100644 (file)
@@ -213,7 +213,7 @@ msgstr ""
 #. type: Plain text
 #: doc/tutorial-tasks.md:102
 msgid ""
-"The `spawn` function has a very simple type signature: `fn spawn(f: ~fn())`. "
+"The `spawn` function has a very simple type signature: `fn spawn(f: proc())`. "
 "Because it accepts only owned closures, and owned closures contain only "
 "owned data, `spawn` can safely move the entire closure and all its "
 "associated state into an entirely different task for execution. Like any "
index a9c93aa6a8ba572281bfb2b30742a570d8f6b287..86937652da93b9de24feeb4fd3c83263c1210d21 100644 (file)
@@ -2683,7 +2683,7 @@ msgstr ""
 #. type: Plain text
 #: doc/tutorial.md:1510
 msgid ""
-"Owned closures, written `~fn` in analogy to the `~` pointer type, hold on to "
+"Owned closures, written `proc`, hold on to "
 "things that can safely be sent between processes. They copy the values they "
 "close over, much like managed closures, but they also own them: that is, no "
 "other code can access them. Owned closures are used in concurrent code, "
@@ -2808,7 +2808,7 @@ msgstr ""
 #: doc/tutorial.md:1582
 msgid ""
 "`do` is a convenient way to create tasks with the `task::spawn` function.  "
-"`spawn` has the signature `spawn(fn: ~fn())`. In other words, it is a "
+"`spawn` has the signature `spawn(fn: proc())`. In other words, it is a "
 "function that takes an owned closure that takes no arguments."
 msgstr ""
 
index adde4ab17e62699e62f01af5b19e91e466d6f104..d357e3b335ebe0ef6b1acfc1c60791f116282b0a 100644 (file)
@@ -91,7 +91,7 @@ _owned types_. The language leaves the implementation details to the standard
 library.
 
 The `spawn` function has a very simple type signature: `fn spawn(f:
-~fn())`. Because it accepts only owned closures, and owned closures
+proc())`. Because it accepts only owned closures, and owned closures
 contain only owned data, `spawn` can safely move the entire closure
 and all its associated state into an entirely different task for
 execution. Like any closure, the function passed to `spawn` may capture
index 1b414c4083440cb82af507b30bbd1447ac7272c2..313d36e38bf7e983d21e23063a4b1899971948ec 100644 (file)
@@ -1409,7 +1409,7 @@ pervasively in Rust code.
 
 ## Owned closures
 
-Owned closures, written `~fn` in analogy to the `~` pointer type,
+Owned closures, written `proc`,
 hold on to things that can safely be sent between
 processes. They copy the values they close over, much like managed
 closures, but they also own them: that is, no other code can access
@@ -1484,7 +1484,7 @@ parentheses, where it looks more like a typical block of
 code.
 
 `do` is a convenient way to create tasks with the `task::spawn`
-function.  `spawn` has the signature `spawn(fn: ~fn())`. In other
+function.  `spawn` has the signature `spawn(fn: proc())`. In other
 words, it is a function that takes an owned closure that takes no
 arguments.
 
index 2ee3daacf80cdb2007b1c87e4517a56c0b88880c..64fb954764a83efed2d3b8c1dbef0987f8ae056e 100644 (file)
@@ -97,7 +97,7 @@ pub fn execute(&mut self, f: proc(&T)) {
 
 #[test]
 fn test_task_pool() {
-    let f: proc() -> proc(uint) -> uint = || {
+    let f: &fn() -> proc(uint) -> uint = || {
         let g: proc(uint) -> uint = |i| i;
         g
     };
index dc6fbcec3f2a466d2a1a5d2df3419b38b75e7ee9..05f708355b0e75f8e7427811ae1a857d8bce9e20 100644 (file)
@@ -1101,7 +1101,7 @@ fn test_simple_homed_udp_io_bind_then_move_task_then_home_and_close() {
             let handle2 = Cell::new(sched2.make_handle());
             let tasksFriendHandle = Cell::new(sched2.make_handle());
 
-            let on_exit: ~fn(UnwindResult) = |exit_status| {
+            let on_exit: proc(UnwindResult) = |exit_status| {
                 handle1.take().send(Shutdown);
                 handle2.take().send(Shutdown);
                 assert!(exit_status.is_success());
@@ -1115,7 +1115,7 @@ unsafe fn local_io() -> &'static mut IoFactory {
                 }
             }
 
-            let test_function: ~fn() = || {
+            let test_function: proc() = || {
                 let io = unsafe { local_io() };
                 let addr = next_test_ip4();
                 let maybe_socket = io.udp_bind(addr);
index 54a05c7257e830a06ae0bf97279eaf43f9dd56cf..73ecd33bc7ca92c6b71ca7a908cdc2e7dea74c4b 100644 (file)
@@ -53,7 +53,7 @@ fn grandchild_group(num_tasks: uint) {
     // Master grandchild task exits early.
 }
 
-fn spawn_supervised_blocking(myname: &str, f: ~fn()) {
+fn spawn_supervised_blocking(myname: &str, f: proc()) {
     let mut builder = task::task();
     let res = builder.future_result();
     builder.supervised();
index 8dc86c9a1631001c409c070ca119f60cca3e181a..42dee384116c97cbf6dff28c8772de033b7eeb74 100644 (file)
@@ -11,7 +11,7 @@
 // xfail-test #2978
 
 struct Foo {
-    f: ~fn()
+    f: proc()
 }
 
 fn call(x: @Foo) {
index 5994b9e85d5ae97e6a3021fb012c384f6ada4d62..aa50f9ac3fee0df2d85c9e3c20eea2604e1508a5 100644 (file)
@@ -1,13 +1,8 @@
 pub fn main() {
-    let foo = ~3;
-    let _pfoo = &foo;
-    let _f: ~fn() -> int = || *foo + 5;
-    //~^ ERROR cannot move `foo`
-
     // FIXME(#2202) - Due to the way that borrowck treats closures,
     // you get two error reports here.
     let bar = ~3;
     let _g = || { //~ ERROR capture of moved value
-        let _h: ~fn() -> int = || *bar; //~ ERROR capture of moved value
+        let _h: proc() -> int = || *bar; //~ ERROR capture of moved value
     };
 }
index 5e789e99c0559a30411ebce4a7a6b7c08157e599..b6ad3ed95a4b4745eca0d9c1aa4d2b9ef0f8fc39 100644 (file)
@@ -1,4 +1,4 @@
-fn call_f(f: ~fn:Send() -> int) -> int {
+fn call_f(f: proc() -> int) -> int {
     f()
 }
 
index 525f8f4a932b17a50ffd96978e6531d79d6d31e7..00eb31485b9d7af4bc367fd95a9e7e89187d2a13 100644 (file)
@@ -9,10 +9,10 @@
 // except according to those terms.
 
 struct X {
-    field: ~fn:Send(),
+    field: &'static fn:Send(),
 }
 
-fn foo(blk: ~fn:()) -> X {
+fn foo(blk: &'static fn:()) -> X {
     return X { field: blk }; //~ ERROR expected bounds `Send` but found no bounds
 }
 
index 4472f042242ac488df1e79f805242153b831f103..308eb637cd0b98f9de12cd30f0d46ed282ed5589 100644 (file)
@@ -14,7 +14,7 @@ fn foo(_x: @uint) {}
 
 fn main() {
     let x = @3u;
-    let _: ~fn() = || foo(x); //~ ERROR does not fulfill `Send`
-    let _: ~fn() = || foo(x); //~ ERROR does not fulfill `Send`
-    let _: ~fn() = || foo(x); //~ ERROR does not fulfill `Send`
+    let _: proc() = || foo(x); //~ ERROR does not fulfill `Send`
+    let _: proc() = || foo(x); //~ ERROR does not fulfill `Send`
+    let _: proc() = || foo(x); //~ ERROR does not fulfill `Send`
 }
index bb5851ac5c8f1195a511d90159425136910eacd5..bfef15ea1731c35e866258a0c62bed21e3e222e4 100644 (file)
@@ -47,7 +47,7 @@ fn test<'a,T,U:Send>(_: &'a int) {
 
     // but closure and object types can have lifetime bounds which make
     // them not ok (FIXME #5121)
-    // assert_send::<~fn:'a()>(); // ERROR does not fulfill `Send`
+    // assert_send::<proc:'a()>(); // ERROR does not fulfill `Send`
     // assert_send::<~Dummy:'a>(); // ERROR does not fulfill `Send`
 
     // unsafe ptrs are ok unless they point at unsendable things
index 660e5596ca55202df70be69a40466ae0bcd963d0..57c1cb5ecc640ea2ace4ef731c1749d68d4617cf 100644 (file)
@@ -1,4 +1,4 @@
-type Noncopyable = ~fn();
+type Noncopyable = proc();
 
 struct Foo {
     copied: int,
diff --git a/src/test/compile-fail/once-cant-move-out-of-non-once-on-heap.rs b/src/test/compile-fail/once-cant-move-out-of-non-once-on-heap.rs
deleted file mode 100644 (file)
index cc40fb6..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Testing guarantees provided by once functions.
-// This program would segfault if it were legal.
-
-extern mod extra;
-use extra::arc;
-use std::util;
-
-fn foo(blk: ~fn()) {
-    blk();
-    blk();
-}
-
-fn main() {
-    let x = arc::Arc::new(true);
-    do foo {
-        assert!(*x.get());
-        util::ignore(x); //~ ERROR cannot move out of captured outer variable
-    }
-}
index 5c979955ec9ae4fdab6282a1232292170b27c91a..a743ff81b301a34c2008cae5fced5e88967b8810 100644 (file)
@@ -11,7 +11,7 @@
 
 // check that the &int here does not cause us to think that `foo`
 // contains region pointers
-struct foo(~fn(x: &int));
+struct foo(proc(x: &int));
 
 fn take_foo(x: foo<'static>) {} //~ ERROR wrong number of lifetime parameters
 
index 63a223a330bfba80f5e4cfa144ab6cde2be09a8e..da9220322dd74f2776c96fb594782acd1c2a781e 100644 (file)
@@ -51,7 +51,7 @@ fn main() {
     zzz();
     sentinel();
 
-    let unique_closure: ~fn(int) = |x| {
+    let unique_closure: proc(int) = |x| {
         zzz();
         sentinel();
 
index efc93d135a28c6770aeb48eca542b90ec3947a47..664e377c9fbe99e4692c147f84ae53c7dfc80299 100644 (file)
@@ -39,7 +39,7 @@ fn main() {
 
     let owned = ~5;
 
-    let closure: ~fn() = || {
+    let closure: proc() = || {
         zzz();
         do_something(&constant, &a_struct.a, owned);
     };
index 27e56fb6074a1a6d62583e3853994e7a24c26dd4..ffa6f03909b023a07eb3fabf491b41c96934b943 100644 (file)
@@ -12,5 +12,5 @@
 
 fn from_foreign_fn(_x: fn()) { }
 fn from_stack_closure(_x: ||) { }
-fn from_unique_closure(_x: ~fn()) { }
+fn from_unique_closure(_x: proc()) { }
 fn main() { }
index 1f1b57aa7048ab97a6585b8821be7d78bcae5e34..b28a2a6f1f0323eb822a9096f52b16823e63fc93 100644 (file)
@@ -18,7 +18,7 @@ fn failfn() {
 
 fn main() {
     let y = ~0;
-    let x: @~fn() = @(|| {
+    let x: @proc() = @(|| {
         error!("{:?}", y.clone());
     });
     failfn();
index 6a59278982ad3fddbe30930bdf194b5900df4641..5aa28258792e682f963e1fdbbe1aedc415d105bf 100644 (file)
@@ -10,7 +10,7 @@
 
 extern mod extra;
 
-fn asSendfn( f : ~fn()->uint ) -> uint {
+fn asSendfn( f : proc()->uint ) -> uint {
    return f();
 }
 
index f6328c8c65822cd8eb8ff0d574601076ce281d0d..2f186cc3fba304503d00fd249f62e18c501bae4e 100644 (file)
@@ -1,5 +1,5 @@
 pub fn main() {
     let bar = ~3;
-    let h: ~fn() -> int = || *bar;
+    let h: proc() -> int = || *bar;
     assert_eq!(h(), 3);
 }
index 64be8dab6e7021be8904b75de0e80a0b43da13ed..c6227fdcc5effe196ac79f056ff4b0b09e85d468 100644 (file)
 pub fn main() {
     let x = ~3;
     let y = ptr::to_unsafe_ptr(&(*x)) as uint;
-    let snd_move: ~fn() -> uint = || ptr::to_unsafe_ptr(&(*x)) as uint;
+    let snd_move: proc() -> uint = || ptr::to_unsafe_ptr(&(*x)) as uint;
     assert_eq!(snd_move(), y);
 
     let x = ~4;
     let y = ptr::to_unsafe_ptr(&(*x)) as uint;
-    let lam_move: ~fn() -> uint = || ptr::to_unsafe_ptr(&(*x)) as uint;
+    let lam_move: proc() -> uint = || ptr::to_unsafe_ptr(&(*x)) as uint;
     assert_eq!(lam_move(), y);
 }
index f6a7856dccccfdcc3a5472749a1d312c756ca391..cceb0f353fb3a60cee3e9e23b075883929a3f2de 100644 (file)
@@ -19,7 +19,7 @@ struct Pair {
 pub fn main() {
     let z = ~Pair { a : 10, b : 12};
 
-    let f: ~fn() = || {
+    let f: proc() = || {
         assert_eq!(z.a, 10);
         assert_eq!(z.b, 12);
     };
index d35d6d9f07e4e627aeeb14d2ff729c9ea597ac2c..16c7eaf1037fddc28a7831047214f5bbf11cc59b 100644 (file)
@@ -10,7 +10,7 @@
 
 use std::comm;
 
-fn foo(blk: ~fn:Send()) {
+fn foo(blk: proc()) {
     blk();
 }
 
index 80e16af922847da1ce8cbf4a563d72ecffaec341..023381949a3577f1316a1e4ce9b3574f0b94b868 100644 (file)
@@ -15,8 +15,8 @@
  *
  * The hash should concentrate entropy in the lower bits.
  */
-type HashFn<K> = ~fn(K) -> uint;
-type EqFn<K> = ~fn(K, K) -> bool;
+type HashFn<K> = proc(K) -> uint;
+type EqFn<K> = proc(K, K) -> bool;
 
 struct LM { resize_at: uint, size: uint }
 
index f3a81771c213711f7c7303b4516ef3ed1cdd22e3..0aaaa58fdd257fd337d306e8519f314c879f067a 100644 (file)
@@ -11,7 +11,7 @@
 // xfail-test
 static generations: uint = 1024+256+128+49;
 
-fn child_no(x: uint) -> ~fn() {
+fn child_no(x: uint) -> proc() {
      || {
         if x < generations {
             task::spawn(child_no(x+1));
index 05869952fb8b55afff1ba9c9a9f14baf7cba6b45..aeb4aad7d8315e266061618347198320de149313 100644 (file)
@@ -10,7 +10,7 @@
 
 // xfail-test
 type t = {
-    f: ~fn()
+    f: proc()
 };
 
 pub fn main() {
index f860426ffd270a44bfa44805a8493abf3e3bea45..0b8fcdfbd84946ac675406176ba16e37c6cff70b 100644 (file)
@@ -17,7 +17,7 @@
 use std::path;
 use std::result;
 
-type rsrc_loader = ~fn(path: &Path) -> result::Result<~str, ~str>;
+type rsrc_loader = proc(path: &Path) -> result::Result<~str, ~str>;
 
 fn tester()
 {
index 8ed70a7ee32d25cefb64a56ecf6ea4ab9ca553c9..b283ba67d59bd13604d451493e2d5f96e40405e9 100644 (file)
@@ -4,7 +4,7 @@
 use std::task;
 
 type RingBuffer = ~[f64];
-type SamplesFn = ~fn(samples: &RingBuffer);
+type SamplesFn = proc(samples: &RingBuffer);
 
 enum Msg
 {
diff --git a/src/test/run-pass/issue-6141-leaking-owned-fn.rs b/src/test/run-pass/issue-6141-leaking-owned-fn.rs
deleted file mode 100644 (file)
index 98d2ca5..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-fn run(f: &fn()) {
-    f()
-}
-
-pub fn main() {
-    let f: ~fn() = || ();
-    run(f);
-}
index 6d6757890ad3e6e0d8af6dc9c2399b4626e840e0..e5844785a50f96c41729b988cec46ad227fa350f 100644 (file)
@@ -11,7 +11,7 @@
 // Test that the lambda kind is inferred correctly as a return
 // expression
 
-fn unique() -> ~fn() { return || (); }
+fn unique() -> proc() { return || (); }
 
 pub fn main() {
 }
index 17ff8ce94d90ff1841bbe694186bd97bca788528..ccf1997498be11e9ee9491d6ffd5806086bed5fe 100644 (file)
@@ -11,7 +11,7 @@
 // Test that the lambda kind is inferred correctly as a return
 // expression
 
-fn unique() -> ~fn() { || () }
+fn unique() -> proc() { || () }
 
 pub fn main() {
 }
index 05aa1e7460839a0b08b4c53278e3ef6a2efa1382..5dd8ea96d3738a405a35221774aaad7ecff4c0e5 100644 (file)
@@ -69,6 +69,6 @@ pub fn main() {
     assert_eq!(q.y, !(p.y));
 
     // Issue #1733
-    let result: ~fn(int) = |_|();
+    let result: proc(int) = |_|();
     result(p[true]);
 }
diff --git a/src/test/run-pass/sendfn-generic-fn.rs b/src/test/run-pass/sendfn-generic-fn.rs
deleted file mode 100644 (file)
index d077db6..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// xfail-fast
-
-use std::task;
-
-pub fn main() { test05(); }
-
-#[deriving(Clone)]
-struct Pair<A,B> {
-    a: A,
-    b: B,
-}
-
-fn make_generic_record<A,B>(a: A, b: B) -> Pair<A,B> {
-    return Pair {a: a, b: b};
-}
-
-fn test05_start(f: &~fn(v: f64, v: ~str) -> Pair<f64, ~str>) {
-    let p = (*f)(22.22, ~"Hi");
-    info!("{:?}", p.clone());
-    assert!(p.a == 22.22);
-    assert!(p.b == ~"Hi");
-
-    let q = (*f)(44.44, ~"Ho");
-    info!("{:?}", q.clone());
-    assert!(q.a == 44.44);
-    assert!(q.b == ~"Ho");
-}
-
-fn spawn<A,B>(f: extern fn(&~fn(A,B)->Pair<A,B>)) {
-    let arg: ~fn(A, B) -> Pair<A,B> = |a, b| make_generic_record(a, b);
-    task::spawn(|| f(&arg));
-}
-
-fn test05() {
-    spawn::<f64,~str>(test05_start);
-}
index ecf1830864cd125a0d9dd0c113b2108f273d9f10..91bc8345845d96a0f258626dd2d9072dadd22924 100644 (file)
 
 pub fn main() { test05(); }
 
-fn test05_start(f: ~fn(int)) {
+fn test05_start(f: proc(int)) {
     f(22);
 }
 
 fn test05() {
     let three = ~3;
-    let fn_to_send: ~fn(int) = |n| {
+    let fn_to_send: proc(int) = |n| {
         error!("{}", *three + n); // will copy x into the closure
         assert_eq!(*three, 3);
     };
index 5349d0554b1b76811d6d8c68316afd72737538be..986a9a8c49c31b85b368e3d3d9d14808062ac005 100644 (file)
@@ -34,8 +34,8 @@ pub enum TestName {
 }
 
 pub enum TestFn {
-    DynTestFn(~fn()),
-    DynBenchFn(~fn(&mut int))
+    DynTestFn(proc()),
+    DynBenchFn(proc(&mut int))
 }
 
 pub struct TestDesc {
index 10116e569467cc344e65ea7a5e7401ea5dcaf1ce..395d6b0b51ad2559da63f417a2d5899670216393 100644 (file)
@@ -44,7 +44,7 @@ fn notify(ch: Chan<bool>, v: @mut bool) -> notify {
     }
 }
 
-fn joinable(f: ~fn()) -> Port<bool> {
+fn joinable(f: proc()) -> Port<bool> {
     fn wrapper(c: Chan<bool>, f: &fn()) {
         let b = @mut false;
         error!("wrapper: task=%? allocated v=%x",
index e8e3d337838de2252d9b3a47b1635b9ae9c8549a..a10753451400a6cc9e4c3509f468c9794d1b3a40 100644 (file)
@@ -40,7 +40,7 @@ fn test_tempdir() {
 
 fn test_rm_tempdir() {
     let (rd, wr) = stream();
-    let f: ~fn() = || {
+    let f: proc() = || {
         let tmp = TempDir::new("test_rm_tempdir").unwrap();
         wr.send(tmp.path().clone());
         fail!("fail to unwind past `tmp`");
@@ -52,7 +52,7 @@ fn test_rm_tempdir() {
     let tmp = TempDir::new("test_rm_tempdir").unwrap();
     let path = tmp.path().clone();
     let cell = Cell::new(tmp);
-    let f: ~fn() = || {
+    let f: proc() = || {
         let _tmp = cell.take();
         fail!("fail to unwind past `tmp`");
     };
@@ -61,7 +61,7 @@ fn test_rm_tempdir() {
 
     let path;
     {
-        let f: ~fn() -> TempDir = || {
+        let f: proc() -> TempDir = || {
             TempDir::new("test_rm_tempdir").unwrap()
         };
         let tmp = task::try(f).expect("test_rm_tmdir");
index f9a8efe5701d3f188b9ef13d1121ed4926f8aba6..ada3607beaef577d5766b8488b4003355fc04541 100644 (file)
@@ -19,11 +19,11 @@ enum maybe_pointy {
 
 struct Pointy {
     a : maybe_pointy,
-    d : ~fn() -> uint,
+    d : proc() -> uint,
 }
 
-fn make_uniq_closure<A:Send>(a: A) -> ~fn() -> uint {
-    let result: ~fn() -> uint = || ptr::to_unsafe_ptr(&a) as uint;
+fn make_uniq_closure<A:Send>(a: A) -> proc() -> uint {
+    let result: proc() -> uint = || ptr::to_unsafe_ptr(&a) as uint;
     result
 }
 
index e08d3965b17b28a01a95d88b59742b161adf167a..fc58374d46d6128cdb2e7ef47bacbac780c5f1ef 100644 (file)
@@ -18,7 +18,7 @@ enum maybe_pointy {
 struct Pointy {
     a : maybe_pointy,
     c : ~int,
-    d : ~fn()->(),
+    d : proc()->(),
 }
 
 fn empty_pointy() -> @mut Pointy {