Skip to content

Commit d329db4

Browse files
committed
---
yaml --- r: 141261 b: refs/heads/try2 c: c658132 h: refs/heads/master i: 141259: aee952c v: v3
1 parent 05893fc commit d329db4

Some content is hidden

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

109 files changed

+2388
-3029
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: b0f3686515410c013f6cd12ce4fc5236e3dee3f2
8+
refs/heads/try2: c6581325ac38ce3f96cb7a0ea0aad35feed173c1
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ src/.DS_Store
7373
/doc/html
7474
/doc/latex
7575
/doc/std
76-
/doc/extra
7776
/nd/
7877
/llvm/
7978
version.md
@@ -82,6 +81,7 @@ keywords.md
8281
x86_64-apple-darwin/
8382
x86_64-unknown-linux-gnu/
8483
i686-unknown-linux-gnu/
84+
doc/core/
8585
tmp.*.rs
8686
config.stamp
8787
.DS_Store

branches/try2/configure

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -665,16 +665,12 @@ make_dir rt
665665
for t in $CFG_TARGET_TRIPLES
666666
do
667667
make_dir rt/$t
668-
for s in 0 1 2 3
668+
for i in \
669+
isaac linenoise sync test \
670+
arch/i386 arch/x86_64 arch/arm arch/mips \
671+
libuv libuv/src/ares libuv/src/eio libuv/src/ev
669672
do
670-
make_dir rt/$t/stage$s
671-
for i in \
672-
isaac linenoise sync test \
673-
arch/i386 arch/x86_64 arch/arm arch/mips \
674-
libuv libuv/src/ares libuv/src/eio libuv/src/ev
675-
do
676-
make_dir rt/$t/stage$s/$i
677-
done
673+
make_dir rt/$t/$i
678674
done
679675
done
680676

branches/try2/doc/rust.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,11 +2435,10 @@ match x {
24352435
}
24362436
~~~~
24372437

