Skip to content

Commit 970b2b3

Browse files
committed
---
yaml --- r: 22441 b: refs/heads/master c: 120773b h: refs/heads/master i: 22439: bdddf57 v: v3
1 parent c5c4b9d commit 970b2b3

Some content is hidden

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

50 files changed

+360
-1280
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: bf88ff52178d1703c473c4ee9461348bbf4be7a2
2+
refs/heads/master: 120773b2a7b6a1ca8ba859528f3e3cd9e574bf3d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,11 +2320,11 @@ and one for values. This means that this code is valid:
23202320
~~~~
23212321
mod buffalo {
23222322
type buffalo = int;
2323-
fn buffalo<buffalo: copy>(buffalo: buffalo) -> buffalo { buffalo }
2323+
fn buffalo(buffalo: buffalo) -> buffalo { buffalo }
23242324
}
23252325
fn main() {
23262326
let buffalo: buffalo::buffalo = 1;
2327-
buffalo::buffalo::<buffalo::buffalo>(buffalo::buffalo(buffalo));
2327+
buffalo::buffalo(buffalo::buffalo(buffalo));
23282328
}
23292329
~~~~
23302330

trunk/mk/target.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
# (resp. corelib), set this flag to 1. It will cause stage1 to use
99
# the snapshot runtime (resp. corelib) rather than the runtime
1010
# (resp. corelib) from the working directory.
11-
USE_SNAPSHOT_RUNTIME=0
12-
USE_SNAPSHOT_CORELIB=0
13-
USE_SNAPSHOT_STDLIB=0
11+
USE_SNAPSHOT_RUNTIME=1
12+
USE_SNAPSHOT_CORELIB=1
13+
USE_SNAPSHOT_STDLIB=1
1414

1515
define TARGET_STAGE_N
1616

trunk/src/etc/vim/syntax/rust.vim

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ syn keyword rustConstant STDIN_FILENO STDOUT_FILENO STDERR_FILENO
6666
syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3
6767
syn match rustModPathSep "::"
6868

69-
syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1
70-
syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::<T>();
71-
7269
syn region rustString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=rustTodo
7370

7471
syn region rustAttribute start="#\[" end="\]" contains=rustString
@@ -122,7 +119,6 @@ hi def link rustAttribute PreProc
122119
" Other Suggestions:
123120
" hi def link rustModPathSep Conceal
124121
" hi rustAssert ctermfg=yellow
125-
" hi rustFuncCall ctermfg=magenta
126122

127123
syn sync minlines=200
128124
syn sync maxlines=500

trunk/src/libcore/arc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fn clone<T: const send>(rc: &arc<T>) -> arc<T> {
8484
}
8585

8686
// An arc over mutable data that is protected by a lock.
87-
type ex_data<T: send> = {lock: sys::lock_and_signal, mut data: T};
87+
type ex_data<T: send> = {lock: sys::lock_and_signal, data: T};
8888
type exclusive<T: send> = arc_destruct<ex_data<T>>;
8989

9090
fn exclusive<T:send >(-data: T) -> exclusive<T> {
@@ -110,12 +110,12 @@ impl methods<T: send> for exclusive<T> {
110110
arc_destruct(self.data)
111111
}
112112

113-
unsafe fn with<U>(f: fn(sys::condition, x: &mut T) -> U) -> U {
113+
unsafe fn with<U>(f: fn(sys::condition, x: &T) -> U) -> U {
114114
let ptr: ~arc_data<ex_data<T>> =
115115
unsafe::reinterpret_cast(self.data);
116116
let r = {
117117
let rec: &ex_data<T> = &(*ptr).data;
118-
rec.lock.lock_cond(|c| f(c, &mut rec.data))
118+
rec.lock.lock_cond(|c| f(c, &rec.data))
119119
};
120120
unsafe::forget(ptr);
121121
r

trunk/src/libcore/future.rs

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*/
1313

1414
import either::either;
15-
import pipes::recv;
1615

1716
export future;
1817
export extensions;
@@ -61,6 +60,10 @@ fn from_value<A>(+val: A) -> future<A> {
6160
}
6261

6362
fn macros() {
63+
#macro[
64+
[#recv[chan],
65+
chan.recv()(chan)]
66+
];
6467
#macro[
6568
[#move[x],
6669
unsafe { let y <- *ptr::addr_of(x); y }]
@@ -74,13 +77,14 @@ fn from_port<A:send>(-port: future_pipe::client::waiting<A>) -> future<A> {
7477
The first time that the value is requested the task will block
7578
waiting for the result to be received on the port.
7679
"];
80+
import future_pipe::client::recv;
7781

7882
let port = ~mut some(port);
7983
do from_fn |move port| {
8084
let mut port_ = none;
8185
port_ <-> *port;
8286
let port = option::unwrap(port_);
83-
alt recv(port) {
87+
alt (#recv(port)) {
8488
future_pipe::completed(data, _next) { #move(data) }
8589
}
8690
}
@@ -133,12 +137,55 @@ fn with<A,B>(future: future<A>, blk: fn(A) -> B) -> B {
133137
blk(*v)
134138
}
135139

140+
// The pipe protocol, generated by pipec
141+
/*
136142
proto! future_pipe {
137143
waiting:recv<T:send> {
138144
completed(T) -> terminated
139145
}
140146
141-
terminated:send { }
147+
terminated { }
148+
}
149+
*/
150+
mod future_pipe {
151+
fn init<T: send>() -> (client::waiting<T>, server::waiting<T>) {
152+
{ let (s, c) = pipes::entangle(); (c, s) }
153+
}
154+
enum waiting<T: send> { completed(T, client::terminated), }
155+
enum terminated { }
156+
mod client {
157+
impl recv<T: send> for waiting<T> {
158+
fn recv() -> extern fn(+waiting<T>) -> future_pipe::waiting<T> {
159+
fn recv<T: send>(+pipe: waiting<T>) ->
160+
future_pipe::waiting<T> {
161+
option::unwrap(pipes::recv(pipe))
162+
}
163+
recv
164+
}
165+
}
166+
type waiting<T: send> = pipes::recv_packet<future_pipe::waiting<T>>;
167+
type terminated = pipes::send_packet<future_pipe::terminated>;
168+
}
169+
mod server {
170+
fn completed<T: send>(+pipe: waiting<T>, +x_0: T) -> terminated {
171+
{
172+
let (s, c) = pipes::entangle();
173+
let message = future_pipe::completed(x_0, s);
174+
pipes::send(pipe, message);
175+
c
176+
}
177+
}
178+
type waiting<T: send> = pipes::send_packet<future_pipe::waiting<T>>;
179+
impl recv for terminated {
180+
fn recv() -> extern fn(+terminated) -> future_pipe::terminated {
181+
fn recv(+pipe: terminated) -> future_pipe::terminated {
182+
option::unwrap(pipes::recv(pipe))
183+
}
184+
recv
185+
}
186+
}
187+
type terminated = pipes::recv_packet<future_pipe::terminated>;
188+
}
142189
}
143190

144191
#[test]

0 commit comments

Comments
 (0)