Skip to content

Commit 84113ca

Browse files
committed
---
yaml --- r: 85751 b: refs/heads/dist-snap c: 424e8f0 h: refs/heads/master i: 85749: c50c622 85747: 4399a6f 85743: f6c2f73 v: v3
1 parent ee667b3 commit 84113ca

Some content is hidden

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

46 files changed

+497
-1197
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: cc477dfa74b78511f96cae5b8b39c3ea391d3779
9+
refs/heads/dist-snap: 424e8f0fd55b94a45ebe112dc77312e3fab1ebfe
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

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: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,24 @@ TEST_RATCHET_NOISE_PERCENT=10.0
7373

7474
# Whether to ratchet or merely save benchmarks
7575
ifdef CFG_RATCHET_BENCH
76-
CRATE_TEST_BENCH_ARGS=\
76+
CRATE_TEST_EXTRA_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_BENCH_ARGS=\
81+
CRATE_TEST_EXTRA_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+
8694
define DEF_TARGET_COMMANDS
8795

8896
ifdef CFG_UNIXY_$(1)
@@ -401,7 +409,7 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
401409
@$$(call E, run: $$<)
402410
$$(Q)$$(call CFG_RUN_TEST_$(2),$$<,$(2),$(3)) $$(TESTARGS) \
403411
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
404-
$$(call CRATE_TEST_BENCH_ARGS,$(1),$(2),$(3),$(4)) \
412+
$$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)) \
405413
&& touch $$@
406414
endef
407415

@@ -415,7 +423,7 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
415423
@$(CFG_ADB) shell '(cd $(CFG_ADB_TEST_DIR); LD_LIBRARY_PATH=. \
416424
./$$(notdir $$<) \
417425
--logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log \
418-
$$(call CRATE_TEST_BENCH_ARGS,$(1),$(2),$(3),$(4)))' \
426+
$$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)))' \
419427
> tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
420428
@cat tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
421429
@touch tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log

branches/dist-snap/src/compiletest/common.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ 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+
7176
// A command line to prefix program execution with,
7277
// for running under valgrind
7378
runtool: Option<~str>,

branches/dist-snap/src/compiletest/compiletest.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ 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"),
7879
optflag("h", "help", "show this message"),
7980
];
8081

@@ -148,6 +149,7 @@ pub fn parse_config(args: ~[~str]) -> config {
148149
~"") { true }
149150
else { false }
150151
} else { false },
152+
test_shard: test::opt_shard(getopts::opt_maybe_str(matches, "test-shard")),
151153
verbose: getopts::opt_present(matches, "verbose")
152154
}
153155
}
@@ -172,6 +174,10 @@ pub fn log_config(config: &config) {
172174
logv(c, fmt!("adb_path: %s", config.adb_path));
173175
logv(c, fmt!("adb_test_dir: %s", config.adb_test_dir));
174176
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+
}
175181
logv(c, fmt!("verbose: %b", config.verbose));
176182
logv(c, fmt!("\n"));
177183
}
@@ -234,6 +240,7 @@ pub fn test_opts(config: &config) -> test::TestOpts {
234240
ratchet_metrics: config.ratchet_metrics.clone(),
235241
ratchet_noise_percent: config.ratchet_noise_percent.clone(),
236242
save_metrics: config.save_metrics.clone(),
243+
test_shard: config.test_shard.clone()
237244
}
238245
}
239246

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

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@ pub enum FailType {
501501
pub mod groups {
502502
use getopts::{HasArg, Long, Maybe, Multi, No, Occur, Opt, Optional, Req};
503503
use getopts::{Short, Yes};
504-
use std::str;
505504

506505
/** one group of options, e.g., both -h and --help, along with
507506
* their shared description and properties
@@ -690,9 +689,9 @@ pub mod groups {
690689
}
691690
}
692691

693-
// FIXME: #5516 should be graphemes not codepoints
692+
// FIXME: #5516
694693
// here we just need to indent the start of the description
695-
let rowlen = str::count_chars(row, 0, row.len());
694+
let rowlen = row.len();
696695
if rowlen < 24 {
697696
do (24 - rowlen).times {
698697
row.push_char(' ')
@@ -708,14 +707,14 @@ pub mod groups {
708707
desc_normalized_whitespace.push_char(' ');
709708
}
710709

711-
// FIXME: #5516 should be graphemes not codepoints
710+
// FIXME: #5516
712711
let mut desc_rows = ~[];
713712
do each_split_within(desc_normalized_whitespace, 54) |substr| {
714713
desc_rows.push(substr.to_owned());
715714
true
716715
};
717716

718-
// FIXME: #5516 should be graphemes not codepoints
717+
// FIXME: #5516
719718
// wrapped description
720719
row.push_str(desc_rows.connect(desc_sep));
721720

@@ -799,7 +798,7 @@ pub mod groups {
799798
cont
800799
};
801800

802-
ss.char_offset_iter().advance(|x| machine(x));
801+
ss.iter().enumerate().advance(|x| machine(x));
803802

804803
// Let the automaton 'run out' by supplying trailing whitespace
805804
while cont && match state { B | C => true, A => false } {
@@ -1581,31 +1580,4 @@ Options:
15811580
debug!("generated: <<%s>>", usage);
15821581
assert!(usage == expected)
15831582
}
1584-
1585-
#[test]
1586-
fn test_groups_usage_description_multibyte_handling() {
1587-
let optgroups = ~[
1588-
groups::optflag("k", "k\u2013w\u2013",
1589-
"The word kiwi is normally spelled with two i's"),
1590-
groups::optflag("a", "apple",
1591-
"This \u201Cdescription\u201D has some characters that could \
1592-
confuse the line wrapping; an apple costs 0.51€ in some parts of Europe."),
1593-
];
1594-
1595-
let expected =
1596-
~"Usage: fruits
1597-
1598-
Options:
1599-
-k --k–w– The word kiwi is normally spelled with two i's
1600-
-a --apple This “description” has some characters that could
1601-
confuse the line wrapping; an apple costs 0.51in
1602-
some parts of Europe.
1603-
";
1604-
1605-
let usage = groups::usage("Usage: fruits", optgroups);
1606-
1607-
debug!("expected: <<%s>>", expected);
1608-
debug!("generated: <<%s>>", usage);
1609-
assert!(usage == expected)
1610-
}
16111583
}

0 commit comments

Comments
 (0)