Skip to content

Commit 6372206

Browse files
committed
---
yaml --- r: 77609 b: refs/heads/master c: cc477df h: refs/heads/master i: 77607: e063156 v: v3
1 parent e3eebc4 commit 6372206

Some content is hidden

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

45 files changed

+1132
-436
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: bb9c71fe82005d2d85f459988d9986f7c817717e
2+
refs/heads/master: cc477dfa74b78511f96cae5b8b39c3ea391d3779
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 60fba4d7d677ec098e6a43014132fe99f7547363
55
refs/heads/try: ebfe63cd1c0b5d23f7ea60c69b4fde2e30cfd42a

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/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: 4 additions & 12 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)
@@ -409,7 +401,7 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
409401
@$$(call E, run: $$<)
410402
$$(Q)$$(call CFG_RUN_TEST_$(2),$$<,$(2),$(3)) $$(TESTARGS) \
411403
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
412-
$$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)) \
404+
$$(call CRATE_TEST_BENCH_ARGS,$(1),$(2),$(3),$(4)) \
413405
&& touch $$@
414406
endef
415407

@@ -423,7 +415,7 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
423415
@$(CFG_ADB) shell '(cd $(CFG_ADB_TEST_DIR); LD_LIBRARY_PATH=. \
424416
./$$(notdir $$<) \
425417
--logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log \
426-
$$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)))' \
418+
$$(call CRATE_TEST_BENCH_ARGS,$(1),$(2),$(3),$(4)))' \
427419
> tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
428420
@cat tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
429421
@touch tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log

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

trunk/src/libextra/getopts.rs

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ 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;
504505

505506
/** one group of options, e.g., both -h and --help, along with
506507
* their shared description and properties
@@ -689,9 +690,9 @@ pub mod groups {
689690
}
690691
}
691692

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

710-
// FIXME: #5516
711+
// FIXME: #5516 should be graphemes not codepoints
711712
let mut desc_rows = ~[];
712713
do each_split_within(desc_normalized_whitespace, 54) |substr| {
713714
desc_rows.push(substr.to_owned());
714715
true
715716
};
716717

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

@@ -798,7 +799,7 @@ pub mod groups {
798799
cont
799800
};
800801

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

803804
// Let the automaton 'run out' by supplying trailing whitespace
804805
while cont && match state { B | C => true, A => false } {
@@ -1580,4 +1581,31 @@ Options:
15801581
debug!("generated: <<%s>>", usage);
15811582
assert!(usage == expected)
15821583
}
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+
}
15831611
}

trunk/src/libextra/test.rs

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ use std::task;
3838
use std::to_str::ToStr;
3939
use std::f64;
4040
use std::os;
41-
use std::uint;
4241

4342

4443
// The name of a test. By convention this follows the rules for rust
@@ -165,7 +164,6 @@ pub struct TestOpts {
165164
ratchet_metrics: Option<Path>,
166165
ratchet_noise_percent: Option<f64>,
167166
save_metrics: Option<Path>,
168-
test_shard: Option<(uint,uint)>,
169167
logfile: Option<Path>
170168
}
171169

@@ -186,9 +184,7 @@ fn optgroups() -> ~[getopts::groups::OptGroup] {
186184
"Tests within N% of the recorded metrics will be \
187185
considered as passing", "PERCENTAGE"),
188186
groups::optopt("", "logfile", "Write logs to the specified file instead \
189-
of stdout", "PATH"),
190-
groups::optopt("", "test-shard", "run shard A, of B shards, worth of the testsuite",
191-
"A.B")]
187+
of stdout", "PATH")]
192188
}
193189

194190
fn usage(binary: &str, helpstr: &str) -> ! {
@@ -259,9 +255,6 @@ pub fn parse_opts(args: &[~str]) -> OptRes {
259255
let save_metrics = getopts::opt_maybe_str(&matches, "save-metrics");
260256
let save_metrics = save_metrics.map_move(|s| Path(s));
261257

262-
let test_shard = getopts::opt_maybe_str(&matches, "test-shard");
263-
let test_shard = opt_shard(test_shard);
264-
265258
let test_opts = TestOpts {
266259
filter: filter,
267260
run_ignored: run_ignored,
@@ -270,29 +263,12 @@ pub fn parse_opts(args: &[~str]) -> OptRes {
270263
ratchet_metrics: ratchet_metrics,
271264
ratchet_noise_percent: ratchet_noise_percent,
272265
save_metrics: save_metrics,
273-
test_shard: test_shard,
274266
logfile: logfile
275267
};
276268

277269
either::Left(test_opts)
278270
}
279271

280-
pub fn opt_shard(maybestr: Option<~str>) -> Option<(uint,uint)> {
281-
match maybestr {
282-
None => None,
283-
Some(s) => {
284-
match s.split_iter('.').to_owned_vec() {
285-
[a, b] => match (uint::from_str(a), uint::from_str(b)) {
286-
(Some(a), Some(b)) => Some((a,b)),
287-
_ => None
288-
},
289-
_ => None
290-
}
291-
}
292-
}
293-
}
294-
295-
296272
#[deriving(Clone, Eq)]
297273
pub struct BenchSamples {
298274
ns_iter_summ: stats::Summary,
@@ -796,15 +772,7 @@ pub fn filter_tests(
796772
}
797773
sort::quick_sort(filtered, lteq);
798774

799-
// Shard the remaining tests, if sharding requested.
800-
match opts.test_shard {
801-
None => filtered,
802-
Some((a,b)) =>
803-
filtered.move_iter().enumerate()
804-
.filter(|&(i,_)| i % b == a)
805-
.map(|(_,t)| t)
806-
.to_owned_vec()
807-
}
775+
filtered
808776
}
809777

810778
struct TestFuture {
@@ -1266,7 +1234,6 @@ mod tests {
12661234
ratchet_noise_percent: None,
12671235
ratchet_metrics: None,
12681236
save_metrics: None,
1269-
test_shard: None
12701237
};
12711238

12721239
let tests = ~[
@@ -1305,7 +1272,6 @@ mod tests {
13051272
ratchet_noise_percent: None,
13061273
ratchet_metrics: None,
13071274
save_metrics: None,
1308-
test_shard: None
13091275
};
13101276
13111277
let names =

trunk/src/libextra/time.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@ pub struct Tm {
121121
}
122122

123123
pub fn empty_tm() -> Tm {
124-
// 64 is the max size of the timezone buffer allocated on windows
125-
// in rust_localtime. In glibc the max timezone size is supposedly 3.
126-
let zone = str::with_capacity(64);
127124
Tm {
128125
tm_sec: 0_i32,
129126
tm_min: 0_i32,
@@ -135,7 +132,7 @@ pub fn empty_tm() -> Tm {
135132
tm_yday: 0_i32,
136133
tm_isdst: 0_i32,
137134
tm_gmtoff: 0_i32,
138-
tm_zone: zone,
135+
tm_zone: ~"",
139136
tm_nsec: 0_i32,
140137
}
141138
}

trunk/src/libextra/uuid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ mod bench {
787787
pub fn parse_str(bh: &mut BenchHarness) {
788788
let s = "urn:uuid:F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4";
789789
do bh.iter {
790-
Uuid::parse_string(s);
790+
let u = Uuid::parse_string(s);
791791
}
792792
}
793793
}

0 commit comments

Comments
 (0)