Skip to content

Commit f147395

Browse files
committed
---
yaml --- r: 77682 b: refs/heads/master c: c921331 h: refs/heads/master v: v3
1 parent 32a25ef commit f147395

File tree

243 files changed

+3999
-5663
lines changed

Some content is hidden

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

243 files changed

+3999
-5663
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: 5fc211accf9b08d2e5dd8edd3c52d484e3910499
2+
refs/heads/master: c9213312951516abe66716ed11b7ea81ade572e6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 60fba4d7d677ec098e6a43014132fe99f7547363
55
refs/heads/try: ebfe63cd1c0b5d23f7ea60c69b4fde2e30cfd42a

trunk/.gitattributes

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@ src/rt/msvc/* -whitespace
88
src/rt/vg/* -whitespace
99
src/rt/linenoise/* -whitespace
1010
src/rt/jemalloc/**/* -whitespace
11-
src/rt/jemalloc/include/jemalloc/jemalloc.h.in text eol=lf
12-
src/rt/jemalloc/include/jemalloc/jemalloc_defs.h.in text eol=lf
13-
src/rt/jemalloc/include/jemalloc/internal/jemalloc_internal.h.in text eol=lf

trunk/Makefile.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ ifdef CFG_DISABLE_OPTIMIZE
9696
$(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
9797
CFG_RUSTC_FLAGS +=
9898
else
99-
# The rtopt cfg turns off runtime sanity checks
100-
CFG_RUSTC_FLAGS += -O --cfg rtopt
99+
CFG_RUSTC_FLAGS += -O
101100
endif
102101

103102
ifdef CFG_ENABLE_DEBUG

trunk/doc/rust.md

Lines changed: 11 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -851,38 +851,6 @@ In this example, the module `quux` re-exports all of the public names defined in
851851

852852
Also note that the paths contained in `use` items are relative to the crate root.
853853
So, in the previous example, the `use` refers to `quux::foo::*`, and not simply to `foo::*`.
854-
This also means that top-level module declarations should be at the crate root if direct usage
855-
of the declared modules within `use` items is desired. It is also possible to use `self` and `super`
856-
at the beginning of a `use` item to refer to the current and direct parent modules respectively.
857-
All rules regarding accessing declared modules in `use` declarations applies to both module declarations
858-
and `extern mod` declarations.
859-
860-
An example of what will and will not work for `use` items:
861-
~~~~
862-
# #[allow(unused_imports)];
863-
use foo::extra; // good: foo is at the root of the crate
864-
use foo::baz::foobaz; // good: foo is at the root of the crate
865-
866-
mod foo {
867-
extern mod extra;
868-
869-
use foo::extra::list; // good: foo is at crate root
870-
// use extra::*; // bad: extra is not at the crate root
871-
use self::baz::foobaz; // good: self refers to module 'foo'
872-
use foo::bar::foobar; // good: foo is at crate root
873-
874-
pub mod bar {
875-
pub fn foobar() { }
876-
}
877-
878-
pub mod baz {
879-
use super::bar::foobar; // good: super refers to module 'foo'
880-
pub fn foobaz() { }
881-
}
882-
}
883-
884-
fn main() {}
885-
~~~~
886854

887855
### Functions
888856

@@ -1038,25 +1006,20 @@ code_. They are defined in the same way as any other Rust function,
10381006
except that they have the `extern` modifier.
10391007

10401008
~~~
1041-
// Declares an extern fn, the ABI defaults to "C"
10421009
extern fn new_vec() -> ~[int] { ~[] }
1043-
1044-
// Declares an extern fn with "stdcall" ABI
1045-
extern "stdcall" fn new_vec_stdcall() -> ~[int] { ~[] }
10461010
~~~
10471011

1048-
Unlike normal functions, extern fns have an `extern "ABI" fn()`.
1049-
This is the same type as the functions declared in an extern
1050-
block.
1012+
Extern functions may not be called from Rust code,
1013+
but Rust code may take their value as a raw `u8` pointer.
10511014

10521015
~~~
10531016
# extern fn new_vec() -> ~[int] { ~[] }
1054-
let fptr: extern "C" fn() -> ~[int] = new_vec;
1017+
let fptr: *u8 = new_vec;
10551018
~~~
10561019

1057-
Extern functions may be called from Rust code, but
1058-
caution must be taken with respect to the size of the stack
1059-
segment, just as when calling an extern function normally.
1020+
The primary motivation for extern functions is
1021+
to create callbacks for foreign functions that expect to receive function
1022+
pointers.
10601023

10611024
### Type definitions
10621025

@@ -1421,13 +1384,14 @@ between the Rust ABI and the foreign ABI.
14211384
A number of [attributes](#attributes) control the behavior of external
14221385
blocks.
14231386

1424-
By default external blocks assume that the library they are calling
1425-
uses the standard C "cdecl" ABI. Other ABIs may be specified using
1426-
an `abi` string, as shown here:
1387+
By default external blocks assume
1388+
that the library they are calling uses the standard C "cdecl" ABI.
1389+
Other ABIs may be specified using the `abi` attribute as in
14271390

14281391
~~~{.xfail-test}
14291392
// Interface to the Windows API
1430-
extern "stdcall" { }
1393+
#[abi = "stdcall"]
1394+
extern { }
14311395
~~~
14321396

14331397
The `link_name` attribute allows the name of the library to be specified.
@@ -1443,12 +1407,6 @@ This is particularly useful for creating external blocks for libc,
14431407
which tends to not follow standard library naming conventions
14441408
and is linked to all Rust programs anyway.
14451409

1446-
The type of a function
1447-
declared in an extern block
1448-
is `extern "abi" fn(A1, ..., An) -> R`,
1449-
where `A1...An` are the declared types of its arguments
1450-
and `R` is the decalred return type.
1451-
14521410
## Attributes
14531411

14541412
~~~~~~~~{.ebnf .gram}

trunk/doc/tutorial-container.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,6 @@ assert_eq!(sum, 57);
160160
161161
## For loops
162162
163-
The function `range` (or `range_inclusive`) allows to simply iterate through a given range:
164-
165-
~~~
166-
for i in range(0, 5) {
167-
printf!("%d ", i) // prints "0 1 2 3 4"
168-
}
169-
170-
for i in std::iterator::range_inclusive(0, 5) { // needs explicit import
171-
printf!("%d ", i) // prints "0 1 2 3 4 5"
172-
}
173-
~~~
174-
175163
The `for` keyword can be used as sugar for iterating through any iterator:
176164
177165
~~~

trunk/doc/tutorial-ffi.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,9 @@ prefer using raw pointers (`*`) if that's needed because the compiler can't make
445445
about them.
446446

447447
Vectors and strings share the same basic memory layout, and utilities are available in the `vec` and
448-
`str` modules for working with C APIs. However, strings are not terminated with `\0`. If you need a
449-
NUL-terminated string for interoperability with C, you should use the `c_str::to_c_str` function.
448+
`str` modules for working with C APIs. Strings are terminated with `\0` for interoperability with C,
449+
but it should not be assumed because a slice will not always be nul-terminated. Instead, the
450+
`str::as_c_str` function should be used.
450451

451452
The standard library includes type aliases and function definitions for the C standard library in
452453
the `libc` module, and Rust links against `libc` and `libm` by default.

trunk/doc/tutorial.md

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,7 +1864,7 @@ so you could not apply `head` to a type
18641864
that does not implement `Clone`.
18651865

18661866
While most traits can be defined and implemented by user code,
1867-
three traits are automatically derived and implemented
1867+
two traits are automatically derived and implemented
18681868
for all applicable types by the compiler,
18691869
and may not be overridden:
18701870

@@ -1877,12 +1877,6 @@ These are types that do not contain anything intrinsically mutable.
18771877
Intrinsically mutable values include `@mut`
18781878
and `Cell` in the standard library.
18791879

1880-
* `'static` - Non-borrowed types.
1881-
These are types that do not contain any data whose lifetime is bound to
1882-
a particular stack frame. These are types that do not contain any
1883-
borrowed pointers, or types where the only contained borrowed pointers
1884-
have the `'static` lifetime.
1885-
18861880
> ***Note:*** These two traits were referred to as 'kinds' in earlier
18871881
> iterations of the language, and often still are.
18881882
@@ -2141,30 +2135,6 @@ select the method to call at runtime.
21412135

21422136
This usage of traits is similar to Java interfaces.
21432137

2144-
By default, each of the three storage classes for traits enforce a
2145-
particular set of built-in kinds that their contents must fulfill in
2146-
order to be packaged up in a trait object of that storage class.
2147-
2148-
* The contents of owned traits (`~Trait`) must fulfill the `Send` bound.
2149-
* The contents of managed traits (`@Trait`) must fulfill the `'static` bound.
2150-
* The contents of borrowed traits (`&Trait`) are not constrained by any bound.
2151-
2152-
Consequently, the trait objects themselves automatically fulfill their
2153-
respective kind bounds. However, this default behavior can be overridden by
2154-
specifying a list of bounds on the trait type, for example, by writing `~Trait:`
2155-
(which indicates that the contents of the owned trait need not fulfill any
2156-
bounds), or by writing `~Trait:Send+Freeze`, which indicates that in addition
2157-
to fulfilling `Send`, contents must also fulfill `Freeze`, and as a consequence,
2158-
the trait itself fulfills `Freeze`.
2159-
2160-
* `~Trait:Send` is equivalent to `~Trait`.
2161-
* `@Trait:'static` is equivalent to `@Trait`.
2162-
* `&Trait:` is equivalent to `&Trait`.
2163-
2164-
Builtin kind bounds can also be specified on closure types in the same way (for
2165-
example, by writing `fn:Freeze()`), and the default behaviours are the same as
2166-
for traits of the same storage class.
2167-
21682138
## Trait inheritance
21692139

21702140
We can write a trait declaration that _inherits_ from other traits, called _supertraits_.

trunk/mk/llvm.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ifeq ($(CFG_LLVM_ROOT),)
2626

2727
$$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS)
2828
@$$(call E, make: llvm)
29-
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1))
29+
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV)
3030
$$(Q)touch $$(LLVM_CONFIG_$(1))
3131
endif
3232

