Skip to content

Commit cec7097

Browse files
committed
---
yaml --- r: 135167 b: refs/heads/snap-stage3 c: 75d49c8 h: refs/heads/master i: 135165: 3add63c 135163: c2276c3 135159: d29b530 135151: 2750728 135135: ffc358f 135103: f654513 135039: fb277b7 134911: 35586fa 134655: 0c07742 134143: 804073f 133119: 1b0ce5b 131071: 126dbf5 v: v3
1 parent 9db8de9 commit cec7097

File tree

324 files changed

+8543
-11906
lines changed

Some content is hidden

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

324 files changed

+8543
-11906
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 74090504219e4e37c1a6d9fdd8600f44b51c7b04
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: eb816eee0f1803f03fbf046a26a1920659c14d82
4+
refs/heads/snap-stage3: 75d49c8203405ab0af7a2b8b8698af02868fdbc2
55
refs/heads/try: 14378ea357c06c23607ca61ade44f60a7a64a1c7
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/CONTRIBUTING.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ 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-
137
## Pull request procedure
148

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

branches/snap-stage3/mk/crates.mk

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

6161
DEPS_core :=
62-
DEPS_libc := core
6362
DEPS_rlibc := core
6463
DEPS_unicode := core
6564
DEPS_alloc := core libc native:jemalloc

branches/snap-stage3/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 reference
32+
rustdoc guide-unsafe guide-strings
3333

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

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

branches/snap-stage3/mk/rt.mk

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,6 @@ 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))" \
209206
$$(CFG_PYTHON) ./gyp_uv.py -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) \
210207
-D ninja \
211208
-DOS=$$(LIBUV_OSTYPE_$(1)) \
@@ -228,9 +225,6 @@ else ifeq ($(OSTYPE_$(1)), apple-ios) # iOS
228225
$$(LIBUV_XCODEPROJ_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS) $$(LIBUV_STAMP_$(1))
229226
cp -rf $(S)src/libuv/ $$(LIBUV_BUILD_DIR_$(1))
230227
(cd $$(LIBUV_BUILD_DIR_$(1)) && \
231-
CC="$$(CC_$(1))" \
232-
CXX="$$(CXX_$(1))" \
233-
AR="$$(AR_$(1))" \
234228
$$(CFG_PYTHON) ./gyp_uv.py -f xcode \
235229
-D ninja \
236230
-R libuv)

branches/snap-stage3/mk/tests.mk

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,11 @@ 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-
6763
# If we're running perf then set this environment variable
6864
# to put the benchmarks into 'hard mode'
6965
ifeq ($(MAKECMDGOALS),perf)
70-
export RUST_BENCH=1
66+
RUST_BENCH=1
67+
export RUST_BENCH
7168
endif
7269

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

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

