Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 6 pull requests #33154

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ccaa2f8
Suppress fallback and ambiguity errors
nikomatsakis Mar 15, 2016
a4e0e6b
avoid "type must be known here" errors if tainted
nikomatsakis Apr 5, 2016
b023fcc
move checking for unsized target type into `cast`
nikomatsakis Apr 11, 2016
47d3b80
move regr test into same directory
nikomatsakis Apr 11, 2016
2c9dfaf
fix various error messages
nikomatsakis Apr 12, 2016
89bbd2c
Be a bit more constrained in our early check
nikomatsakis Apr 14, 2016
9db6a41
etc: Add debugger.Terminate() to lldb_batchmode.py
alexcrichton Apr 18, 2016
ede8944
rustbuild: Run all markdown documentation tests
alexcrichton Apr 15, 2016
cbe6292
mk: Force system python for LLDB tests on OSX
alexcrichton Apr 19, 2016
4c01c93
Remove unused trait imports flagged by lint
sanxiyn Apr 19, 2016
e4f534c
Warn unused trait imports
sanxiyn Apr 19, 2016
6ede0f8
Fix tests related to no_std
sanxiyn Apr 20, 2016
baf2fff
Fix more tests
sanxiyn Apr 20, 2016
01d2b4a
port compiletest to use JSON output
nikomatsakis Apr 16, 2016
bf624c4
improve tidy to give you file that failed
nikomatsakis Apr 16, 2016
28a3c88
pacify the merciless acrichto (somewhat)
nikomatsakis Apr 18, 2016
6ce5e77
move json.rs file
nikomatsakis Apr 19, 2016
7aa5947
fix broken test revealed by compiletest
nikomatsakis Apr 19, 2016
906cc48
add serialize as a dep for compiletest
nikomatsakis Apr 19, 2016
399149a
fix `transmute-from-fn-item-types-lint`
nikomatsakis Apr 21, 2016
fd0632f
Fix for filepath for cfail tests in windows
Apr 22, 2016
d81de48
Merge remote-tracking branch 'rust-lang/master' into compiletest-json
Apr 22, 2016
b22c8ec
configure: Support --disable-option-checking
gbonnet1 Jan 21, 2016
46b75eb
configure: Move --disable-option-checking to a more appropriate location
gbonnet1 Feb 3, 2016
10d4cda
Fix filepath check for macro backtrace
Apr 22, 2016
db8e996
Rollup merge of #31169 - gmbonnet:disable-option-checking, r=brson
Manishearth Apr 22, 2016
fbb1a0b
Rollup merge of #32258 - nikomatsakis:fewer-errors, r=arielb1
Manishearth Apr 22, 2016
6c0e63e
Rollup merge of #33020 - nikomatsakis:compiletest-json, r=alexcrichton
Manishearth Apr 22, 2016
20a8cf9
Rollup merge of #33084 - alexcrichton:osx-python-sanity, r=michaelwoe…
Manishearth Apr 22, 2016
9cdfc10
Rollup merge of #33091 - sanxiyn:unused-trait-import-3, r=nrc
Manishearth Apr 22, 2016
9e07a74
Rollup merge of #33092 - alexcrichton:rustbuild-docs, r=brson
Manishearth Apr 22, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
opt rustbuild 0 "use the rust and cargo based build system"
opt orbit 0 "get MIR where it belongs - everywhere; most importantly, in orbit"
opt codegen-tests 1 "run the src/test/codegen tests"
opt option-checking 1 "complain about unrecognized options in this configure script"

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

# Validate Options
step_msg "validating $CFG_SELF args"
validate_opt
if [ -z "$CFG_DISABLE_OPTION_CHECKING" ]
then
step_msg "validating $CFG_SELF args"
validate_opt
fi

# Validate the release channel, and configure options
case "$CFG_RELEASE_CHANNEL" in
Expand Down Expand Up @@ -819,6 +823,19 @@ then
fi
fi

# LLDB tests on OSX require /usr/bin/python, not something like Homebrew's
# /usr/local/bin/python. We're loading a compiled module for LLDB tests which is
# only compatible with the system.
case $CFG_BUILD in
*-apple-darwin)
CFG_LLDB_PYTHON=/usr/bin/python
;;
*)
CFG_LLDB_PYTHON=$CFG_PYTHON
;;
esac
putvar CFG_LLDB_PYTHON

step_msg "looking for target specific programs"

probe CFG_ADB adb
Expand Down
2 changes: 1 addition & 1 deletion mk/crates.mk
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
test rustc_lint rustc_const_eval


