Skip to content

Commit 6fed7e2

Browse files
committed
---
yaml --- r: 93765 b: refs/heads/try c: 68d5510 h: refs/heads/master i: 93763: 4e6304a v: v3
1 parent ce9a34a commit 6fed7e2

File tree

95 files changed

+1363
-1060
lines changed

Some content is hidden

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

95 files changed

+1363
-1060
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: d57765d8a9d5c1136b914d0d3a073d44882f4ba9
5+
refs/heads/try: 68d5510292ed2f9714568285759ca9ef54d9b48c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/doc/po/ja/tutorial-tasks.md.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ msgstr ""
213213
#. type: Plain text
214214
#: doc/tutorial-tasks.md:102
215215
msgid ""
216-
"The `spawn` function has a very simple type signature: `fn spawn(f: proc())`. "
216+
"The `spawn` function has a very simple type signature: `fn spawn(f: ~fn())`. "
217217
"Because it accepts only owned closures, and owned closures contain only "
218218
"owned data, `spawn` can safely move the entire closure and all its "
219219
"associated state into an entirely different task for execution. Like any "

branches/try/doc/po/ja/tutorial.md.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3509,13 +3509,13 @@ msgstr "## 所有クロージャ"
35093509
#. type: Plain text
35103510
#: doc/tutorial.md:1510
35113511
msgid ""
3512-
"Owned closures, written `proc`, hold on to "
3512+
"Owned closures, written `~fn` in analogy to the `~` pointer type, hold on to "
35133513
"things that can safely be sent between processes. They copy the values they "
35143514
"close over, much like managed closures, but they also own them: that is, no "
35153515
"other code can access them. Owned closures are used in concurrent code, "
35163516
"particularly for spawning [tasks][tasks]."
35173517
msgstr ""
3518-
"`~` `proc` で書き表される所有クロージャは安全にプロセス"
3518+
"`~` ポインタ型と同様に `~fn` 型 で書き表される所有クロージャは安全にプロセス"
35193519
"間で送信することができます。所有クローじゃはマネージドクロージャと全く同じよ"
35203520
"うに閉じ込める値をコピーしますが、値を所有します。つまり、他のコードは閉じ込"
35213521
"められた値にアクセスできなくなります。所有クロージャは並列プログラム、特に "
@@ -3666,11 +3666,11 @@ msgstr ""
36663666
#: doc/tutorial.md:1582
36673667
msgid ""
36683668
"`do` is a convenient way to create tasks with the `task::spawn` function. "
3669-
"`spawn` has the signature `spawn(fn: proc())`. In other words, it is a "
3669+
"`spawn` has the signature `spawn(fn: ~fn())`. In other words, it is a "
36703670
"function that takes an owned closure that takes no arguments."
36713671
msgstr ""
36723672
"`task::spawn` 関数を用いてタスクを生成する場合、 `do` を用いると便利です。"
3673-
"`spawn` は、 `spawn(fn: proc())` という方を持っています。言い換えると、"
3673+
"`spawn` は、 `spawn(fn: ~fn())` という方を持っています。言い換えると、"
36743674
"`spawn` は「引数をとらない所有クロージャ」を引数としてとる関数ということで"
36753675
"す。"
36763676

branches/try/doc/po/tutorial-tasks.md.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ msgstr ""
213213
#. type: Plain text
214214
#: doc/tutorial-tasks.md:102
215215
msgid ""
216-
"The `spawn` function has a very simple type signature: `fn spawn(f: proc())`. "
216+
"The `spawn` function has a very simple type signature: `fn spawn(f: ~fn())`. "
217217
"Because it accepts only owned closures, and owned closures contain only "
218218
"owned data, `spawn` can safely move the entire closure and all its "
219219
"associated state into an entirely different task for execution. Like any "

branches/try/doc/po/tutorial.md.pot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2683,7 +2683,7 @@ msgstr ""
26832683
#. type: Plain text
26842684
#: doc/tutorial.md:1510
26852685
msgid ""
2686-
"Owned closures, written `proc`, hold on to "
2686+
"Owned closures, written `~fn` in analogy to the `~` pointer type, hold on to "
26872687
"things that can safely be sent between processes. They copy the values they "
26882688
"close over, much like managed closures, but they also own them: that is, no "
26892689
"other code can access them. Owned closures are used in concurrent code, "
@@ -2808,7 +2808,7 @@ msgstr ""
28082808
#: doc/tutorial.md:1582
28092809
msgid ""
28102810
"`do` is a convenient way to create tasks with the `task::spawn` function. "
2811-
"`spawn` has the signature `spawn(fn: proc())`. In other words, it is a "
2811+
"`spawn` has the signature `spawn(fn: ~fn())`. In other words, it is a "
28122812
"function that takes an owned closure that takes no arguments."
28132813
msgstr ""
28142814

branches/try/doc/tutorial-tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ _owned types_. The language leaves the implementation details to the standard
9191
library.
9292

