Skip to content

Commit 1ad80f4

Browse files
committed
---
yaml --- r: 276061 b: refs/heads/auto c: c72a771 h: refs/heads/master i: 276059: a252331
1 parent be5a26d commit 1ad80f4

File tree

356 files changed

+4505
-2874
lines changed

Some content is hidden

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

356 files changed

+4505
-2874
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 3e9ea3b6044f06f588e01436cb4344ae93964846
11+
refs/heads/auto: c72a771dd838ea8ad704bded5a13607e156c87a7
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/configure

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
609609
opt rustbuild 0 "use the rust and cargo based build system"
610610
opt orbit 0 "get MIR where it belongs - everywhere; most importantly, in orbit"
611611
opt codegen-tests 1 "run the src/test/codegen tests"
612+
opt option-checking 1 "complain about unrecognized options in this configure script"
612613

613614
# Optimization and debugging options. These may be overridden by the release channel, etc.
614615
opt_nosave optimize 1 "build optimized rust code"
@@ -674,8 +675,11 @@ then
674675
fi
675676

676677
# Validate Options
677-
step_msg "validating $CFG_SELF args"
678-
validate_opt
678+
if [ -z "$CFG_DISABLE_OPTION_CHECKING" ]
679+
then
680+
step_msg "validating $CFG_SELF args"
681+
validate_opt
682+
fi
679683

680684
# Validate the release channel, and configure options
681685
case "$CFG_RELEASE_CHANNEL" in
@@ -819,6 +823,19 @@ then
819823
fi
820824
fi
821825

826+
# LLDB tests on OSX require /usr/bin/python, not something like Homebrew's
827+
# /usr/local/bin/python. We're loading a compiled module for LLDB tests which is
828+
# only compatible with the system.
829+
case $CFG_BUILD in
830+
*-apple-darwin)
831+
CFG_LLDB_PYTHON=/usr/bin/python
832+
;;
833+
*)
834+
CFG_LLDB_PYTHON=$CFG_PYTHON
835+
;;
836+
esac
837+
putvar CFG_LLDB_PYTHON
838+
822839
step_msg "looking for target specific programs"
823840

824841
probe CFG_ADB adb

branches/auto/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
128128
test rustc_lint rustc_const_eval
129129

130130

131-
TOOL_DEPS_compiletest := test getopts log
131+
TOOL_DEPS_compiletest := test getopts log serialize
132132
TOOL_DEPS_rustdoc := rustdoc
133133
TOOL_DEPS_rustc := rustc_driver
134134
TOOL_DEPS_rustbook := std rustdoc

branches/auto/mk/tests.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,11 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
619619
--stage-id stage$(1)-$(2) \
620620
--target $(2) \
621621
--host $(3) \
622-
--python $$(CFG_PYTHON) \
622+
--docck-python $$(CFG_PYTHON) \
623+
--lldb-python $$(CFG_LLDB_PYTHON) \
623624
--gdb-version="$(CFG_GDB_VERSION)" \
624625
--lldb-version="$(CFG_LLDB_VERSION)" \
625-
--android-cross-path=$(CFG_ANDROID_CROSS_PATH) \
626+
--android-cross-path=$(CFG_ARM_LINUX_ANDROIDEABI_NDK) \
626627
--adb-path=$(CFG_ADB) \
627628
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
628629
--host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \

branches/auto/src/bootstrap/build/check.rs

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
// except according to those terms.
1010

1111
use std::fs;
12-
use std::path::PathBuf;
12+
use std::path::{PathBuf, Path};
13+
use std::process::Command;
1314

1415
use build::{Build, Compiler};
1516