trunk/mk/platform.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ endef
2626
$(foreach t,$(CFG_TARGET_TRIPLES),$(eval $(call DEF_OSTYPE_VAR,$(t))))
2727
$(foreach t,$(CFG_TARGET_TRIPLES),$(info cfg: os for $(t) is $(OSTYPE_$(t))))
2828

29-
CFG_GCCISH_CFLAGS += -DUSE_UTF8
29+
# FIXME: no-omit-frame-pointer is just so that task_start_wrapper
30+
# has a frame pointer and the stack walker can understand it. Turning off
31+
# frame pointers everywhere is overkill
32+
CFG_GCCISH_CFLAGS += -fno-omit-frame-pointer -DUSE_UTF8
3033

3134
# On Darwin, we need to run dsymutil so the debugging information ends
3235
# up in the right place. On other platforms, it automatically gets
@@ -150,6 +153,7 @@ CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-linux-gnu := -Wl,-no-whole-archive
150153
CFG_DEF_SUFFIX_x86_64-unknown-linux-gnu := .linux.def
151154
CFG_INSTALL_NAME_x86_64-unknown-linux-gnu =
152155
CFG_LIBUV_LINK_FLAGS_x86_64-unknown-linux-gnu =
156+
CFG_LLVM_BUILD_ENV_x86_64-unknown-linux-gnu="CXXFLAGS=-fno-omit-frame-pointer"
153157
CFG_EXE_SUFFIX_x86_64-unknown-linux-gnu =
154158
CFG_WINDOWSY_x86_64-unknown-linux-gnu :=
155159
CFG_UNIXY_x86_64-unknown-linux-gnu := 1
@@ -175,6 +179,7 @@ CFG_GCCISH_POST_LIB_FLAGS_i686-unknown-linux-gnu := -Wl,-no-whole-archive
175179
CFG_DEF_SUFFIX_i686-unknown-linux-gnu := .linux.def
176180
CFG_INSTALL_NAME_i686-unknown-linux-gnu =
177181
CFG_LIBUV_LINK_FLAGS_i686-unknown-linux-gnu =
182+
CFG_LLVM_BUILD_ENV_i686-unknown-linux-gnu="CXXFLAGS=-fno-omit-frame-pointer"
178183
CFG_EXE_SUFFIX_i686-unknown-linux-gnu =
179184
CFG_WINDOWSY_i686-unknown-linux-gnu :=
180185
CFG_UNIXY_i686-unknown-linux-gnu := 1