TOOL_DEPS_compiletest := test getopts log
TOOL_DEPS_compiletest := test getopts log serialize
TOOL_DEPS_rustdoc := rustdoc
TOOL_DEPS_rustc := rustc_driver
TOOL_DEPS_rustbook := std rustdoc
Expand Down
3 changes: 2 additions & 1 deletion mk/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,8 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
--stage-id stage$(1)-$(2) \
--target $(2) \
--host $(3) \
--python $$(CFG_PYTHON) \
--docck-python $$(CFG_PYTHON) \
--lldb-python $$(CFG_LLDB_PYTHON) \
--gdb-version="$(CFG_GDB_VERSION)" \
--lldb-version="$(CFG_LLDB_VERSION)" \
--android-cross-path=$(CFG_ANDROID_CROSS_PATH) \
Expand Down
55 changes: 53 additions & 2 deletions src/bootstrap/build/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
// except according to those terms.

use std::fs;
use std::path::PathBuf;
use std::path::{PathBuf, Path};
use std::process::Command;

use build::{Build, Compiler};

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

// FIXME: needs android support
cmd.arg("--android-cross-path").arg("");

// FIXME: CFG_PYTHON should probably be detected more robustly elsewhere
cmd.arg("--python").arg("python");
let python_default = "python";
cmd.arg("--docck-python").arg(python_default);

if build.config.build.ends_with("apple-darwin") {
// Force /usr/bin/python on OSX for LLDB tests because we're loading the
// LLDB plugin's compiled module which only works with the system python
// (namely not Homebrew-installed python)
cmd.arg("--lldb-python").arg("/usr/bin/python");
} else {
cmd.arg("--lldb-python").arg(python_default);
}

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

build.run(&mut cmd);
}

pub fn docs(build: &Build, compiler: &Compiler) {
let mut stack = vec![build.src.join("src/doc")];

while let Some(p) = stack.pop() {
if p.is_dir() {
stack.extend(t!(p.read_dir()).map(|p| t!(p).path()));
continue
}

if p.extension().and_then(|s| s.to_str()) != Some("md") {
continue
}

println!("doc tests for: {}", p.display());
markdown_test(build, compiler, &p);
}
}

pub fn error_index(build: &Build, compiler: &Compiler) {
println!("Testing error-index stage{}", compiler.stage);

let output = testdir(build, compiler.host).join("error-index.md");
build.run(build.tool_cmd(compiler, "error_index_generator")
.arg("markdown")
.arg(&output)
.env("CFG_BUILD", &build.config.build));

markdown_test(build, compiler, &output);
}

fn markdown_test(build: &Build, compiler: &Compiler, markdown: &Path) {
let mut cmd = Command::new(build.rustdoc(compiler));
build.add_rustc_lib_path(compiler, &mut cmd);
cmd.arg("--test");
cmd.arg(markdown);
cmd.arg("--test-args").arg(build.flags.args.join(" "));
build.run(&mut cmd);
}
6 changes: 6 additions & 0 deletions src/bootstrap/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,12 @@ impl Build {
check::compiletest(self, &compiler, target.target,
"compile-fail", "compile-fail-fulldeps")
}
CheckDocs { compiler } => {
check::docs(self, &compiler);
}
CheckErrorIndex { compiler } => {
check::error_index(self, &compiler);
}

