Skip to content

Commit cdea1a9

Browse files
committed
---
yaml --- r: 104175 b: refs/heads/try c: d40b537 h: refs/heads/master i: 104173: 65a81cf 104171: 50b1ef3 104167: 3d5c061 104159: 0b41544 v: v3
1 parent e39c8ce commit cdea1a9

File tree

204 files changed

+3662
-4075
lines changed

Some content is hidden

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

204 files changed

+3662
-4075
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: ffdda22aa28b9231bd3d62ee4db5239f616fce8d
5+
refs/heads/try: d40b5374055086df88727925872f0733843f9d2e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/Makefile.in

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,7 @@ ifdef TRACE
125125
CFG_RUSTC_FLAGS += -Z trace
126126
endif
127127
ifdef CFG_DISABLE_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
128+
CFG_RUSTC_FLAGS += -C no-rpath
132129
endif
133130

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

147143
# 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
60+
DEPS_green := std native:context_switch
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
15+
PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp $(S)src/compiler-rt
1616

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

branches/try/mk/rt.mk

Lines changed: 3 additions & 2 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
38+
NATIVE_LIBS := rustrt sundown uv_support morestack miniz context_switch
3939

4040
# $(1) is the target triple
4141
define NATIVE_LIBRARIES
@@ -54,9 +54,10 @@ 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 \
5857
arch/$$(HOST_$(1))/record_sp.S
5958
NATIVE_DEPS_morestack_$(1) := arch/$$(HOST_$(1))/morestack.S
59+
NATIVE_DEPS_context_switch_$(1) := \
60+
arch/$$(HOST_$(1))/_context.S
6061

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

branches/try/mk/tests.mk

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

334334
define TEST_RUNNER
335335

336-
# If NO_REBUILD is set then break the dependencies on extra so we can
337-
# test crates without rebuilding std and extra first
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.
338339
ifeq ($(NO_REBUILD),)
339-
STDTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
340+
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
340341
$$(foreach crate,$$(TARGET_CRATES),\
341-
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate))
342+
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
343+
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4))
342344
else
343-
STDTESTDEP_$(1)_$(2)_$(3)_$(4) =
345+
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
344346
endif
345347

346348
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): CFG_COMPILER = $(2)
347349
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
348-
$$(CRATEFILE_$(4)) \
349-
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
350-
$$(STDTESTDEP_$(1)_$(2)_$(3)_$(4))
350+
$$(CRATEFILE_$(4)) \
351+
$$(TESTDEP_$(1)_$(2)_$(3)_$(4))
351352
@$$(call E, oxidize: $$@)
352353
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test \
353354
-L "$$(RT_OUTPUT_DIR_$(2))" \
@@ -685,13 +686,22 @@ $(foreach host,$(CFG_HOST), \
685686

686687
define DEF_CRATE_DOC_TEST
687688

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

690703
ifeq ($(2),$$(CFG_BUILD))
691-
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): \
692-
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
693-
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
694-
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3))
704+
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): $$(DOCTESTDEP_$(1)_$(2)_$(3)_$(4))
695705
@$$(call E, run doc-$(4) [$(2)])
696706
$$(Q)$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) --test \
697707
$$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && touch $$@

branches/try/src/compiletest/compiletest.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,14 @@ pub fn run_tests(config: &config) {
222222
mode_debug_info => {
223223
println!("arm-linux-androideabi debug-info \
224224
test uses tcp 5039 port. please reserve it");
225-
//arm-linux-androideabi debug-info test uses remote debugger
226-
//so, we test 1 task at once
227-
os::setenv("RUST_TEST_TASKS","1");
228225
}
229226
_ =>{}
230227
}
228+
229+
//arm-linux-androideabi debug-info test uses remote debugger
230+
//so, we test 1 task at once.
231+
// also trying to isolate problems with adb_run_wrapper.sh ilooping
232+
os::setenv("RUST_TEST_TASKS","1");
231233
}
232234

233235
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(ptr));
198+
assert!(!ptr.is_null());
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: 74 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,31 +1725,95 @@ mod bar {
17251725
pub type int8_t = i8;
17261726
~~~~
17271727

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.
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.
17301732
1731-
At present, only the Rust compiler interprets attributes, so all attribute
1732-
names are effectively reserved. Some significant attributes include:
1733+
At present, only the Rust compiler interprets attributes, so all attribute names
1734+
are effectively reserved. Some significant attributes include:
17331735

17341736
* The `doc` attribute, for documenting code in-place.
1735-
* The `cfg` attribute, for conditional-compilation by build-configuration.
1737+
* The `cfg` attribute, for conditional-compilation by build-configuration (see
1738+
[Conditional compilation](#conditional-compilation)).
17361739
* The `crate_id` attribute, for describing the package ID of a crate.
17371740
* The `lang` attribute, for custom definitions of traits and functions that are
17381741
known to the Rust compiler (see [Language items](#language-items)).
17391742
* The `link` attribute, for describing linkage metadata for a extern blocks.
17401743
* The `test` attribute, for marking functions as unit tests.
17411744
* The `allow`, `warn`, `forbid`, and `deny` attributes, for
17421745
controlling lint checks (see [Lint check attributes](#lint-check-attributes)).
1743-
* The `deriving` attribute, for automatically generating
1744-
implementations of certain traits.
1746+
* The `deriving` attribute, for automatically generating implementations of
1747+
certain traits.
17451748
* The `inline` attribute, for expanding functions at caller location (see
17461749
[Inline attributes](#inline-attributes)).
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.
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.
17501755

17511756
Other attributes may be added or removed during development of the language.
17521757

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+
17531817
### Lint check attributes
17541818

17551819
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 `()` (nil or void) to `price`. But without the semicolon, each
296+
would simply assign `()` (unit 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 nil type, written `()`, has a single value, also written `()`.
355+
The unit 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 nil, `()`, and both the return type and the return
855+
are said to return unit, `()`, 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: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
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
85
TEST_PATH=$1
96
BIN_PATH=/system/bin
107
if [ -d "$TEST_PATH" ]
@@ -16,20 +13,9 @@ then
1613
then
1714
shift
1815

19-
L_RET=1
20-
L_COUNT=0
2116
cd $TEST_PATH
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
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=$?
3319

3420
echo $L_RET > $TEST_PATH/$RUN.exitcode
3521

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;
3637
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(ptr::offset(buf, idx as int));
147+
let tydesc_data: *uint = transmute(buf.offset(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)(ptr::offset(buf, start as int) as *i8);
158+
((*tydesc).drop_glue)(buf.offset(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 = num::max(n_bytes, self.chunk_size());
187+
let new_min_chunk_size = cmp::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 = num::max(n_bytes, self.chunk_size());
227+
let new_min_chunk_size = cmp::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 (ptr::offset(buf, tydesc_start as int), ptr::offset(buf, start as int));
264+
return (buf.offset(tydesc_start as int), buf.offset(start as int));
265265
}
266266
}
267267

0 commit comments

Comments
 (0)