Skip to content

Commit cf49ad7

Browse files
committed
---
yaml --- r: 104170 b: refs/heads/try c: cc34dbb h: refs/heads/master v: v3
1 parent c419dfb commit cf49ad7

File tree

213 files changed

+4103
-3545
lines changed

Some content is hidden

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

213 files changed

+4103
-3545
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: 62f1d68439dcfd509eaca29887afa97f22938373
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
5-
refs/heads/try: 2fe7bfe4d2de9942449d3656317e66bc9ec50204
5+
refs/heads/try: cc34dbb84090f74c84037afb269003f13aa46b78
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/Makefile.in

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@ ifdef TRACE
125125
CFG_RUSTC_FLAGS += -Z trace
126126
endif
127127
ifdef CFG_DISABLE_RPATH
128-
CFG_RUSTC_FLAGS += -C no-rpath
128+
# NOTE: make this CFG_RUSTC_FLAGS after stage0 snapshot
129+
RUSTFLAGS_STAGE1 += -C no-rpath
130+
RUSTFLAGS_STAGE2 += -C no-rpath
131+
RUSTFLAGS_STAGE3 += -C no-rpath
129132
endif
130133

131134
# The executables crated during this compilation process have no need to include
@@ -137,7 +140,8 @@ endif
137140
# snapshot will be generated with a statically linked rustc so we only have to
138141
# worry about the distribution of one file (with its native dynamic
139142
# dependencies)
140-
RUSTFLAGS_STAGE0 += -C prefer-dynamic
143+
#
144+
# NOTE: after a snapshot (stage0), put this on stage0 as well
141145
RUSTFLAGS_STAGE1 += -C prefer-dynamic
142146

143147
# platform-specific auto-configuration

branches/try/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ TOOLS := compiletest rustdoc rustc
5757

5858
DEPS_std := native:rustrt native:compiler-rt
5959
DEPS_extra := std term sync serialize getopts collections
60-
DEPS_green := std native:context_switch
60+
DEPS_green := std
6161
DEPS_rustuv := std native:uv native:uv_support
6262
DEPS_native := std
6363
DEPS_syntax := std extra term serialize collections

branches/try/mk/dist.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ PKG_ICO = $(S)src/etc/pkg/rust-logo.ico
1212
PKG_EXE = $(PKG_DIR)-install.exe
1313
endif
1414

15-
PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp $(S)src/compiler-rt
15+
PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp
1616

1717
PKG_FILES := \
1818
$(S)COPYRIGHT \

branches/try/mk/rt.mk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# that's per-target so you're allowed to conditionally add files based on the
3636
# target.
3737
################################################################################
38-
NATIVE_LIBS := rustrt sundown uv_support morestack miniz context_switch
38+
NATIVE_LIBS := rustrt sundown uv_support morestack miniz
3939

4040
# $(1) is the target triple
4141
define NATIVE_LIBRARIES
@@ -54,10 +54,9 @@ NATIVE_DEPS_rustrt_$(1) := rust_builtin.c \
5454
rust_android_dummy.c \
5555
rust_test_helpers.c \
5656
rust_try.ll \
57+
arch/$$(HOST_$(1))/_context.S \
5758
arch/$$(HOST_$(1))/record_sp.S
5859
NATIVE_DEPS_morestack_$(1) := arch/$$(HOST_$(1))/morestack.S
59-
NATIVE_DEPS_context_switch_$(1) := \
60-
arch/$$(HOST_$(1))/_context.S
6160

6261
################################################################################
6362
# You shouldn't find it that necessary to edit anything below this line.

branches/try/mk/tests.mk

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -333,22 +333,21 @@ $(foreach host,$(CFG_HOST), \
333333

334334
define TEST_RUNNER
335335

336-
# If NO_REBUILD is set then break the dependencies on everything but
337-
# the source files so we can test crates without rebuilding any of the
338-
# parent crates.
336+
# If NO_REBUILD is set then break the dependencies on extra so we can
337+
# test crates without rebuilding std and extra first
339338
ifeq ($(NO_REBUILD),)
340-
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
339+
STDTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
341340
$$(foreach crate,$$(TARGET_CRATES),\
342-
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
343-
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4))
341+
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate))
344342
else
345-
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
343+
STDTESTDEP_$(1)_$(2)_$(3)_$(4) =
346344
endif
347345

