Skip to content

Commit f22e666

Browse files
committed
---
yaml --- r: 155467 b: refs/heads/try2 c: 40b86ba h: refs/heads/master i: 155465: 6f0864b 155463: 3bec873 v: v3
1 parent 41f298b commit f22e666

File tree

322 files changed

+11904
-8535
lines changed

Some content is hidden

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

322 files changed

+11904
-8535
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 75d49c8203405ab0af7a2b8b8698af02868fdbc2
8+
refs/heads/try2: 40b86baca0e7e84ece58c2b5f6161371bf672a93
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ If you're just reporting a bug, please see:
44

55
http://doc.rust-lang.org/complement-bugreport.html
66

7+
## Submitting an issue
8+
9+
Please submit issues here for bug reports or implementation details. For feature
10+
requests, language changes, or major changes to the libraries, please submit an
11+
issue against the [RFCs repository](https://github.com/rust-lang/rfcs).
12+
713
## Pull request procedure
814

915
Pull requests should be targeted at Rust's `master` branch.

branches/try2/mk/crates.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5959
TOOLS := compiletest rustdoc rustc
6060

6161
DEPS_core :=
62+
DEPS_libc := core
6263
DEPS_rlibc := core
6364
DEPS_unicode := core
6465
DEPS_alloc := core libc native:jemalloc

branches/try2/mk/docs.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ DOCS := index intro tutorial guide guide-ffi guide-macros guide-lifetimes \
2929
guide-tasks guide-container guide-pointers guide-testing \
3030
guide-runtime complement-bugreport \
3131
complement-lang-faq complement-design-faq complement-project-faq rust \
32-
rustdoc guide-unsafe guide-strings
32+
rustdoc guide-unsafe guide-strings reference
3333

34-
PDF_DOCS := guide rust
34+
PDF_DOCS := guide reference
3535

3636
RUSTDOC_DEPS_rust := doc/full-toc.inc
3737
RUSTDOC_FLAGS_rust := --html-in-header=doc/full-toc.inc

branches/try2/mk/rt.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ LIBUV_CFLAGS_$(1) := $(subst -Werror,,$(CFG_GCCISH_CFLAGS_$(1)))
203203

204204
$$(LIBUV_MAKEFILE_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS) $$(LIBUV_STAMP_$(1))
205205
(cd $(S)src/libuv/ && \
206+
CC="$$(CC_$(1))" \
207+
CXX="$$(CXX_$(1))" \
208+
AR="$$(AR_$(1))" \
206209
$$(CFG_PYTHON) ./gyp_uv.py -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) \
207210
-D ninja \
208211
-DOS=$$(LIBUV_OSTYPE_$(1)) \
@@ -225,6 +228,9 @@ else ifeq ($(OSTYPE_$(1)), apple-ios) # iOS
225228
$$(LIBUV_XCODEPROJ_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS) $$(LIBUV_STAMP_$(1))
226229
cp -rf $(S)src/libuv/ $$(LIBUV_BUILD_DIR_$(1))
227230
(cd $$(LIBUV_BUILD_DIR_$(1)) && \
231+
CC="$$(CC_$(1))" \
232+
CXX="$$(CXX_$(1))" \
233+
AR="$$(AR_$(1))" \
228234
$$(CFG_PYTHON) ./gyp_uv.py -f xcode \
229235
-D ninja \
230236
-R libuv)

branches/try2/mk/tests.mk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,14 @@ ifdef VERBOSE
6060
CTEST_TESTARGS += --verbose
6161
endif
6262

63+
# Setting locale ensures that gdb's output remains consistent.
64+
# This prevents tests from failing with some locales (fixes #17423).
65+
export LC_ALL=C
66+
6367
# If we're running perf then set this environment variable
6468
# to put the benchmarks into 'hard mode'
6569
ifeq ($(MAKECMDGOALS),perf)
66-
RUST_BENCH=1
67-
export RUST_BENCH
70+
export RUST_BENCH=1
6871
endif
6972

7073
TEST_LOG_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log

branches/try2/src/compiletest/runtest.rs

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
273273
format!("--target={}", config.target),
274274
"-L".to_string(),
275275
aux_dir.as_str().unwrap().to_string());
276-
args.push_all_move(split_maybe_args(&config.target_rustcflags));
277-
args.push_all_move(split_maybe_args(&props.compile_flags));
276+
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
277+
args.extend(split_maybe_args(&props.compile_flags).into_iter());
278278
return ProcArgs {
279279
prog: config.rustc_path.as_str().unwrap().to_string(),
280280
args: args,
@@ -321,8 +321,8 @@ actual:\n\
321321
config.build_base.as_str().unwrap().to_string(),
322322
"-L".to_string(),
323323
aux_dir.as_str().unwrap().to_string());
324-
args.push_all_move(split_maybe_args(&config.target_rustcflags));
325-
args.push_all_move(split_maybe_args(&props.compile_flags));
324+
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
325+
args.extend(split_maybe_args(&props.compile_flags).into_iter());
326326
// FIXME (#9639): This needs to handle non-utf8 paths
327327
return ProcArgs {
328328
prog: config.rustc_path.as_str().unwrap().to_string(),
@@ -444,7 +444,8 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
444444
"-nx".to_string(),
445445
format!("-command={}", debugger_script.as_str().unwrap()));
446446

