Skip to content

Commit 4e7f3d5

Browse files
committed
---
yaml --- r: 108521 b: refs/heads/dist-snap c: 068781e h: refs/heads/master i: 108519: 7439556 v: v3
1 parent 6e03a75 commit 4e7f3d5

File tree

206 files changed

+4011
-2892
lines changed

Some content is hidden

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

206 files changed

+4011
-2892
lines changed

[refs]

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

branches/dist-snap/AUTHORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Adrien Tétar <[email protected]>
77
Alan Andrade <[email protected]>
88
Aleksander Balicki <[email protected]>
99
Alex Crichton <[email protected]>
10+
Alex Lyon <[email protected]>
1011
Alex Rønne Petersen <[email protected]>
1112
Alexander Stavonin <[email protected]>
1213
Alexandros Tasos <[email protected]>

branches/dist-snap/mk/crates.mk

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,21 @@
5050
################################################################################
5151

5252
TARGET_CRATES := std extra green rustuv native flate arena glob term semver \
53-
uuid serialize sync getopts collections num
53+
uuid serialize sync getopts collections num test time
5454
HOST_CRATES := syntax rustc rustdoc fourcc
5555
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5656
TOOLS := compiletest rustdoc rustc
5757

5858
DEPS_std := native:rustrt native:compiler-rt
59-
DEPS_extra := std term sync serialize getopts collections
59+
DEPS_extra := std term sync serialize getopts collections time
6060
DEPS_green := std native:context_switch
6161
DEPS_rustuv := std native:uv native:uv_support
6262
DEPS_native := std
6363
DEPS_syntax := std term serialize collections
6464
DEPS_rustc := syntax native:rustllvm flate arena serialize sync getopts \
65-
collections extra
66-
DEPS_rustdoc := rustc native:sundown serialize sync getopts collections
65+
collections time extra
66+
DEPS_rustdoc := rustc native:sundown serialize sync getopts collections \
67+
test time
6768
DEPS_flate := std native:miniz
6869
DEPS_arena := std collections
6970
DEPS_glob := std
@@ -76,8 +77,10 @@ DEPS_getopts := std
7677
DEPS_collections := std serialize
7778
DEPS_fourcc := syntax std
7879
DEPS_num := std extra
80+
DEPS_test := std extra collections getopts serialize term
81+
DEPS_time := std serialize
7982

80-
TOOL_DEPS_compiletest := extra green rustuv getopts
83+
TOOL_DEPS_compiletest := test green rustuv getopts
8184
TOOL_DEPS_rustdoc := rustdoc green rustuv
8285
TOOL_DEPS_rustc := rustc green rustuv
8386
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs

branches/dist-snap/mk/tests.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,6 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
537537
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
538538
CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(CFG_RUSTC_FLAGS))
539539

540-
# There's no need our entire test suite to take up gigabytes of space on disk
541-
# including copies of libstd/libextra all over the place
542-
CTEST_RUSTC_FLAGS := $$(CTEST_RUSTC_FLAGS) -C prefer-dynamic
543-
544540
# The tests can not be optimized while the rest of the compiler is optimized, so
545541
# filter out the optimization (if any) from rustc and then figure out if we need
546542
# to be optimized

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@
1313
#[allow(non_camel_case_types)];
1414
#[deny(warnings)];
1515

16-
extern crate extra;
16+
extern crate test;
1717
extern crate getopts;
1818

1919
use std::os;
2020
use std::io;
2121
use std::io::fs;
22-
2322
use getopts::{optopt, optflag, reqopt};
24-
use extra::test;
25-
2623
use common::config;
2724
use common::mode_run_pass;
2825
use common::mode_run_fail;

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ pub struct TestProps {
3232
force_host: bool,
3333
// Check stdout for error-pattern output as well as stderr
3434
check_stdout: bool,
35+
// Don't force a --crate-type=dylib flag on the command line
36+
no_prefer_dynamic: bool,
3537
}
3638

