Skip to content

Commit 4aba9d9

Browse files
committed
---
yaml --- r: 85742 b: refs/heads/dist-snap c: c96b1d8 h: refs/heads/master v: v3
1 parent 3cd2424 commit 4aba9d9

File tree

182 files changed

+3729
-2417
lines changed

Some content is hidden

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

182 files changed

+3729
-2417
lines changed

[refs]

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

branches/dist-snap/Makefile.in

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,6 @@ else
107107
CFG_GCCISH_CFLAGS += -DRUST_NDEBUG
108108
endif
109109

110-
ifndef CFG_ENABLE_COMPRESS_METADATA
111-
# XXX: After snapshots extend this to all stages
112-
RUSTFLAGS_STAGE1 += --no-compress-metadata
113-
RUSTFLAGS_STAGE2 += --no-compress-metadata
114-
endif
115-
116110
ifdef SAVE_TEMPS
117111
CFG_RUSTC_FLAGS += --save-temps
118112
endif

branches/dist-snap/configure

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,7 @@ opt mingw-cross 0 "cross-compile for win32 using mingw"
381381
opt clang 0 "prefer clang to gcc for building the runtime"
382382
opt ccache 0 "invoke gcc/clang via ccache to reuse object files between builds"
383383
opt local-rust 0 "use an installed rustc rather than downloading a snapshot"
384-
opt pax-flags 0 "apply PaX flags to rustc binaries (required for GRSecurity/PaX-patched
385-
kernels)"
386-
opt compress-metadata 0 "compress crate metadata"
384+
opt pax-flags 0 "apply PaX flags to rustc binaries (required for GRSecurity/PaX-patched kernels)"
387385
valopt prefix "/usr/local" "set installation prefix"
388386
valopt local-rust-root "/usr/local" "set prefix for local rust binary"
389387
valopt llvm-root "" "set LLVM root"

branches/dist-snap/doc/rust.md

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,38 @@ 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+
~~~~
854886

855887
### Functions
856888

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

10081040
~~~
1041+
// Declares an extern fn, the ABI defaults to "C"
10091042
extern fn new_vec() -> ~[int] { ~[] }
1043+
1044+
// Declares an extern fn with "stdcall" ABI
1045+
extern "stdcall" fn new_vec_stdcall() -> ~[int] { ~[] }
10101046
~~~
10111047

1012-
Extern functions may not be called from Rust code,
1013-
but Rust code may take their value as a raw `u8` pointer.
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.
10141051

10151052
~~~
10161053
# extern fn new_vec() -> ~[int] { ~[] }
1017-
let fptr: *u8 = new_vec;
1054+
let fptr: extern "C" fn() -> ~[int] = new_vec;
10181055
~~~
10191056

1020-
The primary motivation for extern functions is
1021-
to create callbacks for foreign functions that expect to receive function
1022-
pointers.
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.
10231060

10241061
### Type definitions
10251062

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

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
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:
13901427

13911428
~~~{.xfail-test}
13921429
// Interface to the Windows API
1393-
#[abi = "stdcall"]
1394-
extern { }
1430+
extern "stdcall" { }
13951431
~~~
13961432

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

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+
14101452
## Attributes
14111453

14121454
~~~~~~~~{.ebnf .gram}

branches/dist-snap/doc/tutorial-container.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,18 @@ 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+
163175
The `for` keyword can be used as sugar for iterating through any iterator:
164176
165177
~~~

branches/dist-snap/doc/tutorial-ffi.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,8 @@ 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. 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.
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.
451450

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

branches/dist-snap/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)) $$(CFG_LLVM_BUILD_ENV)
29+
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1))
3030
$$(Q)touch $$(LLVM_CONFIG_$(1))
3131
endif
3232

branches/dist-snap/mk/platform.mk

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ 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-
# 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
29+
CFG_GCCISH_CFLAGS += -DUSE_UTF8
3330