2438-
Patterns that bind variables default to binding to a copy or move of the matched value
2439-
(depending on the matched value's type).
2440-
This can be made explicit using the ```copy``` keyword,
2441-
changed to bind to a borrowed pointer by using the ```ref``` keyword,
2442-
or to a mutable borrowed pointer using ```ref mut```.
2438+
Patterns that bind variables default to binding to a copy of the matched value. This can be made
2439+
explicit using the ```copy``` keyword, changed to bind to a borrowed pointer by using the ```ref```
2440+
keyword, or to a mutable borrowed pointer using ```ref mut```, or the value can be moved into
2441+
the new binding using ```move```.
24432442

24442443
A pattern that's just an identifier,
24452444
like `Nil` in the previous answer,

branches/try2/mk/platform.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $(foreach t,$(CFG_TARGET_TRIPLES),$(info cfg: os for $(t) is $(OSTYPE_$(t))))
2929
# FIXME: no-omit-frame-pointer is just so that task_start_wrapper
3030
# has a frame pointer and the stack walker can understand it. Turning off
3131
# frame pointers everywhere is overkill
32-
CFG_GCCISH_CFLAGS += -fno-omit-frame-pointer -DUSE_UTF8
32+
CFG_GCCISH_CFLAGS += -fno-omit-frame-pointer
3333

3434
# On Darwin, we need to run dsymutil so the debugging information ends
3535
# up in the right place. On other platforms, it automatically gets

branches/try2/mk/rt.mk

Lines changed: 47 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,14 @@ ifneq ($(strip $(findstring snap,$(MAKECMDGOALS))),)
4141
SNAP_DEFINES=-DRUST_SNAPSHOT
4242
endif
4343

44+
4445
define DEF_RUNTIME_TARGETS
4546

4647
######################################################################
4748
# Runtime (C++) library variables
4849
######################################################################
4950

50-
# $(1) is the target triple
51-
# $(2) is the stage number
52-
53-
RUNTIME_CFLAGS_$(1)_$(2) = -D_RUST_STAGE$(2)
54-
RUNTIME_CXXFLAGS_$(1)_$(2) = -D_RUST_STAGE$(2)
55-
56-
RUNTIME_CXXS_$(1)_$(2) := \
51+
RUNTIME_CXXS_$(1) := \
5752
rt/sync/timer.cpp \
5853
rt/sync/lock_and_signal.cpp \
5954
rt/sync/rust_thread.cpp \
@@ -88,70 +83,70 @@ RUNTIME_CXXS_$(1)_$(2) := \
8883
rt/rust_android_dummy.cpp \
8984
rt/rust_test_helpers.cpp
9085

91-
RUNTIME_CS_$(1)_$(2) := rt/linenoise/linenoise.c rt/linenoise/utf8.c
86+
RUNTIME_CS_$(1) := rt/linenoise/linenoise.c rt/linenoise/utf8.c
9287

93-
RUNTIME_S_$(1)_$(2) := rt/arch/$$(HOST_$(1))/_context.S \
94-
rt/arch/$$(HOST_$(1))/ccall.S \
95-
rt/arch/$$(HOST_$(1))/record_sp.S
88+
RUNTIME_S_$(1) := rt/arch/$$(HOST_$(1))/_context.S \
89+
rt/arch/$$(HOST_$(1))/ccall.S \
90+
rt/arch/$$(HOST_$(1))/record_sp.S
9691

9792
ifeq ($$(CFG_WINDOWSY_$(1)), 1)
98-
LIBUV_OSTYPE_$(1)_$(2) := win
99-
LIBUV_LIB_$(1)_$(2) := rt/$(1)/stage$(2)/libuv/libuv.a
93+
LIBUV_OSTYPE_$(1) := win
94+
LIBUV_LIB_$(1) := rt/$(1)/libuv/libuv.a
10095
else ifeq ($(OSTYPE_$(1)), apple-darwin)
101-
LIBUV_OSTYPE_$(1)_$(2) := mac
102-
LIBUV_LIB_$(1)_$(2) := rt/$(1)/stage$(2)/libuv/libuv.a
96+
LIBUV_OSTYPE_$(1) := mac
97+
LIBUV_LIB_$(1) := rt/$(1)/libuv/libuv.a
10398
else ifeq ($(OSTYPE_$(1)), unknown-freebsd)
104-
LIBUV_OSTYPE_$(1)_$(2) := unix/freebsd
105-
LIBUV_LIB_$(1)_$(2) := rt/$(1)/stage$(2)/libuv/libuv.a
99+
LIBUV_OSTYPE_$(1) := unix/freebsd
100+
LIBUV_LIB_$(1) := rt/$(1)/libuv/libuv.a
106101
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
107-
LIBUV_OSTYPE_$(1)_$(2) := unix/android
108-
LIBUV_LIB_$(1)_$(2) := rt/$(1)/stage$(2)/libuv/libuv.a
102+
LIBUV_OSTYPE_$(1) := unix/android
103+
LIBUV_LIB_$(1) := rt/$(1)/libuv/libuv.a
109104
else
110-
LIBUV_OSTYPE_$(1)_$(2) := unix/linux
111-
LIBUV_LIB_$(1)_$(2) := rt/$(1)/stage$(2)/libuv/libuv.a
105+
LIBUV_OSTYPE_$(1) := unix/linux
106+
LIBUV_LIB_$(1) := rt/$(1)/libuv/libuv.a
112107
endif
113108

114-
RUNTIME_DEF_$(1)_$(2) := rt/rustrt$(CFG_DEF_SUFFIX_$(1))
115-
RUNTIME_INCS_$(1)_$(2) := -I $$(S)src/rt -I $$(S)src/rt/isaac -I $$(S)src/rt/uthash \
109+
RUNTIME_DEF_$(1) := rt/rustrt$(CFG_DEF_SUFFIX_$(1))
110+
RUNTIME_INCS_$(1) := -I $$(S)src/rt -I $$(S)src/rt/isaac -I $$(S)src/rt/uthash \
116111
-I $$(S)src/rt/arch/$$(HOST_$(1)) \
117112
-I $$(S)src/rt/linenoise \
118113
-I $$(S)src/libuv/include
119-
RUNTIME_OBJS_$(1)_$(2) := $$(RUNTIME_CXXS_$(1)_$(2):rt/%.cpp=rt/$(1)/stage$(2)/%.o) \
120-
$$(RUNTIME_CS_$(1)_$(2):rt/%.c=rt/$(1)/stage$(2)/%.o) \
121-
$$(RUNTIME_S_$(1)_$(2):rt/%.S=rt/$(1)/stage$(2)/%.o)
122-
ALL_OBJ_FILES += $$(RUNTIME_OBJS_$(1)_$(2))
114+
RUNTIME_OBJS_$(1) := $$(RUNTIME_CXXS_$(1):rt/%.cpp=rt/$(1)/%.o) \
115+
$$(RUNTIME_CS_$(1):rt/%.c=rt/$(1)/%.o) \
116+
$$(RUNTIME_S_$(1):rt/%.S=rt/$(1)/%.o)
117+
ALL_OBJ_FILES += $$(RUNTIME_OBJS_$(1))
123118

124-
MORESTACK_OBJ_$(1)_$(2) := rt/$(1)/stage$(2)/arch/$$(HOST_$(1))/morestack.o
125-
ALL_OBJ_FILES += $$(MORESTACK_OBJS_$(1)_$(2))
119+
MORESTACK_OBJ_$(1) := rt/$(1)/arch/$$(HOST_$(1))/morestack.o
120+
ALL_OBJ_FILES += $$(MORESTACK_OBJS_$(1))
126121

127-
RUNTIME_LIBS_$(1)_$(2) := $$(LIBUV_LIB_$(1)_$(2))
122+
RUNTIME_LIBS_$(1) := $$(LIBUV_LIB_$(1))
128123

129-
rt/$(1)/stage$(2)/%.o: rt/%.cpp $$(MKFILE_DEPS)
124+
rt/$(1)/%.o: rt/%.cpp $$(MKFILE_DEPS)
130125
@$$(call E, compile: $$@)
131-
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@, $$(RUNTIME_INCS_$(1)_$(2)) \
132-
$$(SNAP_DEFINES) $$(RUNTIME_CXXFLAGS_$(1)_$(2))) $$<
126+
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@, $$(RUNTIME_INCS_$(1)) \
127+
$$(SNAP_DEFINES)) $$<
133128