trunk/mk/rt.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ endif
6363
endif
6464

6565
RUNTIME_CXXS_$(1)_$(2) := \
66+
rt/sync/timer.cpp \
6667
rt/sync/lock_and_signal.cpp \
6768
rt/sync/rust_thread.cpp \
6869
rt/rust_builtin.cpp \
@@ -71,9 +72,13 @@ RUNTIME_CXXS_$(1)_$(2) := \
7172
rt/rust_upcall.cpp \
7273
rt/rust_uv.cpp \
7374
rt/rust_crate_map.cpp \
75+
rt/rust_gc_metadata.cpp \
76+
rt/rust_util.cpp \
7477
rt/rust_log.cpp \
78+
rt/rust_exchange_alloc.cpp \
7579
rt/isaac/randport.cpp \
7680
rt/miniz.cpp \
81+
rt/rust_abi.cpp \
7782
rt/memory_region.cpp \
7883
rt/boxed_region.cpp \
7984
rt/arch/$$(HOST_$(1))/context.cpp \

trunk/mk/tests.mk

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,16 @@ TEST_RATCHET_NOISE_PERCENT=10.0
7373

7474
# Whether to ratchet or merely save benchmarks
7575
ifdef CFG_RATCHET_BENCH
76-
CRATE_TEST_EXTRA_ARGS=\
76+
CRATE_TEST_BENCH_ARGS=\
7777
--test $(TEST_BENCH) \
7878
--ratchet-metrics $(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4)) \
7979
--ratchet-noise-percent $(TEST_RATCHET_NOISE_PERCENT)
8080
else
81-
CRATE_TEST_EXTRA_ARGS=\
81+
CRATE_TEST_BENCH_ARGS=\
8282
--test $(TEST_BENCH) \
8383
--save-metrics $(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4))
8484
endif
8585

