Skip to content

Commit 81c23e2

Browse files
committed
---
yaml --- r: 96189 b: refs/heads/dist-snap c: e12bc23 h: refs/heads/master i: 96187: 0116053 v: v3
1 parent 2da7002 commit 81c23e2

File tree

245 files changed

+3207
-2674
lines changed

Some content is hidden

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

245 files changed

+3207
-2674
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 02e565a187adc0b5a7348852de664be26eb1701c
9+
refs/heads/dist-snap: e12bc239b4e85d0dedc5ba6e9f7ffa0b91ade634
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/src/libextra/arc.rs

Lines changed: 11 additions & 13 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: &fn(x: &mut T) -> U) -> U {
223+
pub unsafe fn unsafe_access<U>(&self, blk: |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,8 +234,7 @@ 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: &fn(x: &mut T,
238-
c: &Condvar) -> U)
237+
blk: |x: &mut T, c: &Condvar| -> U)
239238
-> U {
240239
let state = self.x.get();
241240
do (&(*state).lock).lock_cond |cond| {
@@ -284,15 +283,14 @@ impl<T:Freeze + Send> MutexArc<T> {
284283
* unsafe_access_cond.
285284
*/
286285
#[inline]
287-
pub fn access<U>(&self, blk: &fn(x: &mut T) -> U) -> U {
286+
pub fn access<U>(&self, blk: |x: &mut T| -> U) -> U {
288287
unsafe { self.unsafe_access(blk) }
289288
}
290289

291290
/// As unsafe_access_cond but safe and Freeze.
292291
#[inline]
293292
pub fn access_cond<U>(&self,
294-
blk: &fn(x: &mut T,
295-
c: &Condvar) -> U)
293+
blk: |x: &mut T, c: &Condvar| -> U)
296294
-> U {
297295
unsafe { self.unsafe_access_cond(blk) }
298296
}
@@ -389,7 +387,7 @@ impl<T:Freeze + Send> RWArc<T> {
389387
* poison the Arc, so subsequent readers and writers will both also fail.
390388
*/
391389
#[inline]
392-
pub fn write<U>(&self, blk: &fn(x: &mut T) -> U) -> U {
390+
pub fn write<U>(&self, blk: |x: &mut T| -> U) -> U {
393391
unsafe {
394392
let state = self.x.get();
395393
do (*borrow_rwlock(state)).write {
@@ -403,7 +401,7 @@ impl<T:Freeze + Send> RWArc<T> {
403401
/// As write(), but with a condvar, as sync::rwlock.write_cond().
404402
#[inline]
405403
pub fn write_cond<U>(&self,
406-
blk: &fn(x: &mut T, c: &Condvar) -> U)
404+
blk: |x: &mut T, c: &Condvar| -> U)
407405
-> U {
408406
unsafe {
409407
let state = self.x.get();
@@ -427,7 +425,7 @@ impl<T:Freeze + Send> RWArc<T> {
427425
* Failing will unlock the Arc while unwinding. However, unlike all other
428426
* access modes, this will not poison the Arc.
429427
*/
430-
pub fn read<U>(&self, blk: &fn(x: &T) -> U) -> U {
428+
pub fn read<U>(&self, blk: |x: &T| -> U) -> U {
431429
unsafe {
432430
let state = self.x.get();
433431
do (*state).lock.read {
@@ -457,7 +455,7 @@ impl<T:Freeze + Send> RWArc<T> {
457455
* }
458456
* ```
459457
*/
460-
pub fn write_downgrade<U>(&self, blk: &fn(v: RWWriteMode<T>) -> U) -> U {
458+
pub fn write_downgrade<U>(&self, blk: |v: RWWriteMode<T>| -> U) -> U {
461459
unsafe {
462460
let state = self.x.get();
463461
do (*borrow_rwlock(state)).write_downgrade |write_mode| {
@@ -539,7 +537,7 @@ pub struct RWReadMode<'self, T> {
539537

540538
impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {
541539
/// Access the pre-downgrade RWArc in write mode.
542-
pub fn write<U>(&mut self, blk: &fn(x: &mut T) -> U) -> U {
540+
pub fn write<U>(&mut self, blk: |x: &mut T| -> U) -> U {
543541
match *self {
544542
RWWriteMode {
545543
data: &ref mut data,
@@ -555,7 +553,7 @@ impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {
555553

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

581579
impl<'self, T:Freeze + Send> RWReadMode<'self, T> {
582580
/// Access the post-downgrade rwlock in read mode.
583-
pub fn read<U>(&self, blk: &fn(x: &T) -> U) -> U {
581+
pub fn read<U>(&self, blk: |x: &T| -> U) -> U {
584582
match *self {
585583
RWReadMode {
586584
data: data,

0 commit comments

Comments
 (0)