Skip to content

Commit fc8f6eb

Browse files
committed
---
yaml --- r: 93762 b: refs/heads/try c: 32f6c11 h: refs/heads/master v: v3
1 parent dadde6e commit fc8f6eb

File tree

114 files changed

+1194
-1088
lines changed

Some content is hidden

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

114 files changed

+1194
-1088
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: df0f50381c630c56adcd7ca0023b8daaa3ad2776
5+
refs/heads/try: 32f6c11dfab019181b77fe48a876c3ba38b0c72a
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: ~fn())`. "
216+
"The `spawn` function has a very simple type signature: `fn spawn(f: proc())`. "
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 `~fn` in analogy to the `~` pointer type, hold on to "
3512+
"Owned closures, written `proc`, 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-
"`~` ポインタ型と同様に `~fn` 型 で書き表される所有クロージャは安全にプロセス"
3518+
"`~` `proc` で書き表される所有クロージャは安全にプロセス"
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: ~fn())`. In other words, it is a "
3669+
"`spawn` has the signature `spawn(fn: proc())`. 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: ~fn())` という方を持っています。言い換えると、"
3673+
"`spawn` は、 `spawn(fn: proc())` という方を持っています。言い換えると、"
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: ~fn())`. "
216+
"The `spawn` function has a very simple type signature: `fn spawn(f: proc())`. "
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 `~fn` in analogy to the `~` pointer type, hold on to "
2686+
"Owned closures, written `proc`, 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: ~fn())`. In other words, it is a "
2811+
"`spawn` has the signature `spawn(fn: proc())`. 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-
~fn())`. Because it accepts only owned closures, and owned closures
94+
proc())`. 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 `~fn` in analogy to the `~` pointer type,
1412+
Owned closures, written `proc`,
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: ~fn())`. In other
1487+
function. `spawn` has the signature `spawn(fn: proc())`. In other
14881488
words, it is a function that takes an owned closure that takes no
14891489
arguments.
14901490

branches/try/mk/clean.mk

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@
1212
# Cleanup
1313
######################################################################
1414

15-
CLEAN_STAGE_RULES = \
16-
$(foreach stage, $(STAGES), \
17-
$(foreach host, $(CFG_HOST), \
15+
CLEAN_STAGE_RULES := \
16+
$(foreach stage, $(STAGES), \
17+
$(foreach host, $(CFG_HOST), \
1818
clean$(stage)_H_$(host) \
19-
$(foreach target, $(CFG_TARGET), \
19+
$(foreach target, $(CFG_TARGET), \
2020
clean$(stage)_T_$(target)_H_$(host))))
2121

22+
CLEAN_STAGE_RULES := $(CLEAN_STAGE_RULES) \
23+
$(foreach host, $(CFG_HOST), clean-generic-H-$(host))
24+
25+
CLEAN_STAGE_RULES := $(CLEAN_STAGE_RULES) \
26+
$(foreach host, $(CFG_TARGET), clean-generic-T-$(host))
27+
2228
CLEAN_LLVM_RULES = \
2329
$(foreach target, $(CFG_HOST), \
2430
clean-llvm$(target))
@@ -33,19 +39,6 @@ clean: clean-misc $(CLEAN_STAGE_RULES)
3339

3440
clean-misc:
3541
@$(call E, cleaning)
36-
$(Q)find $(CFG_BUILD)/rustllvm \
37-
$(CFG_BUILD)/rt \
38-
$(CFG_BUILD)/test \
39-
-name '*.[odasS]' -o \
40-
-name '*.so' -o \
41-
-name '*.dylib' -o \
42-
-name '*.dll' -o \
43-
-name '*.def' -o \
44-
-name '*.bc' \
45-
| xargs rm -f
46-
$(Q)find $(CFG_BUILD)\
47-
-name '*.dSYM' \
48-
| xargs rm -Rf
4942
$(Q)rm -f $(RUNTIME_OBJS) $(RUNTIME_DEF)
5043
$(Q)rm -f $(RUSTLLVM_LIB_OBJS) $(RUSTLLVM_OBJS_OBJS) $(RUSTLLVM_DEF)
5144
$(Q)rm -Rf $(DOCS)
@@ -60,6 +53,27 @@ clean-misc:
6053
$(Q)rm -Rf $(foreach sub, index styles files search javascript, \
6154
$(wildcard doc/*/$(sub)))
6255

56+
define CLEAN_GENERIC
57+
58+
clean-generic-$(2)-$(1):
59+
$(Q)find $(1)/rustllvm \
60+
$(1)/rt \
61+
$(1)/test \
62+
-name '*.[odasS]' -o \
63+
-name '*.so' -o \
64+
-name '*.dylib' -o \
65+
-name '*.dll' -o \
66+
-name '*.def' -o \
67+
-name '*.bc' \
68+
| xargs rm -f
69+
$(Q)find $(1)\
70+
-name '*.dSYM' \
71+
| xargs rm -Rf
72+
endef
73+
74+
$(foreach host, $(CFG_HOST), $(eval $(call CLEAN_GENERIC,$(host),H)))
75+
$(foreach targ, $(CFG_TARGET), $(eval $(call CLEAN_GENERIC,$(targ),T)))
76+
6377
define CLEAN_HOST_STAGE_N
6478

6579
clean$(1)_H_$(2):

branches/try/mk/platform.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ CFG_LIB_GLOB_arm-apple-darwin = lib$(1)-*.dylib
206206
CFG_LIB_DSYM_GLOB_arm-apple-darwin = lib$(1)-*.dylib.dSYM
207207
CFG_GCCISH_CFLAGS_arm-apple-darwin := -Wall -Werror -g -fPIC $(CFG_IOS_FLAGS)
208208
CFG_GCCISH_CXXFLAGS_arm-apple-darwin := -fno-rtti $(CFG_IOS_FLAGS)
209-
CFG_GCCISH_LINK_FLAGS_arm-apple-darwin := -dynamiclib -lpthread -framework CoreServices -Wl,-no_compact_unwind
209+
CFG_GCCISH_LINK_FLAGS_arm-apple-darwin := -dynamiclib -lpthread -framework CoreServices -Wl,-no_compact_unwind
210210
CFG_GCCISH_DEF_FLAG_arm-apple-darwin := -Wl,-exported_symbols_list,
211211
CFG_GCCISH_PRE_LIB_FLAGS_arm-apple-darwin :=
212212
CFG_GCCISH_POST_LIB_FLAGS_arm-apple-darwin :=
@@ -506,7 +506,7 @@ define CFG_MAKE_TOOLCHAIN
506506
-c -o $$(1) $$(2)
507507
CFG_LINK_C_$(1) = $$(CC_$(1)) \
508508
$$(CFG_GCCISH_LINK_FLAGS) -o $$(1) \
509-
$$(CFG_GCCISH_LINK_FLAGS_$(1))) \
509+
$$(CFG_GCCISH_LINK_FLAGS_$(1)) \
510510
$$(CFG_GCCISH_DEF_FLAG_$(1))$$(3) $$(2) \
511511
$$(call CFG_INSTALL_NAME_$(1),$$(4))
512512
CFG_COMPILE_CXX_$(1) = $$(CXX_$(1)) \

branches/try/mk/rt.mk

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,18 @@ endif
9090
endif
9191

9292
RUNTIME_CXXS_$(1)_$(2) := \
93-
rt/sync/lock_and_signal.cpp \
94-
rt/rust_builtin.cpp \
95-
rt/rust_upcall.cpp \
96-
rt/miniz.cpp \
97-
rt/rust_android_dummy.cpp \
98-
rt/rust_test_helpers.cpp
93+
rt/rust_cxx_glue.cpp
9994

100-
RUNTIME_CS_$(1)_$(2) :=
95+
RUNTIME_CS_$(1)_$(2) := \
96+
rt/rust_builtin.c \
97+
rt/rust_upcall.c \
98+
rt/miniz.c \
99+
rt/rust_android_dummy.c \
100+
rt/rust_test_helpers.c
101+
102+
# stage0 remove this after the next snapshot
103+
%.cpp:
104+
@touch tmp/foo.o
101105

102106
RUNTIME_S_$(1)_$(2) := rt/arch/$$(HOST_$(1))/_context.S \
103107
rt/arch/$$(HOST_$(1))/record_sp.S
@@ -115,7 +119,7 @@ ALL_OBJ_FILES += $$(RUNTIME_OBJS_$(1)_$(2))
115119
MORESTACK_OBJS_$(1)_$(2) := $$(RT_BUILD_DIR_$(1)_$(2))/arch/$$(HOST_$(1))/morestack.o
116120
ALL_OBJ_FILES += $$(MORESTACK_OBJS_$(1)_$(2))
117121

118-
$$(RT_BUILD_DIR_$(1)_$(2))/%.o: rt/%.cpp $$(MKFILE_DEPS)
122+
$$(RT_BUILD_DIR_$(1)_$(2))/rust_cxx_glue.o: rt/rust_cxx_glue.cpp $$(MKFILE_DEPS)
119123
@$$(call E, compile: $$@)
120124
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@, $$(RUNTIME_INCS_$(1)_$(2)) \
121125
$$(SNAP_DEFINES) $$(RUNTIME_CXXFLAGS_$(1)_$(2))) $$<
@@ -242,13 +246,13 @@ endif
242246
UV_SUPPORT_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),uv_support)
243247
UV_SUPPORT_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/uv_support
244248
UV_SUPPORT_LIB_$(1) := $$(UV_SUPPORT_DIR_$(1))/$$(UV_SUPPORT_NAME_$(1))
245-
UV_SUPPORT_CS_$(1) := rt/rust_uv.cpp
246-
UV_SUPPORT_OBJS_$(1) := $$(UV_SUPPORT_CS_$(1):rt/%.cpp=$$(UV_SUPPORT_DIR_$(1))/%.o)
249+
UV_SUPPORT_CS_$(1) := rt/rust_uv.c
250+
UV_SUPPORT_OBJS_$(1) := $$(UV_SUPPORT_CS_$(1):rt/%.c=$$(UV_SUPPORT_DIR_$(1))/%.o)
247251

248-
$$(UV_SUPPORT_DIR_$(1))/%.o: rt/%.cpp
252+
$$(UV_SUPPORT_DIR_$(1))/%.o: rt/%.c
249253
@$$(call E, compile: $$@)
250254
@mkdir -p $$(@D)
251-
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@, \
255+
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, \
252256
-I $$(S)src/libuv/include \
253257
$$(RUNTIME_CFLAGS_$(1))) $$<
254258

branches/try/src/etc/adb_run_wrapper.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
# Sometimes android shell produce exitcode "1 : Text File Busy"
66
# Retry after $WAIT seconds, expecting resource cleaned-up
77
WAIT=10
8-
PATH=$1
9-
if [ -d "$PATH" ]
8+
TEST_PATH=$1
9+
BIN_PATH=/system/bin
10+
if [ -d "$TEST_PATH" ]
1011
then
1112
shift
1213
RUN=$1
@@ -17,10 +18,10 @@ then
1718

1819
L_RET=1
1920
L_COUNT=0
20-
cd $PATH
21+
cd $TEST_PATH
2122
while [ $L_RET -eq 1 ]
2223
do
23-
TEST_EXEC_ENV=22 LD_LIBRARY_PATH=$PATH $PATH/$RUN $@ 1>$PATH/$RUN.stdout 2>$PATH/$RUN.stderr
24+
TEST_EXEC_ENV=22 LD_LIBRARY_PATH=$TEST_PATH PATH=$BIN_PATH:$TEST_PATH $TEST_PATH/$RUN $@ 1>$TEST_PATH/$RUN.stdout 2>$TEST_PATH/$RUN.stderr
2425
L_RET=$?
2526
if [ $L_COUNT -gt 0 ]
2627
then
@@ -30,7 +31,7 @@ then
3031
L_COUNT=$((L_COUNT+1))
3132
done
3233

33-
echo $L_RET > $PATH/$RUN.exitcode
34+
echo $L_RET > $TEST_PATH/$RUN.exitcode
3435

3536
fi
3637
fi

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(~fn() -> A),
39+
Pending(proc() -> 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: ~fn() -> A) -> Future<A> {
95+
pub fn from_fn(f: proc() -> 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: ~fn() -> A) -> Future<A> {
123+
pub fn spawn(blk: proc() -> 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: ~fn(B) -> A) -> Future<A> {
140+
pub fn spawn_with<B: Send>(v: B, blk: proc(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(~fn(&T)),
26+
Execute(proc(&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() -> ~fn(uint) -> T)
52+
init_fn_factory: &fn() -> proc(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: ~fn() = || {
60+
let task_body: proc() = || {
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: ~fn(&T)) {
91+
pub fn execute(&mut self, f: proc(&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() -> ~fn(uint) -> uint = || {
101-
let g: ~fn(uint) -> uint = |i| i;
100+
let f: &fn() -> proc(uint) -> uint = || {
101+
let g: proc(uint) -> uint = |i| i;
102102
g
103103
};
104104
let mut pool = TaskPool::new(4, Some(SingleThreaded), f);

0 commit comments

Comments
 (0)