447-
let gdb_path = tool_path.append("/bin/arm-linux-androideabi-gdb");
447+
let mut gdb_path = tool_path;
448+
gdb_path.push_str("/bin/arm-linux-androideabi-gdb");
448449
let procsrv::Result {
449450
out,
450451
err,
@@ -1095,11 +1096,12 @@ fn compile_test_(config: &Config, props: &TestProps,
10951096
testfile: &Path, extra_args: &[String]) -> ProcRes {
10961097
let aux_dir = aux_output_dir_name(config, testfile);
10971098
// FIXME (#9639): This needs to handle non-utf8 paths
1098-
let link_args = vec!("-L".to_string(),
1099-
aux_dir.as_str().unwrap().to_string());
1099+
let mut link_args = vec!("-L".to_string(),
1100+
aux_dir.as_str().unwrap().to_string());
1101+
link_args.extend(extra_args.iter().map(|s| s.clone()));
11001102
let args = make_compile_args(config,
11011103
props,
1102-
link_args.append(extra_args),
1104+
link_args,
11031105
|a, b| ThisFile(make_exe_name(a, b)), testfile);
11041106
compose_and_run_compiler(config, props, testfile, args, None)
11051107
}
@@ -1146,16 +1148,16 @@ fn compose_and_run_compiler(
11461148
for rel_ab in props.aux_builds.iter() {
11471149
let abs_ab = config.aux_base.join(rel_ab.as_slice());
11481150
let aux_props = header::load_props(&abs_ab);
1149-
let crate_type = if aux_props.no_prefer_dynamic {
1151+
let mut crate_type = if aux_props.no_prefer_dynamic {
11501152
Vec::new()
11511153
} else {
11521154
vec!("--crate-type=dylib".to_string())
11531155
};
1156+
crate_type.extend(extra_link_args.clone().into_iter());
11541157
let aux_args =
11551158
make_compile_args(config,
11561159
&aux_props,
1157-
crate_type.append(
1158-
extra_link_args.as_slice()),
1160+
crate_type,
11591161
|a,b| {
11601162
let f = make_lib_name(a, b, testfile);
11611163
ThisDirectory(f.dir_path())
@@ -1246,11 +1248,11 @@ fn make_compile_args(config: &Config,
12461248
};
12471249
args.push(path.as_str().unwrap().to_string());
12481250
if props.force_host {
1249-
args.push_all_move(split_maybe_args(&config.host_rustcflags));
1251+
args.extend(split_maybe_args(&config.host_rustcflags).into_iter());
12501252
} else {
1251-
args.push_all_move(split_maybe_args(&config.target_rustcflags));
1253+
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
12521254
}
1253-
args.push_all_move(split_maybe_args(&props.compile_flags));
1255+
args.extend(split_maybe_args(&props.compile_flags).into_iter());
12541256
return ProcArgs {
12551257
prog: config.rustc_path.as_str().unwrap().to_string(),
12561258
args: args,
@@ -1267,10 +1269,9 @@ fn make_lib_name(config: &Config, auxfile: &Path, testfile: &Path) -> Path {
12671269
fn make_exe_name(config: &Config, testfile: &Path) -> Path {
12681270
let mut f = output_base_name(config, testfile);
12691271
if !os::consts::EXE_SUFFIX.is_empty() {
1270-
match f.filename().map(|s| Vec::from_slice(s).append(os::consts::EXE_SUFFIX.as_bytes())) {
1271-
Some(v) => f.set_filename(v),
1272-
None => ()
1273-
}
1272+
let mut fname = f.filename().unwrap().to_vec();
1273+
fname.extend(os::consts::EXE_SUFFIX.bytes());
1274+
f.set_filename(fname);
12741275
}
12751276
f
12761277
}
@@ -1286,7 +1287,7 @@ fn make_run_args(config: &Config, props: &TestProps, testfile: &Path) ->
12861287
args.push(exe_file.as_str().unwrap().to_string());
12871288

12881289
// Add the arguments in the run_flags directive
1289-
args.push_all_move(split_maybe_args(&props.run_flags));
1290+
args.extend(split_maybe_args(&props.run_flags).into_iter());
12901291

12911292
let prog = args.remove(0).unwrap();
12921293
return ProcArgs {
@@ -1381,12 +1382,10 @@ fn make_out_name(config: &Config, testfile: &Path, extension: &str) -> Path {
13811382
}
13821383

13831384
fn aux_output_dir_name(config: &Config, testfile: &Path) -> Path {
1384-
let mut f = output_base_name(config, testfile);
1385-
match f.filename().map(|s| Vec::from_slice(s).append(b".libaux")) {
1386-
Some(v) => f.set_filename(v),
1387-
None => ()
1388-
}
1389-
f
1385+
let f = output_base_name(config, testfile);
1386+
let mut fname = f.filename().unwrap().to_vec();
1387+
fname.extend("libaux".bytes());
1388+
f.with_filename(fname)
13901389
}
13911390

13921391
fn output_testname(testfile: &Path) -> Path {
@@ -1598,22 +1597,25 @@ fn append_suffix_to_stem(p: &Path, suffix: &str) -> Path {
15981597
if suffix.len() == 0 {
15991598
(*p).clone()
16001599
} else {
1601-
let stem = p.filestem().unwrap();
1602-
p.with_filename(Vec::from_slice(stem).append(b"-").append(suffix.as_bytes()))
1600+
let mut stem = p.filestem().unwrap().to_vec();
1601+
stem.extend("-".bytes());
1602+
stem.extend(suffix.bytes());
1603+
p.with_filename(stem)
16031604
}
16041605
}
16051606

16061607
fn compile_test_and_save_bitcode(config: &Config, props: &TestProps,
16071608
testfile: &Path) -> ProcRes {
16081609
let aux_dir = aux_output_dir_name(config, testfile);
16091610
// FIXME (#9639): This needs to handle non-utf8 paths
1610-
let link_args = vec!("-L".to_string(),
1611-
aux_dir.as_str().unwrap().to_string());
1611+
let mut link_args = vec!("-L".to_string(),
1612+
aux_dir.as_str().unwrap().to_string());
16121613
let llvm_args = vec!("--emit=bc,obj".to_string(),
16131614
"--crate-type=lib".to_string());
1615+
link_args.extend(llvm_args.into_iter());
16141616
let args = make_compile_args(config,
16151617
props,
1616-
link_args.append(llvm_args.as_slice()),
1618+
link_args,
16171619
|a, b| ThisDirectory(output_base_name(a, b).dir_path()),
16181620
testfile);
16191621
compose_and_run_compiler(config, props, testfile, args, None)

branches/try2/src/doc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ To generate an HTML version of a doc from Markdown manually, you can do
3030
something like:
3131

3232
~~~~
33-
pandoc --from=markdown --to=html5 --number-sections -o rust.html rust.md
33+
pandoc --from=markdown --to=html5 --number-sections -o reference.html reference.md
3434
~~~~
3535

3636
(rust.md being the Rust Reference Manual.)

branches/try2/src/doc/guide-pointers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ As being similar to this C code:
505505
{
506506
int *x;
507507
x = (int *)malloc(sizeof(int));
508+
*x = 5;
508509
509510
// stuff happens
510511

branches/try2/src/doc/guide-testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ is not used.
7272
Tests that should not be run can be annotated with the `ignore`
7373
attribute. The existence of these tests will be noted in the test
7474
runner output, but the test will not be run. Tests can also be ignored
75-
by configuration so, for example, to ignore a test on windows you can
76-
write `#[ignore(cfg(target_os = "win32"))]`.
75+
by configuration using the `cfg_attr` attribute so, for example, to ignore a
76+
test on windows you can write `#[cfg_attr(windows, ignore)]`.
7777

7878
Tests that are intended to fail can be annotated with the
7979
`should_fail` attribute. The test will be run, and if it causes its

branches/try2/src/doc/guide-unsafe.md

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ fn start(_argc: int, _argv: *const *const u8) -> int {
466466
// provided by libstd.
467467
#[lang = "stack_exhausted"] extern fn stack_exhausted() {}
468468
#[lang = "eh_personality"] extern fn eh_personality() {}
469-
#[lang = "sized"] trait Sized { }
469+
#[lang = "fail_fmt"] fn fail_fmt() -> ! { loop {} }
470470
# // fn main() {} tricked you, rustdoc!
471471
```
472472

@@ -489,32 +489,28 @@ pub extern fn main(argc: int, argv: *const *const u8) -> int {
489489
490490
#[lang = "stack_exhausted"] extern fn stack_exhausted() {}
491491
#[lang = "eh_personality"] extern fn eh_personality() {}
492-
#[lang = "sized"] trait Sized { }
492+
#[lang = "fail_fmt"] fn fail_fmt() -> ! { loop {} }
493493
# // fn main() {} tricked you, rustdoc!
494494
```
495495

496496

497497
The compiler currently makes a few assumptions about symbols which are available
498498
in the executable to call. Normally these functions are provided by the standard
499-
xlibrary, but without it you must define your own.
499+
library, but without it you must define your own.
500500

501-
The first of these two functions, `stack_exhausted`, is invoked whenever stack
501+
The first of these three functions, `stack_exhausted`, is invoked whenever stack
502502
overflow is detected. This function has a number of restrictions about how it
503503
can be called and what it must do, but if the stack limit register is not being
504504
maintained then a task always has an "infinite stack" and this function
505505
shouldn't get triggered.
506506

507-
The second of these two functions, `eh_personality`, is used by the failure
508-
mechanisms of the compiler. This is often mapped to GCC's personality function
509-
(see the [libstd implementation](std/rt/unwind/index.html) for more
510-
information), but crates which do not trigger failure can be assured that this
511-
function is never called.
512-
513-
The final item in the example is a trait called `Sized`. This a trait
514-
that represents data of a known static size: it is integral to the
515-
Rust type system, and so the compiler expects the standard library to
516-
provide it. Since you are not using the standard library, you have to
517-
provide it yourself.
507+
The second of these three functions, `eh_personality`, is used by the
508+
failure mechanisms of the compiler. This is often mapped to GCC's
509+
personality function (see the
510+
[libstd implementation](std/rt/unwind/index.html) for more
511+
information), but crates which do not trigger failure can be assured
512+
that this function is never called. The final function, `fail_fmt`, is
513+
also used by the failure mechanisms of the compiler.
518514

519515
## Using libcore
520516

@@ -573,8 +569,8 @@ pub extern fn dot_product(a: *const u32, a_len: u32,
573569
return ret;
574570
}
575571
576-
#[lang = "begin_unwind"]
577-
extern fn begin_unwind(args: &core::fmt::Arguments,
572+
#[lang = "fail_fmt"]
573+
extern fn fail_fmt(args: &core::fmt::Arguments,
578574
file: &str,
579575
line: uint) -> ! {
580576
loop {}
@@ -587,8 +583,8 @@ extern fn begin_unwind(args: &core::fmt::Arguments,
587583
```
588584

589585
Note that there is one extra lang item here which differs from the examples
590-
above, `begin_unwind`. This must be defined by consumers of libcore because the
591-
core library declares failure, but it does not define it. The `begin_unwind`
586+
above, `fail_fmt`. This must be defined by consumers of libcore because the
587+
core library declares failure, but it does not define it. The `fail_fmt`
592588
lang item is this crate's definition of failure, and it must be guaranteed to
593589
never return.
594590

@@ -694,7 +690,7 @@ fn main(argc: int, argv: *const *const u8) -> int {
694690
695691
#[lang = "stack_exhausted"] extern fn stack_exhausted() {}
696692
#[lang = "eh_personality"] extern fn eh_personality() {}
697-
#[lang = "sized"] trait Sized {}
693+
#[lang = "fail_fmt"] fn fail_fmt() -> ! { loop {} }
698694
```
699695

700696
Note the use of `abort`: the `exchange_malloc` lang item is assumed to
@@ -706,7 +702,7 @@ Other features provided by lang items include:
706702
`==`, `<`, dereferencing (`*`) and `+` (etc.) operators are all
707703
marked with lang items; those specific four are `eq`, `ord`,
708704
`deref`, and `add` respectively.
709-
- stack unwinding and general failure; the `eh_personality`, `fail_`
705+
- stack unwinding and general failure; the `eh_personality`, `fail`
710706
and `fail_bounds_checks` lang items.
711707
- the traits in `std::kinds` used to indicate types that satisfy
712708
various kinds; lang items `send`, `sync` and `copy`.

branches/try2/src/doc/guide.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,7 @@ You can create an array with just square brackets:
15071507

15081508
```{rust}
15091509
let nums = [1i, 2i, 3i];
1510+
let nums = [1i, ..20]; // Shorthand for an array of 20 elements all initialized to 1
15101511
```
15111512

15121513
So what's the difference? An array has a fixed size, so you can't add or
@@ -2151,14 +2152,10 @@ In this case, we say `x` is a `uint` explicitly, so Rust is able to properly
21512152
tell `random()` what to generate. In a similar fashion, both of these work:
21522153

21532154
```{rust,ignore}
2154-
let input_num = from_str::<Option<uint>>("5");
2155+
let input_num = from_str::<uint>("5");
21552156
let input_num: Option<uint> = from_str("5");
21562157
```
21572158

2158-
In this case, I happen to prefer the latter, and in the `random()` case, I prefer
2159-
the former. I think the nested `<>`s make the first option especially ugly and
2160-
a bit harder to read.
2161-
21622159
Anyway, with us now converting our input to a number, our code looks like this:
21632160

21642161
```{rust,ignore}
@@ -4493,8 +4490,8 @@ This will print
44934490
```
44944491

44954492
`filter()` is an adapter that takes a closure as an argument. This closure
4496-
returns `true` or `false`. The new iterator `filter()` produces returns
4497-
only the elements that that closure returned `true` for:
4493+
returns `true` or `false`. The new iterator `filter()` produces
4494+
only the elements that that closure returns `true` for:
44984495

44994496
```{rust}
45004497
for i in range(1i, 100i).filter(|x| x % 2 == 0) {

branches/try2/src/doc/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ development of Rust itself is discussed.
4646
# Specification
4747

4848
Rust does not have an exact specification, but an effort to describe as much of
49-
the language in as much detail as possible is in [the manual](rust.html).
49+
the language in as much detail as possible is in [the reference](reference.html).
5050

5151
# Guides
5252

0 commit comments

Comments
 (0)