Skip to content

Commit a885e94

Browse files
committed
---
yaml --- r: 89939 b: refs/heads/master c: 50fb4be h: refs/heads/master i: 89937: 356c780 89935: c612fcc v: v3
1 parent cae6a54 commit a885e94

File tree

248 files changed

+2727
-3208
lines changed

Some content is hidden

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

248 files changed

+2727
-3208
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: 6a25ba374b2bfe32d4411cab3547d76d47769d6c
2+
refs/heads/master: 50fb4be1cce008ef8c0b4b40e70460c1be1d795a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8

trunk/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 "

trunk/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

trunk/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 "

trunk/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

trunk/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

trunk/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

trunk/mk/clean.mk

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,13 @@
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-
2822
CLEAN_LLVM_RULES = \
2923
$(foreach target, $(CFG_HOST), \
3024
clean-llvm$(target))
@@ -39,6 +33,19 @@ clean: clean-misc $(CLEAN_STAGE_RULES)
3933

4034
clean-misc:
4135
@$(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
4249
$(Q)rm -f $(RUNTIME_OBJS) $(RUNTIME_DEF)
4350
$(Q)rm -f $(RUSTLLVM_LIB_OBJS) $(RUSTLLVM_OBJS_OBJS) $(RUSTLLVM_DEF)
4451
$(Q)rm -Rf $(DOCS)
@@ -53,27 +60,6 @@ clean-misc:
5360
$(Q)rm -Rf $(foreach sub, index styles files search javascript, \
5461
$(wildcard doc/*/$(sub)))
5562

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-
7763
define CLEAN_HOST_STAGE_N
7864

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

trunk/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)) \

trunk/mk/rt.mk

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

9292
RUNTIME_CXXS_$(1)_$(2) := \
93-
rt/rust_cxx_glue.cpp
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
9499

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
100+
RUNTIME_CS_$(1)_$(2) :=
105101

106102
RUNTIME_S_$(1)_$(2) := rt/arch/$$(HOST_$(1))/_context.S \
107103
rt/arch/$$(HOST_$(1))/record_sp.S
@@ -119,7 +115,7 @@ ALL_OBJ_FILES += $$(RUNTIME_OBJS_$(1)_$(2))
119115
MORESTACK_OBJS_$(1)_$(2) := $$(RT_BUILD_DIR_$(1)_$(2))/arch/$$(HOST_$(1))/morestack.o
120116
ALL_OBJ_FILES += $$(MORESTACK_OBJS_$(1)_$(2))
121117

122-
$$(RT_BUILD_DIR_$(1)_$(2))/rust_cxx_glue.o: rt/rust_cxx_glue.cpp $$(MKFILE_DEPS)
118+
$$(RT_BUILD_DIR_$(1)_$(2))/%.o: rt/%.cpp $$(MKFILE_DEPS)
123119
@$$(call E, compile: $$@)
124120
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@, $$(RUNTIME_INCS_$(1)_$(2)) \
125121
$$(SNAP_DEFINES) $$(RUNTIME_CXXFLAGS_$(1)_$(2))) $$<
@@ -246,13 +242,13 @@ endif
246242
UV_SUPPORT_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),uv_support)
247243
UV_SUPPORT_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/uv_support
248244
UV_SUPPORT_LIB_$(1) := $$(UV_SUPPORT_DIR_$(1))/$$(UV_SUPPORT_NAME_$(1))
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)
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)
251247

252-
$$(UV_SUPPORT_DIR_$(1))/%.o: rt/%.c
248+
$$(UV_SUPPORT_DIR_$(1))/%.o: rt/%.cpp
253249
@$$(call E, compile: $$@)
254250
@mkdir -p $$(@D)
255-
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, \
251+
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@, \
256252
-I $$(S)src/libuv/include \
257253
$$(RUNTIME_CFLAGS_$(1))) $$<
258254

trunk/src/etc/adb_run_wrapper.sh

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

1918
L_RET=1
2019
L_COUNT=0
21-
cd $TEST_PATH
20+
cd $PATH
2221
while [ $L_RET -eq 1 ]
2322
do
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
23+
TEST_EXEC_ENV=22 LD_LIBRARY_PATH=$PATH $PATH/$RUN $@ 1>$PATH/$RUN.stdout 2>$PATH/$RUN.stderr
2524
L_RET=$?
2625
if [ $L_COUNT -gt 0 ]
2726
then
@@ -31,7 +30,7 @@ then
3130
L_COUNT=$((L_COUNT+1))
3231
done
3332

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

3635
fi
3736
fi

trunk/src/libextra/arc.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl<T:Send> MutexArc<T> {
220220
* blocked on the mutex) will also fail immediately.
221221
*/
222222
#[inline]
223-
pub unsafe fn unsafe_access<U>(&self, blk: |x: &mut T| -> U) -> U {
223+
pub unsafe fn unsafe_access<U>(&self, blk: &fn(x: &mut T) -> U) -> U {
224224
let state = self.x.get();
225225
// Borrowck would complain about this if the function were
226226
// not already unsafe. See borrow_rwlock, far below.
@@ -234,7 +234,8 @@ impl<T:Send> MutexArc<T> {
234234
/// As unsafe_access(), but with a condvar, as sync::mutex.lock_cond().
235235
#[inline]
236236
pub unsafe fn unsafe_access_cond<U>(&self,
237-
blk: |x: &mut T, c: &Condvar| -> U)
237+
blk: &fn(x: &mut T,
238+
c: &Condvar) -> U)
238239
-> U {
239240
let state = self.x.get();
240241
do (&(*state).lock).lock_cond |cond| {
@@ -283,14 +284,15 @@ impl<T:Freeze + Send> MutexArc<T> {
283284
* unsafe_access_cond.
284285
*/
285286
#[inline]
286-
pub fn access<U>(&self, blk: |x: &mut T| -> U) -> U {
287+
pub fn access<U>(&self, blk: &fn(x: &mut T) -> U) -> U {
287288
unsafe { self.unsafe_access(blk) }
288289
}
289290

290291
/// As unsafe_access_cond but safe and Freeze.
291292
#[inline]
292293
pub fn access_cond<U>(&self,
293-
blk: |x: &mut T, c: &Condvar| -> U)
294+
blk: &fn(x: &mut T,
295+
c: &Condvar) -> U)
294296
-> U {
295297
unsafe { self.unsafe_access_cond(blk) }
296298
}
@@ -387,7 +389,7 @@ impl<T:Freeze + Send> RWArc<T> {
387389
* poison the Arc, so subsequent readers and writers will both also fail.
388390
*/
389391
#[inline]
390-
pub fn write<U>(&self, blk: |x: &mut T| -> U) -> U {
392+
pub fn write<U>(&self, blk: &fn(x: &mut T) -> U) -> U {
391393
unsafe {
392394
let state = self.x.get();
393395
do (*borrow_rwlock(state)).write {
@@ -401,7 +403,7 @@ impl<T:Freeze + Send> RWArc<T> {
401403
/// As write(), but with a condvar, as sync::rwlock.write_cond().
402404
#[inline]
403405
pub fn write_cond<U>(&self,
404-
blk: |x: &mut T, c: &Condvar| -> U)
406+
blk: &fn(x: &mut T, c: &Condvar) -> U)
405407
-> U {
406408
unsafe {
407409
let state = self.x.get();
@@ -425,7 +427,7 @@ impl<T:Freeze + Send> RWArc<T> {
425427
* Failing will unlock the Arc while unwinding. However, unlike all other
426428
* access modes, this will not poison the Arc.
427429
*/
428-
pub fn read<U>(&self, blk: |x: &T| -> U) -> U {
430+
pub fn read<U>(&self, blk: &fn(x: &T) -> U) -> U {
429431
unsafe {
430432
let state = self.x.get();
431433
do (*state).lock.read {
@@ -455,7 +457,7 @@ impl<T:Freeze + Send> RWArc<T> {
455457
* }
456458
* ```
457459
*/
458-
pub fn write_downgrade<U>(&self, blk: |v: RWWriteMode<T>| -> U) -> U {
460+
pub fn write_downgrade<U>(&self, blk: &fn(v: RWWriteMode<T>) -> U) -> U {
459461
unsafe {
460462
let state = self.x.get();
461463
do (*borrow_rwlock(state)).write_downgrade |write_mode| {
@@ -537,7 +539,7 @@ pub struct RWReadMode<'self, T> {
537539

538540
impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {
539541
/// Access the pre-downgrade RWArc in write mode.
540-
pub fn write<U>(&mut self, blk: |x: &mut T| -> U) -> U {
542+
pub fn write<U>(&mut self, blk: &fn(x: &mut T) -> U) -> U {
541543
match *self {
542544
RWWriteMode {
543545
data: &ref mut data,
@@ -553,7 +555,7 @@ impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {
553555

554556
/// Access the pre-downgrade RWArc in write mode with a condvar.
555557
pub fn write_cond<U>(&mut self,
556-
blk: |x: &mut T, c: &Condvar| -> U)
558+
blk: &fn(x: &mut T, c: &Condvar) -> U)
557559
-> U {
558560
match *self {
559561
RWWriteMode {
@@ -578,7 +580,7 @@ impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {
578580

579581
impl<'self, T:Freeze + Send> RWReadMode<'self, T> {
580582
/// Access the post-downgrade rwlock in read mode.
581-
pub fn read<U>(&self, blk: |x: &T| -> U) -> U {
583+
pub fn read<U>(&self, blk: &fn(x: &T) -> U) -> U {
582584
match *self {
583585
RWReadMode {
584586
data: data,

0 commit comments

Comments
 (0)