3739
// Load any test directives embedded in the file
@@ -45,6 +47,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
4547
let mut check_lines = ~[];
4648
let mut force_host = false;
4749
let mut check_stdout = false;
50+
let mut no_prefer_dynamic = false;
4851
iter_header(testfile, |ln| {
4952
match parse_error_pattern(ln) {
5053
Some(ep) => error_patterns.push(ep),
@@ -67,6 +70,10 @@ pub fn load_props(testfile: &Path) -> TestProps {
6770
check_stdout = parse_check_stdout(ln);
6871
}
6972

73+
if !no_prefer_dynamic {
74+
no_prefer_dynamic = parse_no_prefer_dynamic(ln);
75+
}
76+
7077
match parse_aux_build(ln) {
7178
Some(ab) => { aux_builds.push(ab); }
7279
None => {}
@@ -99,6 +106,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
99106
check_lines: check_lines,
100107
force_host: force_host,
101108
check_stdout: check_stdout,
109+
no_prefer_dynamic: no_prefer_dynamic,
102110
};
103111
}
104112

@@ -167,6 +175,10 @@ fn parse_check_stdout(line: &str) -> bool {
167175
parse_name_directive(line, "check-stdout")
168176
}
169177

178+
fn parse_no_prefer_dynamic(line: &str) -> bool {
179+
parse_name_directive(line, "no-prefer-dynamic")
180+
}
181+
170182
fn parse_exec_env(line: &str) -> Option<(~str, ~str)> {
171183
parse_name_value_directive(line, ~"exec-env").map(|nv| {
172184
// nv is either FOO or FOO=BAR

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

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use std::str;
3434
use std::task;
3535
use std::vec;
3636

37-
use extra::test::MetricMap;
37+
use test::MetricMap;
3838

3939
pub fn run(config: config, testfile: ~str) {
4040

@@ -258,15 +258,12 @@ actual:\n\
258258
}
259259

260260
fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
261-
262-
// do not optimize debuginfo tests
263-
let mut config = match config.target_rustcflags {
264-
Some(ref flags) => config {
265-
target_rustcflags: Some(flags.replace("-O", "")),
266-
.. (*config).clone()
267-
},
268-
None => (*config).clone()
261+
let mut config = config {
262+
target_rustcflags: cleanup_debug_info_options(&config.target_rustcflags),
263+
host_rustcflags: cleanup_debug_info_options(&config.host_rustcflags),
264+
.. config.clone()
269265
};
266+
270267
let config = &mut config;
271268
let check_lines = &props.check_lines;
272269
let mut cmds = props.debugger_cmds.connect("\n");
@@ -436,6 +433,20 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
436433
check_lines[i]), &ProcRes);
437434
}
438435
}
436+
437+
fn cleanup_debug_info_options(options: &Option<~str>) -> Option<~str> {
438+
if options.is_none() {
439+
return None;
440+
}
441+
442+
// Remove options that are either unwanted (-O) or may lead to duplicates due to RUSTFLAGS.
443+
let options_to_remove = [~"-O", ~"-g", ~"--debuginfo"];
444+
let new_options = split_maybe_args(options).move_iter()
445+
.filter(|x| !options_to_remove.contains(x))
446+
.to_owned_vec()
447+
.connect(" ");
448+
Some(new_options)
449+
}
439450
}
440451

441452
fn check_error_patterns(props: &TestProps,
@@ -704,9 +715,13 @@ fn compose_and_run_compiler(
704715
for rel_ab in props.aux_builds.iter() {
705716
let abs_ab = config.aux_base.join(rel_ab.as_slice());
706717
let aux_props = load_props(&abs_ab);
718+
let crate_type = if aux_props.no_prefer_dynamic {
719+
~[]
720+
} else {
721+
~[~"--crate-type=dylib"]
722+
};
707723
let aux_args =
708-
make_compile_args(config, &aux_props, ~[~"--crate-type=dylib"]
709-
+ extra_link_args,
724+
make_compile_args(config, &aux_props, crate_type + extra_link_args,
710725
|a,b| {
711726
let f = make_lib_name(a, b, testfile);
712727
ThisDirectory(f.dir_path())
@@ -770,6 +785,10 @@ fn make_compile_args(config: &config,
770785
~"-L", config.build_base.as_str().unwrap().to_owned(),
771786
~"--target=" + target]
772787
+ extras;
788+
if !props.no_prefer_dynamic {
789+
args.push(~"-C");
790+
args.push(~"prefer-dynamic");
791+
}
773792
let path = match xform_file {
774793
ThisFile(path) => { args.push(~"-o"); path }
775794
ThisDirectory(path) => { args.push(~"--out-dir"); path }

branches/dist-snap/src/doc/complement-cheatsheet.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ let y: int = x.unwrap();
2222

2323
**Int to string, in non-base-10**
2424

25-
Use [`ToStrRadix`](http://static.rust-lang.org/doc/master/std/num/trait.ToStrRadix.html).
25+
Use the `format!` syntax extension.
2626

2727
~~~
28-
use std::num::ToStrRadix;
29-
3028
let x: int = 42;
31-
let y: ~str = x.to_str_radix(16);
29+
let y: ~str = format!("{:t}", x); // binary
30+
let y: ~str = format!("{:o}", x); // octal
31+
let y: ~str = format!("{:x}", x); // lowercase hexadecimal
32+
let y: ~str = format!("{:X}", x); // uppercase hexidecimal
3233
~~~
3334

3435
**String to int, in non-base-10**

branches/dist-snap/src/doc/guide-macros.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ which both pattern-match on their input and both return early in one case,
1111
doing nothing otherwise:
1212

1313
~~~~
14-
# enum t { special_a(uint), special_b(uint) };
14+
# enum T { SpecialA(uint), SpecialB(uint) };
1515
# fn f() -> uint {
16-
# let input_1 = special_a(0);
17-
# let input_2 = special_a(0);
16+
# let input_1 = SpecialA(0);
17+
# let input_2 = SpecialA(0);
1818
match input_1 {
19-
special_a(x) => { return x; }
19+
SpecialA(x) => { return x; }
2020
_ => {}
2121
}
2222
// ...
2323
match input_2 {
24-
special_b(x) => { return x; }
24+
SpecialB(x) => { return x; }
2525
_ => {}
2626
}
2727
# return 0u;
@@ -37,22 +37,22 @@ lightweight custom syntax extensions, themselves defined using the
3737
the pattern in the above code:
3838

3939
~~~~
40-
# enum t { special_a(uint), special_b(uint) };
40+
# enum T { SpecialA(uint), SpecialB(uint) };
4141
# fn f() -> uint {
42-
# let input_1 = special_a(0);
43-
# let input_2 = special_a(0);
42+
# let input_1 = SpecialA(0);
43+
# let input_2 = SpecialA(0);
4444
macro_rules! early_return(
45-
($inp:expr $sp:ident) => ( // invoke it like `(input_5 special_e)`
45+
($inp:expr $sp:ident) => ( // invoke it like `(input_5 SpecialE)`
4646
match $inp {
4747
$sp(x) => { return x; }
4848
_ => {}
4949
}
5050
);
5151
)
5252
// ...
53-
early_return!(input_1 special_a);
53+
early_return!(input_1 SpecialA);
5454
// ...
55-
early_return!(input_2 special_b);
55+
early_return!(input_2 SpecialB);
5656
# return 0;
5757
# }
5858
~~~~
@@ -155,10 +155,10 @@ separator token (a comma-separated list could be written `$(...),*`), and `+`
155155
instead of `*` to mean "at least one".
156156

157157
~~~~
158-
# enum t { special_a(uint),special_b(uint),special_c(uint),special_d(uint)};
158+
# enum T { SpecialA(uint),SpecialB(uint),SpecialC(uint),SpecialD(uint)};
159159
# fn f() -> uint {
160-
# let input_1 = special_a(0);
161-
# let input_2 = special_a(0);
160+
# let input_1 = SpecialA(0);
161+
# let input_2 = SpecialA(0);
162162
macro_rules! early_return(
163163
($inp:expr, [ $($sp:ident)|+ ]) => (
164164
match $inp {
@@ -170,9 +170,9 @@ macro_rules! early_return(
170170
);
171171
)
172172
// ...
173-
early_return!(input_1, [special_a|special_c|special_d]);
173+
early_return!(input_1, [SpecialA|SpecialC|SpecialD]);
174174
// ...
175-
early_return!(input_2, [special_b]);
175+
early_return!(input_2, [SpecialB]);
176176
# return 0;
177177
# }
178178
~~~~
@@ -215,14 +215,14 @@ solves the problem.
215215
Now consider code like the following:
216216

217217
~~~~
218-
# enum t1 { good_1(t2, uint), bad_1 };
219-
# struct t2 { body: t3 }
220-
# enum t3 { good_2(uint), bad_2};
221-
# fn f(x: t1) -> uint {
218+
# enum T1 { Good1(T2, uint), Bad1};
219+
# struct T2 { body: T3 }
220+
# enum T3 { Good2(uint), Bad2};
221+
# fn f(x: T1) -> uint {
222222
match x {
223-
good_1(g1, val) => {
223+
Good1(g1, val) => {
224224
match g1.body {
225-
good_2(result) => {
225+
Good2(result) => {
226226
// complicated stuff goes here
227227
return result + val;
228228
},
@@ -261,13 +261,13 @@ macro_rules! biased_match (
261261
)
262262
)
263263
264-
# enum t1 { good_1(t2, uint), bad_1 };
265-
# struct t2 { body: t3 }
266-
# enum t3 { good_2(uint), bad_2};
267-
# fn f(x: t1) -> uint {
268-
biased_match!((x) ~ (good_1(g1, val)) else { return 0 };
264+
# enum T1 { Good1(T2, uint), Bad1};
265+
# struct T2 { body: T3 }
266+
# enum T3 { Good2(uint), Bad2};
267+
# fn f(x: T1) -> uint {
268+
biased_match!((x) ~ (Good1(g1, val)) else { return 0 };
269269
binds g1, val )
270-
biased_match!((g1.body) ~ (good_2(result) )
270+
biased_match!((g1.body) ~ (Good2(result) )
271271
else { fail!("Didn't get good_2") };
272272
binds result )
273273
// complicated stuff goes here
@@ -365,13 +365,13 @@ macro_rules! biased_match (
365365
)
366366
367367
368-
# enum t1 { good_1(t2, uint), bad_1 };
369-
# struct t2 { body: t3 }
370-
# enum t3 { good_2(uint), bad_2};
371-
# fn f(x: t1) -> uint {
368+
# enum T1 { Good1(T2, uint), Bad1};
369+
# struct T2 { body: T3 }
370+
# enum T3 { Good2(uint), Bad2};
371+
# fn f(x: T1) -> uint {
372372
biased_match!(
373-
(x) ~ (good_1(g1, val)) else { return 0 };
374-
(g1.body) ~ (good_2(result) ) else { fail!("Didn't get good_2") };
373+
(x) ~ (Good1(g1, val)) else { return 0 };
374+
(g1.body) ~ (Good2(result) ) else { fail!("Didn't get Good2") };
375375
binds val, result )
376376
// complicated stuff goes here
377377
return result + val;

0 commit comments

Comments
 (0)