Lines changed: 30 additions & 32 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.extend(split_maybe_args(&config.target_rustcflags).into_iter());
277-
args.extend(split_maybe_args(&props.compile_flags).into_iter());
276+
args.push_all_move(split_maybe_args(&config.target_rustcflags));
277+
args.push_all_move(split_maybe_args(&props.compile_flags));
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.extend(split_maybe_args(&config.target_rustcflags).into_iter());
325-
args.extend(split_maybe_args(&props.compile_flags).into_iter());
324+
args.push_all_move(split_maybe_args(&config.target_rustcflags));
325+
args.push_all_move(split_maybe_args(&props.compile_flags));
326326
// FIXME (#9639): This needs to handle non-utf8 paths
327327
return ProcArgs {
328328
prog: config.rustc_path.as_str().unwrap().to_string(),
@@ -444,8 +444,7 @@ 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 mut gdb_path = tool_path;
448-
gdb_path.push_str("/bin/arm-linux-androideabi-gdb");
447+
let gdb_path = tool_path.append("/bin/arm-linux-androideabi-gdb");
449448
let procsrv::Result {
450449
out,
451450
err,
@@ -1096,12 +1095,11 @@ fn compile_test_(config: &Config, props: &TestProps,
10961095
testfile: &Path, extra_args: &[String]) -> ProcRes {
10971096
let aux_dir = aux_output_dir_name(config, testfile);
10981097
// FIXME (#9639): This needs to handle non-utf8 paths
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()));
1098+
let link_args = vec!("-L".to_string(),
1099+
aux_dir.as_str().unwrap().to_string());
11021100
let args = make_compile_args(config,
11031101
props,
1104-
link_args,
1102+
link_args.append(extra_args),
11051103
|a, b| ThisFile(make_exe_name(a, b)), testfile);
11061104
compose_and_run_compiler(config, props, testfile, args, None)
11071105
}
@@ -1148,16 +1146,16 @@ fn compose_and_run_compiler(
11481146
for rel_ab in props.aux_builds.iter() {
11491147
let abs_ab = config.aux_base.join(rel_ab.as_slice());
11501148
let aux_props = header::load_props(&abs_ab);
1151-
let mut crate_type = if aux_props.no_prefer_dynamic {
1149+
let crate_type = if aux_props.no_prefer_dynamic {
11521150
Vec::new()
11531151
} else {
11541152
vec!("--crate-type=dylib".to_string())
11551153
};
1156-
crate_type.extend(extra_link_args.clone().into_iter());
11571154
let aux_args =
11581155
make_compile_args(config,
11591156
&aux_props,
1160-
crate_type,
1157+
crate_type.append(
1158+
extra_link_args.as_slice()),
11611159
|a,b| {
11621160
let f = make_lib_name(a, b, testfile);
11631161
ThisDirectory(f.dir_path())
@@ -1248,11 +1246,11 @@ fn make_compile_args(config: &Config,
12481246
};
12491247
args.push(path.as_str().unwrap().to_string());
12501248
if props.force_host {
1251-
args.extend(split_maybe_args(&config.host_rustcflags).into_iter());
1249+
args.push_all_move(split_maybe_args(&config.host_rustcflags));
12521250
} else {
1253-
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
1251+
args.push_all_move(split_maybe_args(&config.target_rustcflags));
12541252
}
1255-
args.extend(split_maybe_args(&props.compile_flags).into_iter());
1253+
args.push_all_move(split_maybe_args(&props.compile_flags));
12561254
return ProcArgs {
12571255
prog: config.rustc_path.as_str().unwrap().to_string(),
12581256
args: args,
@@ -1269,9 +1267,10 @@ fn make_lib_name(config: &Config, auxfile: &Path, testfile: &Path) -> Path {
12691267
fn make_exe_name(config: &Config, testfile: &Path) -> Path {
12701268
let mut f = output_base_name(config, testfile);
12711269
if !os::consts::EXE_SUFFIX.is_empty() {
1272-
let mut fname = f.filename().unwrap().to_vec();
1273-
fname.extend(os::consts::EXE_SUFFIX.bytes());
1274-
f.set_filename(fname);
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+
}
12751274
}
12761275
f
12771276
}
@@ -1287,7 +1286,7 @@ fn make_run_args(config: &Config, props: &TestProps, testfile: &Path) ->
12871286
args.push(exe_file.as_str().unwrap().to_string());
12881287

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

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

13841383
fn aux_output_dir_name(config: &Config, testfile: &Path) -> Path {
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)
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
13891390
}
13901391

13911392
fn output_testname(testfile: &Path) -> Path {
@@ -1597,25 +1598,22 @@ fn append_suffix_to_stem(p: &Path, suffix: &str) -> Path {
15971598
if suffix.len() == 0 {
15981599
(*p).clone()
15991600
} else {
1600-
let mut stem = p.filestem().unwrap().to_vec();
1601-
stem.extend("-".bytes());
1602-
stem.extend(suffix.bytes());
1603-
p.with_filename(stem)
1601+
let stem = p.filestem().unwrap();
1602+
p.with_filename(Vec::from_slice(stem).append(b"-").append(suffix.as_bytes()))
16041603
}
16051604
}
16061605

16071606
fn compile_test_and_save_bitcode(config: &Config, props: &TestProps,
16081607
testfile: &Path) -> ProcRes {
16091608
let aux_dir = aux_output_dir_name(config, testfile);
16101609
// FIXME (#9639): This needs to handle non-utf8 paths
1611-
let mut link_args = vec!("-L".to_string(),
1612-
aux_dir.as_str().unwrap().to_string());
1610+
let link_args = vec!("-L".to_string(),
1611+
aux_dir.as_str().unwrap().to_string());
16131612
let llvm_args = vec!("--emit=bc,obj".to_string(),
16141613
"--crate-type=lib".to_string());
1615-
link_args.extend(llvm_args.into_iter());
16161614
let args = make_compile_args(config,
16171615
props,
1618-
link_args,
1616+
link_args.append(llvm_args.as_slice()),
16191617
|a, b| ThisDirectory(output_base_name(a, b).dir_path()),
16201618
testfile);
16211619
compose_and_run_compiler(config, props, testfile, args, None)

branches/snap-stage3/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 reference.html reference.md
33+
pandoc --from=markdown --to=html5 --number-sections -o rust.html rust.md
3434
~~~~
3535

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

branches/snap-stage3/src/doc/guide-pointers.md

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

branches/snap-stage3/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 using the `cfg_attr` attribute so, for example, to ignore a
76-
test on windows you can write `#[cfg_attr(windows, ignore)]`.
75+
by configuration so, for example, to ignore a test on windows you can
76+
write `#[ignore(cfg(target_os = "win32"))]`.
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/snap-stage3/src/doc/guide-unsafe.md

Lines changed: 21 additions & 17 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 = "fail_fmt"] fn fail_fmt() -> ! { loop {} }
469+
#[lang = "sized"] trait Sized { }
470470
# // fn main() {} tricked you, rustdoc!
471471
```
472472

@@ -489,28 +489,32 @@ 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 = "fail_fmt"] fn fail_fmt() -> ! { loop {} }
492+
#[lang = "sized"] trait Sized { }
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-
library, but without it you must define your own.
499+
xlibrary, but without it you must define your own.
500500

501-
The first of these three functions, `stack_exhausted`, is invoked whenever stack
501+
The first of these two 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 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.
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.
514518

515519
## Using libcore
516520

@@ -569,8 +573,8 @@ pub extern fn dot_product(a: *const u32, a_len: u32,
569573
return ret;
570574
}
571575
572-
#[lang = "fail_fmt"]
573-
extern fn fail_fmt(args: &core::fmt::Arguments,
576+
#[lang = "begin_unwind"]
577+
extern fn begin_unwind(args: &core::fmt::Arguments,
574578
file: &str,
575579
line: uint) -> ! {
576580
loop {}
@@ -583,8 +587,8 @@ extern fn fail_fmt(args: &core::fmt::Arguments,
583587
```
584588

585589
Note that there is one extra lang item here which differs from the examples
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`
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`
588592
lang item is this crate's definition of failure, and it must be guaranteed to
589593
never return.
590594

@@ -690,7 +694,7 @@ fn main(argc: int, argv: *const *const u8) -> int {
690694
691695
#[lang = "stack_exhausted"] extern fn stack_exhausted() {}
692696
#[lang = "eh_personality"] extern fn eh_personality() {}
693-
#[lang = "fail_fmt"] fn fail_fmt() -> ! { loop {} }
697+
#[lang = "sized"] trait Sized {}
694698
```
695699

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

branches/snap-stage3/src/doc/guide.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,6 @@ 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
15111510
```
15121511

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

21542153
```{rust,ignore}
2155-
let input_num = from_str::<uint>("5");
2154+
let input_num = from_str::<Option<uint>>("5");
21562155
let input_num: Option<uint> = from_str("5");
21572156
```
21582157

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+
21592162
Anyway, with us now converting our input to a number, our code looks like this:
21602163

21612164
```{rust,ignore}
@@ -4490,8 +4493,8 @@ This will print
44904493
```
44914494

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

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

branches/snap-stage3/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 reference](reference.html).
49+
the language in as much detail as possible is in [the manual](rust.html).
5050

5151
# Guides
5252

0 commit comments

Comments
 (0)