134-
rt/$(1)/stage$(2)/%.o: rt/%.c $$(MKFILE_DEPS)
129+
rt/$(1)/%.o: rt/%.c $$(MKFILE_DEPS)
135130
@$$(call E, compile: $$@)
136-
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, $$(RUNTIME_INCS_$(1)_$(2)) \
137-
$$(SNAP_DEFINES) $$(RUNTIME_CFLAGS_$(1)_$(2))) $$<
131+
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, $$(RUNTIME_INCS_$(1)) \
132+
$$(SNAP_DEFINES)) $$<
138133

139-
rt/$(1)/stage$(2)/%.o: rt/%.S $$(MKFILE_DEPS) \
134+
rt/$(1)/%.o: rt/%.S $$(MKFILE_DEPS) \
140135
$$(LLVM_CONFIG_$$(CFG_BUILD_TRIPLE))
141136
@$$(call E, compile: $$@)
142137
$$(Q)$$(call CFG_ASSEMBLE_$(1),$$@,$$<)
143138

144-
rt/$(1)/stage$(2)/arch/$$(HOST_$(1))/libmorestack.a: $$(MORESTACK_OBJ_$(1)_$(2))
139+
rt/$(1)/arch/$$(HOST_$(1))/libmorestack.a: $$(MORESTACK_OBJ_$(1))
145140
@$$(call E, link: $$@)
146141
$$(Q)$(AR_$(1)) rcs $$@ $$<
147142