9393
The `spawn` function has a very simple type signature: `fn spawn(f:
94-
proc())`. Because it accepts only owned closures, and owned closures
94+
~fn())`. Because it accepts only owned closures, and owned closures
9595
contain only owned data, `spawn` can safely move the entire closure
9696
and all its associated state into an entirely different task for
9797
execution. Like any closure, the function passed to `spawn` may capture

branches/try/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,7 @@ pervasively in Rust code.
14091409
14101410
## Owned closures
14111411
1412-
Owned closures, written `proc`,
1412+
Owned closures, written `~fn` in analogy to the `~` pointer type,
14131413
hold on to things that can safely be sent between
14141414
processes. They copy the values they close over, much like managed
14151415
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
14841484
code.
14851485
14861486
`do` is a convenient way to create tasks with the `task::spawn`
1487-
function. `spawn` has the signature `spawn(fn: proc())`. In other
1487+
function. `spawn` has the signature `spawn(fn: ~fn())`. In other
14881488
words, it is a function that takes an owned closure that takes no
14891489
arguments.
14901490

branches/try/src/libextra/future.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub struct Future<A> {
3636
}
3737

3838
enum FutureState<A> {
39-
Pending(proc() -> A),
39+
Pending(~fn() -> A),
4040
Evaluating,
4141
Forced(A)
4242
}
@@ -92,7 +92,7 @@ impl<A> Future<A> {
9292
Future {state: Forced(val)}
9393
}
9494

95-
pub fn from_fn(f: proc() -> A) -> Future<A> {
95+
pub fn from_fn(f: ~fn() -> A) -> Future<A> {
9696
/*!
9797
* Create a future from a function.
9898
*
@@ -120,7 +120,7 @@ impl<A:Send> Future<A> {
120120
}
121121
}
122122

123-
pub fn spawn(blk: proc() -> A) -> Future<A> {
123+
pub fn spawn(blk: ~fn() -> A) -> Future<A> {
124124
/*!
125125
* Create a future from a unique closure.
126126
*
@@ -137,7 +137,7 @@ impl<A:Send> Future<A> {
137137
Future::from_port(port)
138138
}
139139

140-
pub fn spawn_with<B: Send>(v: B, blk: proc(B) -> A) -> Future<A> {
140+
pub fn spawn_with<B: Send>(v: B, blk: ~fn(B) -> A) -> Future<A> {
141141
/*!
142142
* Create a future from a unique closure taking one argument.
143143
*

branches/try/src/libextra/task_pool.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use std::vec;
2323
#[cfg(test)] use std::task::SingleThreaded;
2424

2525
enum Msg<T> {
26-
Execute(proc(&T)),
26+
Execute(~fn(&T)),
2727
Quit
2828
}
2929

@@ -49,15 +49,15 @@ impl<T> TaskPool<T> {
4949
/// local data to be kept around in that task.
5050
pub fn new(n_tasks: uint,
5151
opt_sched_mode: Option<SchedMode>,
52-
init_fn_factory: &fn() -> proc(uint) -> T)
52+
init_fn_factory: ~fn() -> ~fn(uint) -> T)
5353
-> TaskPool<T> {
5454
assert!(n_tasks >= 1);
5555

5656
let channels = do vec::from_fn(n_tasks) |i| {
5757
let (port, chan) = comm::stream::<Msg<T>>();
5858
let init_fn = init_fn_factory();
5959

60-
let task_body: proc() = || {
60+
let task_body: ~fn() = || {
6161
let local_data = init_fn(i);
6262
loop {
6363
match port.recv() {
@@ -88,7 +88,7 @@ impl<T> TaskPool<T> {
8888

8989
/// Executes the function `f` on a task in the pool. The function
9090
/// receives a reference to the local data returned by the `init_fn`.
91-
pub fn execute(&mut self, f: proc(&T)) {
91+
pub fn execute(&mut self, f: ~fn(&T)) {
9292
self.channels[self.next_index].send(Execute(f));
9393
self.next_index += 1;
9494
if self.next_index == self.channels.len() { self.next_index = 0; }
@@ -97,8 +97,8 @@ impl<T> TaskPool<T> {
9797

9898
#[test]
9999
fn test_task_pool() {
100-
let f: &fn() -> proc(uint) -> uint = || {
101-
let g: proc(uint) -> uint = |i| i;
100+
let f: ~fn() -> ~fn(uint) -> uint = || {
101+
let g: ~fn(uint) -> uint = |i| i;
102102
g
103103
};
104104
let mut pool = TaskPool::new(4, Some(SingleThreaded), f);

branches/try/src/libextra/test.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,17 @@ impl TestDesc {
7474
}
7575
}
7676

77-
/// Represents a benchmark function.
78-
pub trait TDynBenchFn {
79-
fn run(&self, harness: &mut BenchHarness);
80-
}
81-
8277
// A function that runs a test. If the function returns successfully,
8378
// the test succeeds; if the function fails then the test fails. We
8479
// may need to come up with a more clever definition of test in order
8580
// to support isolation of tests into tasks.
8681
pub enum TestFn {
8782
StaticTestFn(extern fn()),
8883
StaticBenchFn(extern fn(&mut BenchHarness)),
89-
StaticMetricFn(proc(&mut MetricMap)),
90-
DynTestFn(proc()),
91-
DynMetricFn(proc(&mut MetricMap)),
92-
DynBenchFn(~TDynBenchFn)
84+
StaticMetricFn(~fn(&mut MetricMap)),
85+
DynTestFn(~fn()),
86+
DynMetricFn(~fn(&mut MetricMap)),
87+
DynBenchFn(~fn(&mut BenchHarness))
9388
}
9489

9590
impl TestFn {
@@ -864,7 +859,7 @@ pub fn run_test(force_ignore: bool,
864859

865860
fn run_test_inner(desc: TestDesc,
866861
monitor_ch: SharedChan<MonitorMsg>,
867-
testfn: proc()) {
862+
testfn: ~fn()) {
868863
let testfn_cell = ::std::cell::Cell::new(testfn);
869864
do task::spawn {
870865
let mut task = task::task();
@@ -883,8 +878,8 @@ pub fn run_test(force_ignore: bool,
883878
}
884879

885880
match testfn {
886-
DynBenchFn(bencher) => {
887-
let bs = ::test::bench::benchmark(|harness| bencher.run(harness));
881+
DynBenchFn(benchfn) => {
882+
let bs = ::test::bench::benchmark(benchfn);
888883
monitor_ch.send((desc, TrBench(bs)));
889884
return;
890885
}

branches/try/src/libextra/workcache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,14 +394,14 @@ impl<'self> Prep<'self> {
394394
pub fn exec<T:Send +
395395
Encodable<json::Encoder> +
396396
Decodable<json::Decoder>>(
397-
&'self self, blk: proc(&mut Exec) -> T) -> T {
397+
&'self self, blk: ~fn(&mut Exec) -> T) -> T {
398398
self.exec_work(blk).unwrap()
399399
}
400400

401401
fn exec_work<T:Send +
402402
Encodable<json::Encoder> +
403403
Decodable<json::Decoder>>( // FIXME(#5121)
404-
&'self self, blk: proc(&mut Exec) -> T) -> Work<'self, T> {
404+
&'self self, blk: ~fn(&mut Exec) -> T) -> Work<'self, T> {
405405
let mut bo = Some(blk);
406406

407407
debug!("exec_work: looking up {} and {:?}", self.fn_name,

branches/try/src/librustc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ diagnostic emitter which records when we hit a fatal error. If the task
322322
fails without recording a fatal error then we've encountered a compiler
323323
bug and need to present an error.
324324
*/
325-
pub fn monitor(f: proc(@diagnostic::Emitter)) {
325+
pub fn monitor(f: ~fn(@diagnostic::Emitter)) {
326326
use std::comm::*;
327327

328328
// XXX: This is a hack for newsched since it doesn't support split stacks.

branches/try/src/librustuv/net.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ mod test {
11011101
let handle2 = Cell::new(sched2.make_handle());
11021102
let tasksFriendHandle = Cell::new(sched2.make_handle());
11031103
1104-
let on_exit: proc(UnwindResult) = |exit_status| {
1104+
let on_exit: ~fn(UnwindResult) = |exit_status| {
11051105
handle1.take().send(Shutdown);
11061106
handle2.take().send(Shutdown);
11071107
assert!(exit_status.is_success());
@@ -1115,7 +1115,7 @@ mod test {
11151115
}
11161116
}
11171117
1118-
let test_function: proc() = || {
1118+
let test_function: ~fn() = || {
11191119
let io = unsafe { local_io() };
11201120
let addr = next_test_ip4();
11211121
let maybe_socket = io.udp_bind(addr);

branches/try/src/librustuv/tty.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ impl TtyWatcher {
3939
// Related:
4040
// - https://github.com/joyent/libuv/issues/982
4141
// - https://github.com/joyent/libuv/issues/988
42-
let guess = unsafe { uvll::guess_handle(fd) };
43-
if readable && guess != uvll::UV_TTY as libc::c_int {
42+
if unsafe { uvll::guess_handle(fd) != uvll::UV_TTY as libc::c_int } {
4443
return Err(UvError(uvll::EBADF));
4544
}
4645

@@ -101,10 +100,6 @@ impl RtioTTY for TtyWatcher {
101100
n => Err(uv_error_to_io_error(UvError(n)))
102101
}
103102
}
104-
105-
fn isatty(&self) -> bool {
106-
unsafe { uvll::guess_handle(self.fd) == uvll::UV_TTY as libc::c_int }
107-
}
108103
}
109104

110105
impl UvHandle<uvll::uv_tty_t> for TtyWatcher {

branches/try/src/libstd/io/buffered.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ mod test {
391391
// newtype struct autoderef weirdness
392392
#[test]
393393
fn test_buffered_stream() {
394-
use rt;
395394
struct S;
396395

397396
impl io::Writer for S {

0 commit comments

Comments
 (0)