348346
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): CFG_COMPILER = $(2)
349347
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
350-
$$(CRATEFILE_$(4)) \
351-
$$(TESTDEP_$(1)_$(2)_$(3)_$(4))
348+
$$(CRATEFILE_$(4)) \
349+
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
350+
$$(STDTESTDEP_$(1)_$(2)_$(3)_$(4))
352351
@$$(call E, oxidize: $$@)
353352
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test \
354353
-L "$$(RT_OUTPUT_DIR_$(2))" \
@@ -685,22 +684,13 @@ $(foreach host,$(CFG_HOST), \
685684

686685
define DEF_CRATE_DOC_TEST
687686

688-
# If NO_REBUILD is set then break the dependencies on everything but
689-
# the source files so we can test crate documentation without
690-
# rebuilding any of the parent crates.
691-
ifeq ($(NO_REBUILD),)
692-
DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = \
693-
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
694-
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
695-
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3))
696-
else
697-
DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
698-
endif
699-
700687
check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4))
701688

702689
ifeq ($(2),$$(CFG_BUILD))
703-
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): $$(DOCTESTDEP_$(1)_$(2)_$(3)_$(4))
690+
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): \
691+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
692+
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
693+
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3))
704694
@$$(call E, run doc-$(4) [$(2)])
705695
$$(Q)$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) --test \
706696
$$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && touch $$@

branches/try/src/compiletest/compiletest.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,12 @@ pub fn run_tests(config: &config) {
219219
mode_debug_info => {
220220
println!("arm-linux-androideabi debug-info \
221221
test uses tcp 5039 port. please reserve it");
222+
//arm-linux-androideabi debug-info test uses remote debugger
223+
//so, we test 1 task at once
224+
os::setenv("RUST_TEST_TASKS","1");
222225
}
223226
_ =>{}
224227
}
225-
226-
//arm-linux-androideabi debug-info test uses remote debugger
227-
//so, we test 1 task at once.
228-
// also trying to isolate problems with adb_run_wrapper.sh ilooping
229-
os::setenv("RUST_TEST_TASKS","1");
230228
}
231229

232230
let opts = test_opts(config);