148-
rt/$(1)/stage$(2)/$(CFG_RUNTIME_$(1)): $$(RUNTIME_OBJS_$(1)_$(2)) $$(MKFILE_DEPS) \
149-
$$(RUNTIME_DEF_$(1)_$(2)) \
150-
$$(RUNTIME_LIBS_$(1)_$(2))
143+
rt/$(1)/$(CFG_RUNTIME_$(1)): $$(RUNTIME_OBJS_$(1)) $$(MKFILE_DEPS) \
144+
$$(RUNTIME_DEF_$(1)) \
145+
$$(RUNTIME_LIBS_$(1))
151146
@$$(call E, link: $$@)
152-
$$(Q)$$(call CFG_LINK_CXX_$(1),$$@, $$(RUNTIME_OBJS_$(1)_$(2)) \
153-
$$(CFG_GCCISH_POST_LIB_FLAGS_$(1)) $$(RUNTIME_LIBS_$(1)_$(2)) \
154-
$$(CFG_LIBUV_LINK_FLAGS_$(1)),$$(RUNTIME_DEF_$(1)_$(2)),$$(CFG_RUNTIME_$(1)))
147+
$$(Q)$$(call CFG_LINK_CXX_$(1),$$@, $$(RUNTIME_OBJS_$(1)) \
148+
$$(CFG_GCCISH_POST_LIB_FLAGS_$(1)) $$(RUNTIME_LIBS_$(1)) \
149+
$$(CFG_LIBUV_LINK_FLAGS_$(1)),$$(RUNTIME_DEF_$(1)),$$(CFG_RUNTIME_$(1)))
155150

156151
# FIXME: For some reason libuv's makefiles can't figure out the
157152
# correct definition of CC on the mingw I'm using, so we are
@@ -170,32 +165,32 @@ endif
170165

171166
# XXX: Shouldn't need platform-specific conditions here
172167
ifdef CFG_WINDOWSY_$(1)
173-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
168+
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
174169
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
175-
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
170+
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/libuv" \
176171
OS=mingw \
177172
V=$$(VERBOSE)
178173
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
179-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
174+
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
180175
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
181176
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
182177
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
183178
CC="$$(CC_$(1))" \
184179
CXX="$$(CXX_$(1))" \
185180
AR="$$(AR_$(1))" \
186181
BUILDTYPE=Release \
187-
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
182+
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/libuv" \
188183
host=android OS=linux \
189184
V=$$(VERBOSE)
190185
else
191-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
186+
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
192187
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
193188
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
194189
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
195190
CC="$$(CC_$(1))" \
196191
CXX="$$(CXX_$(1))" \
197192
AR="$$(AR_$(1))" \
198-
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
193+
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/libuv" \
199194
V=$$(VERBOSE)
200195
endif
201196

@@ -234,6 +229,5 @@ endif
234229
endef
235230

236231
# Instantiate template for all stages
237-
$(foreach stage,$(STAGES), \
238-
$(foreach target,$(CFG_TARGET_TRIPLES), \
239-
$(eval $(call DEF_RUNTIME_TARGETS,$(target),$(stage)))))
232+
$(foreach target,$(CFG_TARGET_TRIPLES), \
233+
$(eval $(call DEF_RUNTIME_TARGETS,$(target))))

branches/try2/mk/target.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
define TARGET_STAGE_N
1919

2020
$$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a: \
21-
rt/$(2)/stage$(1)/arch/$$(HOST_$(2))/libmorestack.a \
21+
rt/$(2)/arch/$$(HOST_$(2))/libmorestack.a \
2222
| $$(TLIB$(1)_T_$(2)_H_$(3))/
2323
@$$(call E, cp: $$@)
2424
$$(Q)cp $$< $$@
2525

2626
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUNTIME_$(2)): \
27-
rt/$(2)/stage$(1)/$(CFG_RUNTIME_$(2)) \
27+
rt/$(2)/$(CFG_RUNTIME_$(2)) \
2828
| $$(TLIB$(1)_T_$(2)_H_$(3))/
2929
@$$(call E, cp: $$@)
3030
$$(Q)cp $$< $$@

branches/try2/src/compiletest/procsrv.rs

Lines changed: 69 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
use core::prelude::*;
1212

13+
use core::libc::c_int;
14+
use core::run::spawn_process;
1315
use core::run;
1416