3431
# On Darwin, we need to run dsymutil so the debugging information ends
3532
# up in the right place. On other platforms, it automatically gets
@@ -153,7 +150,6 @@ CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-linux-gnu := -Wl,-no-whole-archive
153150
CFG_DEF_SUFFIX_x86_64-unknown-linux-gnu := .linux.def
154151
CFG_INSTALL_NAME_x86_64-unknown-linux-gnu =
155152
CFG_LIBUV_LINK_FLAGS_x86_64-unknown-linux-gnu =
156-
CFG_LLVM_BUILD_ENV_x86_64-unknown-linux-gnu="CXXFLAGS=-fno-omit-frame-pointer"
157153
CFG_EXE_SUFFIX_x86_64-unknown-linux-gnu =
158154
CFG_WINDOWSY_x86_64-unknown-linux-gnu :=
159155
CFG_UNIXY_x86_64-unknown-linux-gnu := 1
@@ -179,7 +175,6 @@ CFG_GCCISH_POST_LIB_FLAGS_i686-unknown-linux-gnu := -Wl,-no-whole-archive
179175
CFG_DEF_SUFFIX_i686-unknown-linux-gnu := .linux.def
180176
CFG_INSTALL_NAME_i686-unknown-linux-gnu =
181177
CFG_LIBUV_LINK_FLAGS_i686-unknown-linux-gnu =
182-
CFG_LLVM_BUILD_ENV_i686-unknown-linux-gnu="CXXFLAGS=-fno-omit-frame-pointer"
183178
CFG_EXE_SUFFIX_i686-unknown-linux-gnu =
184179
CFG_WINDOWSY_i686-unknown-linux-gnu :=
185180
CFG_UNIXY_i686-unknown-linux-gnu := 1

branches/dist-snap/mk/rt.mk

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

6565
RUNTIME_CXXS_$(1)_$(2) := \
66-
rt/sync/timer.cpp \
6766
rt/sync/lock_and_signal.cpp \
6867
rt/sync/rust_thread.cpp \
6968
rt/rust_builtin.cpp \
@@ -72,13 +71,9 @@ RUNTIME_CXXS_$(1)_$(2) := \
7271
rt/rust_upcall.cpp \
7372
rt/rust_uv.cpp \
7473
rt/rust_crate_map.cpp \
75-
rt/rust_gc_metadata.cpp \
76-
rt/rust_util.cpp \
7774
rt/rust_log.cpp \
78-
rt/rust_exchange_alloc.cpp \
7975
rt/isaac/randport.cpp \
8076
rt/miniz.cpp \
81-
rt/rust_abi.cpp \
8277
rt/memory_region.cpp \
8378
rt/boxed_region.cpp \
8479
rt/arch/$$(HOST_$(1))/context.cpp \

branches/dist-snap/mk/tests.mk

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,9 @@ CFG_ADB_TEST_DIR=/data/tmp
144144

145145
$(info check: android device test dir $(CFG_ADB_TEST_DIR) ready \
146146
$(shell adb remount 1>/dev/null) \
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) \
147+
$(shell adb shell rm -r $(CFG_ADB_TEST_DIR) >/dev/null) \
148+
$(shell adb shell mkdir $(CFG_ADB_TEST_DIR)) \
149+
$(shell adb shell mkdir $(CFG_ADB_TEST_DIR)/tmp) \
149150
$(shell adb push $(S)src/etc/adb_run_wrapper.sh $(CFG_ADB_TEST_DIR) 1>/dev/null) \
150151
$(shell adb push $(CFG_ANDROID_CROSS_PATH)/arm-linux-androideabi/lib/armv7-a/libgnustl_shared.so \
151152
$(CFG_ADB_TEST_DIR) 1>/dev/null) \
@@ -239,6 +240,8 @@ tidy:
239240
@$(call E, check: formatting)
240241
$(Q)find $(S)src -name '*.r[sc]' \
241242
| grep '^$(S)src/test' -v \
243+
| grep '^$(S)src/libuv' -v \
244+
| grep '^$(S)src/llvm' -v \
242245
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
243246
$(Q)find $(S)src/etc -name '*.py' \
244247
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
@@ -409,14 +412,16 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
409412
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
410413
@$$(call E, run: $$< via adb)
411414
@$(CFG_ADB) push $$< $(CFG_ADB_TEST_DIR)
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
415+
@$(CFG_ADB) shell '(cd $(CFG_ADB_TEST_DIR); LD_LIBRARY_PATH=. \
416+
./$$(notdir $$<) \
417+
--logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log \
418+
$$(call CRATE_TEST_BENCH_ARGS,$(1),$(2),$(3),$(4)))' \
419+
> tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
416420
@cat tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
417421
@touch tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
418422
@$(CFG_ADB) pull $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log tmp/
419423
@$(CFG_ADB) shell rm $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
424+
@$(CFG_ADB) pull $(CFG_ADB_TEST_DIR)/$$(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4)) tmp/
420425
@if grep -q "result: ok" tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
421426
then \
422427
rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \

branches/dist-snap/src/libextra/arc.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ mod tests {
612612
}
613613
}
614614
615-
#[test] #[should_fail] #[ignore(cfg(windows))]
615+
#[test] #[should_fail]
616616
fn test_arc_condvar_poison() {
617617
unsafe {
618618
let arc = ~MutexArc::new(1);
@@ -636,7 +636,7 @@ mod tests {
636636
}
637637
}
638638
}
639-
#[test] #[should_fail] #[ignore(cfg(windows))]
639+
#[test] #[should_fail]
640640
fn test_mutex_arc_poison() {
641641
unsafe {
642642
let arc = ~MutexArc::new(1);
@@ -651,7 +651,7 @@ mod tests {
651651
}
652652
}
653653
}
654-
#[test] #[should_fail] #[ignore(cfg(windows))]
654+
#[test] #[should_fail]
655655
pub fn test_mutex_arc_unwrap_poison() {
656656
let arc = MutexArc::new(1);
657657
let arc2 = ~(&arc).clone();
@@ -668,7 +668,7 @@ mod tests {
668668
let one = arc.unwrap();
669669
assert!(one == 1);
670670
}
671-
#[test] #[should_fail] #[ignore(cfg(windows))]
671+
#[test] #[should_fail]
672672
fn test_rw_arc_poison_wr() {
673673
let arc = ~RWArc::new(1);
674674
let arc2 = (*arc).clone();
@@ -681,7 +681,7 @@ mod tests {
681681
assert_eq!(*one, 1);
682682
}
683683
}
684-
#[test] #[should_fail] #[ignore(cfg(windows))]
684+
#[test] #[should_fail]
685685
fn test_rw_arc_poison_ww() {
686686
let arc = ~RWArc::new(1);
687687
let arc2 = (*arc).clone();
@@ -694,7 +694,7 @@ mod tests {
694694
assert_eq!(*one, 1);
695695
}
696696
}
697-
#[test] #[should_fail] #[ignore(cfg(windows))]
697+
#[test] #[should_fail]
698698
fn test_rw_arc_poison_dw() {
699699
let arc = ~RWArc::new(1);
700700
let arc2 = (*arc).clone();
@@ -709,7 +709,7 @@ mod tests {
709709
assert_eq!(*one, 1);
710710
}
711711
}
712-
#[test] #[ignore(cfg(windows))]
712+
#[test]
713713
fn test_rw_arc_no_poison_rr() {
714714
let arc = ~RWArc::new(1);
715715
let arc2 = (*arc).clone();
@@ -722,7 +722,7 @@ mod tests {
722722
assert_eq!(*one, 1);
723723
}
724724
}
725-
#[test] #[ignore(cfg(windows))]
725+
#[test]
726726
fn test_rw_arc_no_poison_rw() {
727727
let arc = ~RWArc::new(1);
728728
let arc2 = (*arc).clone();
@@ -735,7 +735,7 @@ mod tests {
735735
assert_eq!(*one, 1);
736736
}
737737
}
738-
#[test] #[ignore(cfg(windows))]
738+
#[test]
739739
fn test_rw_arc_no_poison_dr() {
740740
let arc = ~RWArc::new(1);
741741
let arc2 = (*arc).clone();

branches/dist-snap/src/libextra/arena.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ fn test_arena_destructors() {
291291

292292
#[test]
293293
#[should_fail]
294-
#[ignore(cfg(windows))]
295294
fn test_arena_destructors_fail() {
296295
let arena = Arena::new();
297296
// Put some stuff in the arena.

branches/dist-snap/src/libextra/c_vec.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ mod tests {
185185

186186
#[test]
187187
#[should_fail]
188-
#[ignore(cfg(windows))]
189188
fn test_overrun_get() {
190189
let cv = malloc(16u as size_t);
191190

@@ -194,7 +193,6 @@ mod tests {
194193

195194
#[test]
196195
#[should_fail]
197-
#[ignore(cfg(windows))]
198196
fn test_overrun_set() {
199197
let cv = malloc(16u as size_t);
200198

0 commit comments

Comments
 (0)