branches/try/src/doc/guide-ffi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl<T: Send> Unique<T> {
195195
pub fn new(value: T) -> Unique<T> {
196196
unsafe {
197197
let ptr = malloc(std::mem::size_of::<T>() as size_t) as *mut T;
198-
assert!(!ptr.is_null());
198+
assert!(!ptr::is_null(ptr));
199199
// `*ptr` is uninitialized, and `*ptr = value` would attempt to destroy it
200200
// move_val_init moves a value into this memory without
201201
// attempting to drop the original value.

branches/try/src/doc/rust.md

Lines changed: 10 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,95 +1725,31 @@ mod bar {
17251725
pub type int8_t = i8;
17261726
~~~~
17271727

1728-
> **Note:** In future versions of Rust, user-provided extensions to the compiler
1729-
> will be able to interpret attributes. When this facility is provided, the
1730-
> compiler will distinguish between language-reserved and user-available
1731-
> attributes.
1728+
> **Note:** In future versions of Rust, user-provided extensions to the compiler will be able to interpret attributes.
1729+
> When this facility is provided, the compiler will distinguish between language-reserved and user-available attributes.
17321730
1733-
At present, only the Rust compiler interprets attributes, so all attribute names
1734-
are effectively reserved. Some significant attributes include:
1731+
At present, only the Rust compiler interprets attributes, so all attribute
1732+
names are effectively reserved. Some significant attributes include:
17351733

17361734
* The `doc` attribute, for documenting code in-place.
1737-
* The `cfg` attribute, for conditional-compilation by build-configuration (see
1738-
[Conditional compilation](#conditional-compilation)).
1735+
* The `cfg` attribute, for conditional-compilation by build-configuration.
17391736
* The `crate_id` attribute, for describing the package ID of a crate.
17401737
* The `lang` attribute, for custom definitions of traits and functions that are
17411738
known to the Rust compiler (see [Language items](#language-items)).
17421739
* The `link` attribute, for describing linkage metadata for a extern blocks.
17431740
* The `test` attribute, for marking functions as unit tests.
17441741
* The `allow`, `warn`, `forbid`, and `deny` attributes, for
17451742
controlling lint checks (see [Lint check attributes](#lint-check-attributes)).
1746-
* The `deriving` attribute, for automatically generating implementations of
1747-
certain traits.
1743+
* The `deriving` attribute, for automatically generating
1744+
implementations of certain traits.
17481745
* The `inline` attribute, for expanding functions at caller location (see
17491746
[Inline attributes](#inline-attributes)).
1750-
* The `static_assert` attribute, for asserting that a static bool is true at
1751-
compiletime.
1752-
* The `thread_local` attribute, for defining a `static mut` as a thread-local.
1753-
Note that this is only a low-level building block, and is not local to a
1754-
*task*, nor does it provide safety.
1747+
* The `static_assert` attribute, for asserting that a static bool is true at compiletime
1748+
* The `thread_local` attribute, for defining a `static mut` as a thread-local. Note that this is
1749+
only a low-level building block, and is not local to a *task*, nor does it provide safety.
17551750

17561751
Other attributes may be added or removed during development of the language.
17571752

1758-
### Conditional compilation
1759-
1760-
Sometimes one wants to have different compiler outputs from the same code,
1761-
depending on build target, such as targeted operating system, or to enable
1762-
release builds.
1763-
1764-
There are two kinds of configuration options, one that is either defined or not
1765-
(`#[cfg(foo)]`), and the other that contains a string that can be checked
1766-
against (`#[cfg(bar = "baz")]` (currently only compiler-defined configuration
1767-
options can have the latter form).
1768-
1769-
~~~~
1770-
// The function is only included in the build when compiling for OSX
1771-
#[cfg(target_os = "macos")]
1772-
fn macos_only() {
1773-
// ...
1774-
}
1775-
1776-
// This function is only included when either foo or bar is defined
1777-
#[cfg(foo)]
1778-
#[cfg(bar)]
1779-
fn needs_foo_or_bar() {
1780-
// ...
1781-
}
1782-
1783-
// This function is only included when compiling for a unixish OS with a 32-bit
1784-
// architecture
1785-
#[cfg(unix, target_word_size = "32")]
1786-
fn on_32bit_unix() {
1787-
// ...
1788-
}
1789-
~~~~
1790-
1791-
This illustrates some conditional compilation can be achieved using the
1792-
`#[cfg(...)]` attribute. Note that `#[cfg(foo, bar)]` is a condition that needs
1793-
both `foo` and `bar` to be defined while `#[cfg(foo)] #[cfg(bar)]` only needs
1794-
one of `foo` and `bar` to be defined (this resembles in the disjunctive normal
1795-
form). Additionally, one can reverse a condition by enclosing it in a
1796-
`not(...)`, like e. g. `#[cfg(not(target_os = "win32"))]`.
1797-
1798-
To pass a configuration option which triggers a `#[cfg(identifier)]` one can use
1799-
`rustc --cfg identifier`. In addition to that, the following configurations are
1800-
pre-defined by the compiler:
1801-
1802-
* `target_arch = "..."`. Target CPU architecture, such as `"x86"`, `"x86_64"`
1803-
`"mips"`, or `"arm"`.
1804-
* `target_endian = "..."`. Endianness of the target CPU, either `"little"` or
1805-
`"big"`.
1806-
* `target_family = "..."`. Operating system family of the target, e. g.
1807-
`"unix"` or `"windows"`. The value of this configuration option is defined as
1808-
a configuration itself, like `unix` or `windows`.
1809-
* `target_os = "..."`. Operating system of the target, examples include
1810-
`"win32"`, `"macos"`, `"linux"`, `"android"` or `"freebsd"`.
1811-
* `target_word_size = "..."`. Target word size in bits. This is set to `"32"`
1812-
for 32-bit CPU targets, and likewise set to `"64"` for 64-bit CPU targets.
1813-
* `test`. Only set in test builds (`rustc --test`).
1814-
* `unix`. See `target_family`.
1815-
* `windows`. See `target_family`.
1816-
18171753
### Lint check attributes
18181754

18191755
A lint check names a potentially undesirable coding pattern, such as

branches/try/src/doc/tutorial.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ braced block gives the whole block the value of that last expression.
293293

294294
Put another way, the semicolon in Rust *ignores the value of an expression*.
295295
Thus, if the branches of the `if` had looked like `{ 4; }`, the above example
296-
would simply assign `()` (unit or void) to `price`. But without the semicolon, each
296+
would simply assign `()` (nil or void) to `price`. But without the semicolon, each
297297
branch has a different value, and `price` gets the value of the branch that
298298
was taken.
299299

@@ -352,7 +352,7 @@ before the opening and after the closing quote, and can contain any sequence of
352352
characters except their closing delimiter. More on strings
353353
[later](#vectors-and-strings).
354354

355-
The unit type, written `()`, has a single value, also written `()`.
355+
The nil type, written `()`, has a single value, also written `()`.
356356

357357
## Operators
358358

@@ -852,7 +852,7 @@ fn line(a: int, b: int, x: int) -> int {
852852
It's better Rust style to write a return value this way instead of
853853
writing an explicit `return`. The utility of `return` comes in when
854854
returning early from a function. Functions that do not return a value
855-
are said to return unit, `()`, and both the return type and the return
855+
are said to return nil, `()`, and both the return type and the return
856856
value may be omitted from the definition. The following two functions
857857
are equivalent.
858858

branches/try/src/etc/adb_run_wrapper.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# usage : adb_run_wrapper [test dir - where test executables exist] [test executable]
33
#
44

5+
# Sometimes android shell produce exitcode "1 : Text File Busy"
6+
# Retry after $WAIT seconds, expecting resource cleaned-up
7+
WAIT=10
58
TEST_PATH=$1
69
BIN_PATH=/system/bin
710
if [ -d "$TEST_PATH" ]
@@ -13,9 +16,20 @@ then
1316
then
1417
shift
1518

19+
L_RET=1
20+
L_COUNT=0
1621
cd $TEST_PATH
17-
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
18-
L_RET=$?
22+
while [ $L_RET -eq 1 ]
23+
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
25+
L_RET=$?
26+
if [ $L_COUNT -gt 0 ]
27+
then
28+
/system/bin/sleep $WAIT
29+
/system/bin/sync
30+
fi
31+
L_COUNT=$((L_COUNT+1))
32+
done
1933

2034
echo $L_RET > $TEST_PATH/$RUN.exitcode
2135

branches/try/src/libarena/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ use std::cast::{transmute, transmute_mut, transmute_mut_region};
3333
use std::cast;
3434
use std::cell::{Cell, RefCell};
3535
use std::mem;
36-
use std::cmp;
3736
use std::num;
37+
use std::ptr;
3838
use std::kinds::marker;
3939
use std::rc::Rc;
4040
use std::rt::global_heap;
@@ -144,7 +144,7 @@ unsafe fn destroy_chunk(chunk: &Chunk) {
144144
let fill = chunk.fill.get();
145145

146146
while idx < fill {
147-
let tydesc_data: *uint = transmute(buf.offset(idx as int));
147+
let tydesc_data: *uint = transmute(ptr::offset(buf, idx as int));
148148
let (tydesc, is_done) = un_bitpack_tydesc_ptr(*tydesc_data);
149149
let (size, align) = ((*tydesc).size, (*tydesc).align);
150150

@@ -155,7 +155,7 @@ unsafe fn destroy_chunk(chunk: &Chunk) {
155155
//debug!("freeing object: idx = {}, size = {}, align = {}, done = {}",
156156
// start, size, align, is_done);
157157
if is_done {
158-
((*tydesc).drop_glue)(buf.offset(start as int) as *i8);
158+
((*tydesc).drop_glue)(ptr::offset(buf, start as int) as *i8);
159159
}
160160

161161
// Find where the next tydesc lives
@@ -184,7 +184,7 @@ impl Arena {
184184
// Functions for the POD part of the arena
185185
fn alloc_pod_grow(&mut self, n_bytes: uint, align: uint) -> *u8 {
186186
// Allocate a new chunk.
187-
let new_min_chunk_size = cmp::max(n_bytes, self.chunk_size());
187+
let new_min_chunk_size = num::max(n_bytes, self.chunk_size());
188188
self.chunks.set(@Cons(self.pod_head.clone(), self.chunks.get()));
189189
self.pod_head =
190190
chunk(num::next_power_of_two(new_min_chunk_size + 1u), true);
@@ -224,7 +224,7 @@ impl Arena {
224224
fn alloc_nonpod_grow(&mut self, n_bytes: uint, align: uint)
225225
-> (*u8, *u8) {
226226
// Allocate a new chunk.
227-
let new_min_chunk_size = cmp::max(n_bytes, self.chunk_size());
227+
let new_min_chunk_size = num::max(n_bytes, self.chunk_size());
228228
self.chunks.set(@Cons(self.head.clone(), self.chunks.get()));
229229
self.head =
230230
chunk(num::next_power_of_two(new_min_chunk_size + 1u), false);
@@ -261,7 +261,7 @@ impl Arena {
261261
// start, n_bytes, align, head.fill);
262262

263263
let buf = self.head.as_ptr();
264-
return (buf.offset(tydesc_start as int), buf.offset(start as int));
264+
return (ptr::offset(buf, tydesc_start as int), ptr::offset(buf, start as int));
265265
}
266266
}
267267

0 commit comments

Comments
 (0)