1517
#[cfg(target_os = "win32")]
@@ -36,35 +38,86 @@ fn target_env(lib_path: &str, prog: &str) -> ~[(~str,~str)] {
3638
#[cfg(target_os = "macos")]
3739
#[cfg(target_os = "freebsd")]
3840
fn target_env(_lib_path: &str, _prog: &str) -> ~[(~str,~str)] {
39-
os::env()
41+
~[]
4042
}
4143
4244
pub struct Result {status: int, out: ~str, err: ~str}
4345
46+
// FIXME (#2659): This code is duplicated in core::run::program_output
4447
pub fn run(lib_path: &str,
4548
prog: &str,
4649
args: &[~str],
4750
env: ~[(~str, ~str)],
4851
input: Option<~str>) -> Result {
52+
let pipe_in = os::pipe();
53+
let pipe_out = os::pipe();
54+
let pipe_err = os::pipe();
55+
let pid = spawn_process(prog, args,
56+
&Some(env + target_env(lib_path, prog)),
57+
&None, pipe_in.in, pipe_out.out, pipe_err.out);
58+
59+
os::close(pipe_in.in);
60+
os::close(pipe_out.out);
61+
os::close(pipe_err.out);
62+
if pid == -1i32 {
63+
os::close(pipe_in.out);
64+
os::close(pipe_out.in);
65+
os::close(pipe_err.in);
66+
fail!();
67+
}
4968
50-
let env = env + target_env(lib_path, prog);
51-
let mut proc = run::Process::new(prog, args, run::ProcessOptions {
52-
env: Some(env.slice(0, env.len())),
53-
dir: None,
54-
in_fd: None,
55-
out_fd: None,
56-
err_fd: None
57-
});
5869
59-
for input.each |input| {
60-
proc.input().write_str(*input);
70+
writeclose(pipe_in.out, input);
71+
let p = comm::PortSet::new();
72+
let ch = p.chan();
73+
do task::spawn_sched(task::SingleThreaded) || {
74+
let errput = readclose(pipe_err.in);
75+
ch.send((2, errput));
6176
}
62-
let output = proc.finish_with_output();
77+
let ch = p.chan();
78+
do task::spawn_sched(task::SingleThreaded) || {
79+
let output = readclose(pipe_out.in);
80+
ch.send((1, output));
81+
}
82+
let status = run::waitpid(pid);
83+
let mut errs = ~"";
84+
let mut outs = ~"";
85+
let mut count = 2;
86+
while count > 0 {
87+
match p.recv() {
88+
(1, s) => {
89+
outs = s;
90+
}
91+
(2, s) => {
92+
errs = s;
93+
}
94+
_ => { fail!() }
95+
};
96+
count -= 1;
97+
};
98+
return Result {status: status, out: outs, err: errs};
99+
}
63100
64-
Result {
65-
status: output.status,
66-
out: str::from_bytes(output.output),
67-
err: str::from_bytes(output.error)
101+
fn writeclose(fd: c_int, s: Option<~str>) {
102+
if s.is_some() {
103+
let writer = io::fd_writer(fd, false);
104+
writer.write_str(s.get());
68105
}
106+
107+
os::close(fd);
69108
}
70109
110+
fn readclose(fd: c_int) -> ~str {
111+
unsafe {
112+
// Copied from run::program_output
113+
let file = os::fdopen(fd);
114+
let reader = io::FILE_reader(file, false);
115+
let mut buf = ~"";
116+
while !reader.eof() {
117+
let bytes = reader.read_bytes(4096u);
118+
str::push_str(&mut buf, str::from_bytes(bytes));
119+
}
120+
os::fclose(file);
121+
return buf;
122+
}
123+
}

branches/try2/src/etc/ctags.rust

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
--regex-rust=/[ \t]*type[ \t]+([a-zA-Z0-9_]+)/\1/T,types/
55
--regex-rust=/[ \t]*enum[ \t]+([a-zA-Z0-9_]+)/\1/T,types/
66
--regex-rust=/[ \t]*struct[ \t]+([a-zA-Z0-9_]+)/\1/m,types/
7+
--regex-rust=/[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\1/m,types/
78
--regex-rust=/[ \t]*mod[ \t]+([a-zA-Z0-9_]+)/\1/m,modules/
8-
--regex-rust=/[ \t]*static[ \t]+([a-zA-Z0-9_]+)/\1/m,consts/
9+
--regex-rust=/[ \t]*const[ \t]+([a-zA-Z0-9_]+)/\1/m,consts/
910
--regex-rust=/[ \t]*trait[ \t]+([a-zA-Z0-9_]+)/\1/m,traits/
1011
--regex-rust=/[ \t]*impl[ \t]+([a-zA-Z0-9_]+)/\1/m,impls/
12+
--regex-rust=/[ \t]*impl[ \t]+of[ \t]([a-zA-Z0-9_]+)/\1/m,impls/

0 commit comments

Comments
 (0)