@@ -81,8 +82,19 @@ pub fn compiletest(build: &Build,
8182

8283
// FIXME: needs android support
8384
cmd.arg("--android-cross-path").arg("");
85+
8486
// FIXME: CFG_PYTHON should probably be detected more robustly elsewhere
85-
cmd.arg("--python").arg("python");
87+
let python_default = "python";
88+
cmd.arg("--docck-python").arg(python_default);
89+
90+
if build.config.build.ends_with("apple-darwin") {
91+
// Force /usr/bin/python on OSX for LLDB tests because we're loading the
92+
// LLDB plugin's compiled module which only works with the system python
93+
// (namely not Homebrew-installed python)
94+
cmd.arg("--lldb-python").arg("/usr/bin/python");
95+
} else {
96+
cmd.arg("--lldb-python").arg(python_default);
97+
}
8698

8799
if let Some(ref vers) = build.gdb_version {
88100
cmd.arg("--gdb-version").arg(vers);
@@ -102,3 +114,42 @@ pub fn compiletest(build: &Build,
102114

103115
build.run(&mut cmd);
104116
}
117+
118+
pub fn docs(build: &Build, compiler: &Compiler) {
119+
let mut stack = vec![build.src.join("src/doc")];
120+
121+
while let Some(p) = stack.pop() {
122+
if p.is_dir() {
123+
stack.extend(t!(p.read_dir()).map(|p| t!(p).path()));
124+
continue
125+
}
126+
127+
if p.extension().and_then(|s| s.to_str()) != Some("md") {
128+
continue
129+
}
130+
131+
println!("doc tests for: {}", p.display());
132+
markdown_test(build, compiler, &p);
133+
}
134+
}
135+
136+
pub fn error_index(build: &Build, compiler: &Compiler) {
137+
println!("Testing error-index stage{}", compiler.stage);
138+
139+
let output = testdir(build, compiler.host).join("error-index.md");
140+
build.run(build.tool_cmd(compiler, "error_index_generator")
141+
.arg("markdown")
142+
.arg(&output)
143+
.env("CFG_BUILD", &build.config.build));
144+
145+
markdown_test(build, compiler, &output);
146+
}
147+
148+
fn markdown_test(build: &Build, compiler: &Compiler, markdown: &Path) {
149+
let mut cmd = Command::new(build.rustdoc(compiler));
150+
build.add_rustc_lib_path(compiler, &mut cmd);
151+
cmd.arg("--test");
152+
cmd.arg(markdown);
153+
cmd.arg("--test-args").arg(build.flags.args.join(" "));
154+
build.run(&mut cmd);
155+
}

branches/auto/src/bootstrap/build/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ impl Build {
308308
check::compiletest(self, &compiler, target.target,
309309
"compile-fail", "compile-fail-fulldeps")
310310
}
311+
CheckDocs { compiler } => {
312+
check::docs(self, &compiler);
313+
}
314+
CheckErrorIndex { compiler } => {
315+
check::error_index(self, &compiler);
316+
}
311317

312318
DistDocs { stage } => dist::docs(self, stage, target.target),
313319
DistMingw { _dummy } => dist::mingw(self, target.target),

branches/auto/src/bootstrap/build/step.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ macro_rules! targets {
9696
(check_rpass_valgrind, CheckRPassValgrind { compiler: Compiler<'a> }),
9797
(check_rpass_full, CheckRPassFull { compiler: Compiler<'a> }),
9898
(check_cfail_full, CheckCFailFull { compiler: Compiler<'a> }),
99+
(check_docs, CheckDocs { compiler: Compiler<'a> }),
100+
(check_error_index, CheckErrorIndex { compiler: Compiler<'a> }),
99101

100102
// Distribution targets, creating tarballs
101103
(dist, Dist { stage: u32 }),
@@ -341,7 +343,10 @@ impl<'a> Step<'a> {
341343
self.check_rpass_valgrind(compiler),
342344
self.check_rpass_full(compiler),
343345
self.check_cfail_full(compiler),
346+
self.check_error_index(compiler),
347+
self.check_docs(compiler),
344348
self.check_linkcheck(stage),
349+
self.check_tidy(stage),
345350
self.dist(stage),
346351
]
347352
}
@@ -383,6 +388,12 @@ impl<'a> Step<'a> {
383388
vec![self.librustc(compiler),
384389
self.tool_compiletest(compiler.stage)]
385390
}
391+
Source::CheckDocs { compiler } => {
392+
vec![self.libstd(compiler)]
393+
}
394+
Source::CheckErrorIndex { compiler } => {
395+
vec![self.libstd(compiler), self.tool_error_index(compiler.stage)]
396+
}
386397

387398
Source::ToolLinkchecker { stage } |
388399
Source::ToolTidy { stage } => {

branches/auto/src/doc/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ libraries.
99

1010
To generate HTML documentation from one source file/crate, do something like:
1111

12-
~~~~
12+
~~~~text
1313
rustdoc --output html-doc/ --output-format html ../src/libstd/path.rs
1414
~~~~
1515

@@ -20,7 +20,7 @@ rustdoc --output html-doc/ --output-format html ../src/libstd/path.rs
2020
To generate an HTML version of a doc from Markdown manually, you can do
2121
something like:
2222

23-
~~~~
23+
~~~~text
2424
rustdoc reference.md
2525
~~~~
2626

branches/auto/src/doc/book/const-and-static.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ the result of a function call or anything similarly complex or at runtime.
7979

8080
Almost always, if you can choose between the two, choose `const`. It’s pretty
8181
rare that you actually want a memory location associated with your constant,
82-
and using a const allows for optimizations like constant propagation not only
82+
and using a `const` allows for optimizations like constant propagation not only
8383
in your crate but downstream crates.

branches/auto/src/doc/book/lifetimes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% Lifetimes
22

3-
This guide is three of three presenting Rust’s ownership system. This is one of
4-
Rust’s most unique and compelling features, with which Rust developers should
3+
This is the last of three sections presenting Rust’s ownership system. This is one of
4+
Rust’s most distinct and compelling features, with which Rust developers should
55
become quite acquainted. Ownership is how Rust achieves its largest goal,
66
memory safety. There are a few distinct concepts, each with its own chapter:
77

branches/auto/src/doc/book/ownership.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% Ownership
22

3-
This guide is one of three presenting Rust’s ownership system. This is one of
4-
Rust’s most unique and compelling features, with which Rust developers should
3+
This is the first of three sections presenting Rust’s ownership system. This is one of
4+
Rust’s most distinct and compelling features, with which Rust developers should
55
become quite acquainted. Ownership is how Rust achieves its largest goal,
66
memory safety. There are a few distinct concepts, each with its own
77
chapter:

branches/auto/src/doc/book/references-and-borrowing.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% References and Borrowing
22

3-
This guide is two of three presenting Rust’s ownership system. This is one of
4-
Rust’s most unique and compelling features, with which Rust developers should
3+
This is the second of three sections presenting Rust’s ownership system. This is one of
4+
Rust’s most distinct and compelling features, with which Rust developers should
55
become quite acquainted. Ownership is how Rust achieves its largest goal,
66
memory safety. There are a few distinct concepts, each with its own
77
chapter:
@@ -77,6 +77,32 @@ let answer = foo(&v1, &v2);
7777
// we can use v1 and v2 here!
7878
```
7979

80+
A more concrete example:
81+
82+
```rust
83+
fn main() {
84+
// Don't worry if you don't understand how `fold` works, the point here is that an immutable reference is borrowed.
85+
fn sum_vec(v: &Vec<i32>) -> i32 {
86+
return v.iter().fold(0, |a, &b| a + b);
87+
}
88+
// Borrow two vectors and and sum them.
89+
// This kind of borrowing does not allow mutation to the borrowed.
90+
fn foo(v1: &Vec<i32>, v2: &Vec<i32>) -> i32 {
91+
// do stuff with v1 and v2
92+
let s1 = sum_vec(v1);
93+
let s2 = sum_vec(v2);
94+
// return the answer
95+
s1 + s2
96+
}
97+
98+
let v1 = vec![1, 2, 3];
99+
let v2 = vec![4, 5, 6];
100+
101+
let answer = foo(&v1, &v2);
102+
println!("{}", answer);
103+
}
104+
```
105+
80106
Instead of taking `Vec<i32>`s as our arguments, we take a reference:
81107
`&Vec<i32>`. And instead of passing `v1` and `v2` directly, we pass `&v1` and
82108
`&v2`. We call the `&T` type a ‘reference’, and rather than owning the resource,

branches/auto/src/doc/nomicon/subtyping.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ inferred variance, so `Fn(T)` is invariant in `T`).
5353
Some important variances:
5454

5555
* `&'a T` is variant over `'a` and `T` (as is `*const T` by metaphor)
56-
* `&'a mut T` is variant with over `'a` but invariant over `T`
56+
* `&'a mut T` is variant over `'a` but invariant over `T`
5757
* `Fn(T) -> U` is invariant over `T`, but variant over `U`
5858
* `Box`, `Vec`, and all other collections are variant over the types of
5959
their contents

branches/auto/src/doc/style/errors/ergonomics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pattern.
99

1010
Prefer
1111

12-
```rust
12+
```rust,ignore
1313
use std::io::{File, Open, Write, IoError};
1414
1515
struct Info {
@@ -31,7 +31,7 @@ fn write_info(info: &Info) -> Result<(), IoError> {
3131

3232
over
3333

34-
```rust
34+
```rust,ignore
3535
use std::io::{File, Open, Write, IoError};
3636
3737
struct Info {

branches/auto/src/doc/style/features/functions-and-methods/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
Prefer
66

7-
```rust
7+
```rust,ignore
88
impl Foo {
99
pub fn frob(&self, w: widget) { ... }
1010
}
1111
```
1212

1313
over
1414

15-
```rust
15+
```rust,ignore
1616
pub fn frob(foo: &Foo, w: widget) { ... }
1717
```
1818

0 commit comments

Comments
 (0)