86-
# If we're sharding the testsuite between parallel testers,
87-
# pass this argument along to the compiletest and crate test
88-
# invocations.
89-
ifdef TEST_SHARD
90-
CTEST_TESTARGS += --test-shard=$(TEST_SHARD)
91-
CRATE_TEST_EXTRA_ARGS += --test-shard=$(TEST_SHARD)
92-
endif
93-
9486
define DEF_TARGET_COMMANDS
9587

9688
ifdef CFG_UNIXY_$(1)
@@ -152,9 +144,8 @@ CFG_ADB_TEST_DIR=/data/tmp
152144

153145
$(info check: android device test dir $(CFG_ADB_TEST_DIR) ready \
154146
$(shell adb remount 1>/dev/null) \
155-
$(shell adb shell rm -r $(CFG_ADB_TEST_DIR) >/dev/null) \
156-
$(shell adb shell mkdir $(CFG_ADB_TEST_DIR)) \
157-
$(shell adb shell mkdir $(CFG_ADB_TEST_DIR)/tmp) \
147+
$(shell adb shell mkdir $(CFG_ADB_TEST_DIR) 1>/dev/null) \
148+
$(shell adb shell rm -rf $(CFG_ADB_TEST_DIR)/* 1>/dev/null) \
158149
$(shell adb push $(S)src/etc/adb_run_wrapper.sh $(CFG_ADB_TEST_DIR) 1>/dev/null) \
159150
$(shell adb push $(CFG_ANDROID_CROSS_PATH)/arm-linux-androideabi/lib/armv7-a/libgnustl_shared.so \
160151
$(CFG_ADB_TEST_DIR) 1>/dev/null) \
@@ -248,8 +239,6 @@ tidy:
248239
@$(call E, check: formatting)
249240
$(Q)find $(S)src -name '*.r[sc]' \
250241
| grep '^$(S)src/test' -v \
251-
| grep '^$(S)src/libuv' -v \
252-
| grep '^$(S)src/llvm' -v \
253242
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
254243
$(Q)find $(S)src/etc -name '*.py' \
255244
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
@@ -409,7 +398,7 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
409398
@$$(call E, run: $$<)
410399
$$(Q)$$(call CFG_RUN_TEST_$(2),$$<,$(2),$(3)) $$(TESTARGS) \
411400
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
412-
$$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)) \
401+
$$(call CRATE_TEST_BENCH_ARGS,$(1),$(2),$(3),$(4)) \
413402
&& touch $$@
414403
endef
415404

@@ -420,16 +409,14 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
420409
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
421410
@$$(call E, run: $$< via adb)
422411
@$(CFG_ADB) push $$< $(CFG_ADB_TEST_DIR)
423-
@$(CFG_ADB) shell '(cd $(CFG_ADB_TEST_DIR); LD_LIBRARY_PATH=. \
424-
./$$(notdir $$<) \
425-
--logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log \
426-
$$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)))' \
427-
> tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
412+
@$(CFG_ADB) shell LD_LIBRARY_PATH=$(CFG_ADB_TEST_DIR) \
413+
$(CFG_ADB_TEST_DIR)/`echo $$< | sed 's/.*\///'` \
414+
--logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log > \
415+
tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
428416
@cat tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
429417
@touch tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
430418
@$(CFG_ADB) pull $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log tmp/
431419
@$(CFG_ADB) shell rm $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
432-
@$(CFG_ADB) pull $(CFG_ADB_TEST_DIR)/$$(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4)) tmp/
433420
@if grep -q "result: ok" tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
434421
then \
435422
rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \

trunk/src/compiletest/common.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ pub struct config {
6868
// Percent change in metrics to consider noise
6969
ratchet_noise_percent: Option<f64>,
7070

71-
// "Shard" of the testsuite to run: this has the form of
72-
// two numbers (a,b), and causes only those tests with
73-
// positional order equal to a mod b to run.
74-
test_shard: Option<(uint,uint)>,
75-
7671
// A command line to prefix program execution with,
7772
// for running under valgrind
7873
runtool: Option<~str>,

trunk/src/compiletest/compiletest.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ pub fn parse_config(args: ~[~str]) -> config {
7575
optopt("", "target", "the target to build for", "TARGET"),
7676
optopt("", "adb-path", "path to the android debugger", "PATH"),
7777
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
78-
optopt("", "test-shard", "run shard A, of B shards, worth of the testsuite", "A.B"),
7978
optflag("h", "help", "show this message"),
8079
];
8180

@@ -149,7 +148,6 @@ pub fn parse_config(args: ~[~str]) -> config {
149148
~"") { true }
150149
else { false }
151150
} else { false },
152-
test_shard: test::opt_shard(getopts::opt_maybe_str(matches, "test-shard")),
153151
verbose: getopts::opt_present(matches, "verbose")
154152
}
155153
}
@@ -174,10 +172,6 @@ pub fn log_config(config: &config) {
174172
logv(c, fmt!("adb_path: %s", config.adb_path));
175173
logv(c, fmt!("adb_test_dir: %s", config.adb_test_dir));
176174
logv(c, fmt!("adb_device_status: %b", config.adb_device_status));
177-
match config.test_shard {
178-
None => logv(c, ~"test_shard: (all)"),
179-
Some((a,b)) => logv(c, fmt!("test_shard: %u.%u", a, b))
180-
}
181175
logv(c, fmt!("verbose: %b", config.verbose));
182176
logv(c, fmt!("\n"));
183177
}
@@ -240,7 +234,6 @@ pub fn test_opts(config: &config) -> test::TestOpts {
240234
ratchet_metrics: config.ratchet_metrics.clone(),
241235
ratchet_noise_percent: config.ratchet_noise_percent.clone(),
242236
save_metrics: config.save_metrics.clone(),
243-
test_shard: config.test_shard.clone()
244237
}
245238
}
246239

0 commit comments

Comments
 (0)