DistDocs { stage } => dist::docs(self, stage, target.target),
DistMingw { _dummy } => dist::mingw(self, target.target),
Expand Down
11 changes: 11 additions & 0 deletions src/bootstrap/build/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ macro_rules! targets {
(check_rpass_valgrind, CheckRPassValgrind { compiler: Compiler<'a> }),
(check_rpass_full, CheckRPassFull { compiler: Compiler<'a> }),
(check_cfail_full, CheckCFailFull { compiler: Compiler<'a> }),
(check_docs, CheckDocs { compiler: Compiler<'a> }),
(check_error_index, CheckErrorIndex { compiler: Compiler<'a> }),

// Distribution targets, creating tarballs
(dist, Dist { stage: u32 }),
Expand Down Expand Up @@ -341,7 +343,10 @@ impl<'a> Step<'a> {
self.check_rpass_valgrind(compiler),
self.check_rpass_full(compiler),
self.check_cfail_full(compiler),
self.check_error_index(compiler),
self.check_docs(compiler),
self.check_linkcheck(stage),
self.check_tidy(stage),
self.dist(stage),
]
}
Expand Down Expand Up @@ -383,6 +388,12 @@ impl<'a> Step<'a> {
vec![self.librustc(compiler),
self.tool_compiletest(compiler.stage)]
}
Source::CheckDocs { compiler } => {
vec![self.libstd(compiler)]
}
Source::CheckErrorIndex { compiler } => {
vec![self.libstd(compiler), self.tool_error_index(compiler.stage)]
}

Source::ToolLinkchecker { stage } |
Source::ToolTidy { stage } => {
Expand Down
4 changes: 2 additions & 2 deletions src/doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ libraries.

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

~~~~
~~~~text
rustdoc --output html-doc/ --output-format html ../src/libstd/path.rs
~~~~

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

~~~~
~~~~text
rustdoc reference.md
~~~~

Expand Down
4 changes: 2 additions & 2 deletions src/doc/style/errors/ergonomics.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pattern.

Prefer

```rust
```rust,ignore
use std::io::{File, Open, Write, IoError};

struct Info {
Expand All @@ -31,7 +31,7 @@ fn write_info(info: &Info) -> Result<(), IoError> {

over

```rust
```rust,ignore
use std::io::{File, Open, Write, IoError};

struct Info {
Expand Down
4 changes: 2 additions & 2 deletions src/doc/style/features/functions-and-methods/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

Prefer

```rust
```rust,ignore
impl Foo {
pub fn frob(&self, w: widget) { ... }
}
```

over

```rust
```rust,ignore
pub fn frob(foo: &Foo, w: widget) { ... }
```

Expand Down
26 changes: 13 additions & 13 deletions src/doc/style/features/functions-and-methods/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

Prefer

```rust
```rust,ignore
fn foo(b: Bar) {
// use b as owned, directly
}
```

over

```rust
```rust,ignore
fn foo(b: &Bar) {
let b = b.clone();
// use b as owned after cloning
Expand All @@ -33,13 +33,13 @@ needed, not as a way of signaling that copies should be cheap to make.

Prefer

```rust
```rust,ignore
fn foo(b: Bar) -> Bar { ... }
```

over

```rust
```rust,ignore
fn foo(b: Box<Bar>) -> Box<Bar> { ... }
```

Expand All @@ -56,13 +56,13 @@ it becomes.

Prefer

```rust
```rust,ignore
fn foo<T: Iterator<i32>>(c: T) { ... }
```

over any of

```rust
```rust,ignore
fn foo(c: &[i32]) { ... }
fn foo(c: &Vec<i32>) { ... }
fn foo(c: &SomeOtherCollection<i32>) { ... }
Expand All @@ -83,14 +83,14 @@ concrete nor overly abstract. See the discussion on

Prefer either of

```rust
```rust,ignore
fn foo(b: &Bar) { ... }
fn foo(b: &mut Bar) { ... }
```

over

```rust
```rust,ignore
fn foo(b: Bar) { ... }
```

Expand All @@ -101,13 +101,13 @@ ownership is actually needed.

Prefer

```rust
```rust,ignore
fn foo() -> (Bar, Bar)
```

over

```rust
```rust,ignore
fn foo(output: &mut Bar) -> Bar
```

Expand All @@ -120,7 +120,7 @@ multiple values, it should do so via one of these types.
The primary exception: sometimes a function is meant to modify data
that the caller already owns, for example to re-use a buffer:

```rust
```rust,ignore
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize>
```

Expand All @@ -146,7 +146,7 @@ Choose an argument type that rules out bad inputs.

For example, prefer

```rust
```rust,ignore
enum FooMode {
Mode1,
Mode2,
Expand All @@ -157,7 +157,7 @@ fn foo(mode: FooMode) { ... }

over

```rust
```rust,ignore
fn foo(mode2: bool, mode3: bool) {
assert!(!mode2 || !mode3);
...
Expand Down
10 changes: 5 additions & 5 deletions src/doc/style/features/functions-and-methods/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ API.

Prefer

```rust
```rust,ignore
struct SearchResult {
found: bool, // item in container?
expected_index: usize // what would the item's index be?
Expand All @@ -26,27 +26,27 @@ fn binary_search(&self, k: Key) -> SearchResult
```
or

```rust
```rust,ignore
fn binary_search(&self, k: Key) -> (bool, usize)
```

over

```rust
```rust,ignore
fn binary_search(&self, k: Key) -> bool
```

#### Yield back ownership:

Prefer

```rust
```rust,ignore
fn from_utf8_owned(vv: Vec<u8>) -> Result<String, Vec<u8>>
```

over

```rust
```rust,ignore
fn from_utf8_owned(vv: Vec<u8>) -> Option<String>
```

Expand Down
Loading