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 10 pull requests #50847

Merged
merged 26 commits into from
May 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4f2cfb5
Remove leftover tab in libtest outputs
phansch May 2, 2018
3f6b3bb
Improve format string errors
estebank May 10, 2018
a91f6f7
Tweak `nearest_common_ancestor()`.
nnethercote May 11, 2018
8ab2d15
Add Option::xor method
clarfonthey May 9, 2018
ce0b7cc
Fix grammar documentation wrt Unicode identifiers
bstrie May 16, 2018
ab4735e
Null exclusions in grammar docs
bstrie May 16, 2018
f778bde
Avoid repeated HashMap lookups in `opt_normalize_projection_type`.
nnethercote May 16, 2018
47bc774
Avoid allocations in `opt_normalize_projection_type`.
nnethercote May 16, 2018
37dee69
Add `bless` x.py subcommand for easy ui test replacement
oli-obk May 16, 2018
ceed8eb
Make `bless` a flag instead of a subcommand
oli-obk May 16, 2018
0356a61
Fix selftests
oli-obk May 17, 2018
74bfd94
`bless` also produces `.nll` files now
oli-obk May 17, 2018
0ac2fd1
Update docs and diagnostics
oli-obk May 17, 2018
ec0d946
Make sure people know the book is free oline
glassresistor May 17, 2018
eac94d1
Revert #49767
steveklabnik May 17, 2018
cfa26da
Update tutorial.md
glassresistor May 17, 2018
6e95b87
Rollup merge of #50387 - phansch:remove_leftover_tab, r=alexcrichton
Mark-Simulacrum May 17, 2018
0c0bb18
Rollup merge of #50553 - clarcharr:option_xor, r=sfackler
Mark-Simulacrum May 17, 2018
b3734bd
Rollup merge of #50610 - estebank:fmt-str, r=Kimundi
Mark-Simulacrum May 17, 2018
e1848df
Rollup merge of #50649 - nnethercote:tweak-nearest_common_ancestor, r…
Mark-Simulacrum May 17, 2018
77a4296
Rollup merge of #50790 - bstrie:grammar, r=steveklabnik
Mark-Simulacrum May 17, 2018
c95267e
Rollup merge of #50791 - bstrie:null, r=QuietMisdreavus
Mark-Simulacrum May 17, 2018
f83e4d7
Rollup merge of #50806 - oli-obk:gesundheit, r=ehuss
Mark-Simulacrum May 17, 2018
54df1bf
Rollup merge of #50818 - nnethercote:faster-normalize, r=nikomatsakis
Mark-Simulacrum May 17, 2018
53ea73a
Rollup merge of #50837 - steveklabnik:revert-49767, r=QuietMisdreavus
Mark-Simulacrum May 17, 2018
faa1f21
Rollup merge of #50839 - glassresistor:master, r=steveklabnik
Mark-Simulacrum May 17, 2018
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
7 changes: 6 additions & 1 deletion src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,12 @@ fn main() {
}

if verbose > 1 {
eprintln!("rustc command: {:?}", cmd);
eprintln!(
"rustc command: {:?}={:?} {:?}",
bootstrap::util::dylib_path_var(),
env::join_paths(&dylib_path).unwrap(),
cmd,
);
eprintln!("sysroot: {:?}", sysroot);
eprintln!("libdir: {:?}", libdir);
}
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1460,6 +1460,7 @@ mod __test {
rustc_args: vec![],
fail_fast: true,
doc_tests: DocTests::No,
bless: false,
};

let build = Build::new(config);
Expand Down
12 changes: 12 additions & 0 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ pub enum Subcommand {
},
Test {
paths: Vec<PathBuf>,
/// Whether to automatically update stderr/stdout files
bless: bool,
test_args: Vec<String>,
rustc_args: Vec<String>,
fail_fast: bool,
Expand Down Expand Up @@ -173,6 +175,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`");
);
opts.optflag("", "no-doc", "do not run doc tests");
opts.optflag("", "doc", "only run doc tests");
opts.optflag("", "bless", "update all stderr/stdout files of failing ui tests");
},
"bench" => { opts.optmulti("", "test-args", "extra arguments", "ARGS"); },
"clean" => { opts.optflag("", "all", "clean all build artifacts"); },
Expand Down Expand Up @@ -258,6 +261,7 @@ Arguments:
./x.py test src/test/run-pass
./x.py test src/libstd --test-args hash_map
./x.py test src/libstd --stage 0
./x.py test src/test/ui --bless

If no arguments are passed then the complete artifacts for that stage are
compiled and tested.
Expand Down Expand Up @@ -322,6 +326,7 @@ Arguments:
"test" => {
Subcommand::Test {
paths,
bless: matches.opt_present("bless"),
test_args: matches.opt_strs("test-args"),
rustc_args: matches.opt_strs("rustc-args"),
fail_fast: !matches.opt_present("no-fail-fast"),
Expand Down Expand Up @@ -424,6 +429,13 @@ impl Subcommand {
_ => DocTests::Yes,
}
}

pub fn bless(&self) -> bool {
match *self {
Subcommand::Test { bless, .. } => bless,
_ => false,
}
}
}

fn split(s: Vec<String>) -> Vec<String> {
Expand Down
46 changes: 18 additions & 28 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ pub enum TestKind {
Bench,
}

impl From<Kind> for TestKind {
fn from(kind: Kind) -> Self {
match kind {
Kind::Test => TestKind::Test,
Kind::Bench => TestKind::Bench,
_ => panic!("unexpected kind in crate: {:?}", kind)
}
}
}

impl TestKind {
// Return the cargo subcommand for this test kind
fn subcommand(self) -> &'static str {
Expand Down Expand Up @@ -951,6 +961,10 @@ impl Step for Compiletest {
cmd.arg("--host").arg(&*compiler.host);
cmd.arg("--llvm-filecheck").arg(builder.llvm_filecheck(builder.config.build));

if builder.config.cmd.bless() {
cmd.arg("--bless");
}

if let Some(ref nodejs) = builder.config.nodejs {
cmd.arg("--nodejs").arg(nodejs);
}
Expand Down Expand Up @@ -1342,13 +1356,7 @@ impl Step for CrateLibrustc {

for krate in builder.in_tree_crates("rustc-main") {
if run.path.ends_with(&krate.path) {
let test_kind = if builder.kind == Kind::Test {
TestKind::Test
} else if builder.kind == Kind::Bench {
TestKind::Bench
} else {
panic!("unexpected builder.kind in crate: {:?}", builder.kind);
};
let test_kind = builder.kind.into();

builder.ensure(CrateLibrustc {
compiler,
Expand Down Expand Up @@ -1394,13 +1402,7 @@ impl Step for CrateNotDefault {
let builder = run.builder;
let compiler = builder.compiler(builder.top_stage, run.host);

let test_kind = if builder.kind == Kind::Test {
TestKind::Test
} else if builder.kind == Kind::Bench {
TestKind::Bench
} else {
panic!("unexpected builder.kind in crate: {:?}", builder.kind);
};
let test_kind = builder.kind.into();

builder.ensure(CrateNotDefault {
compiler,
Expand Down Expand Up @@ -1461,13 +1463,7 @@ impl Step for Crate {
let compiler = builder.compiler(builder.top_stage, run.host);

let make = |mode: Mode, krate: &CargoCrate| {
let test_kind = if builder.kind == Kind::Test {
TestKind::Test
} else if builder.kind == Kind::Bench {
TestKind::Bench
} else {
panic!("unexpected builder.kind in crate: {:?}", builder.kind);
};
let test_kind = builder.kind.into();

builder.ensure(Crate {
compiler,
Expand Down Expand Up @@ -1625,13 +1621,7 @@ impl Step for CrateRustdoc {
fn make_run(run: RunConfig) {
let builder = run.builder;

let test_kind = if builder.kind == Kind::Test {
TestKind::Test
} else if builder.kind == Kind::Bench {
TestKind::Bench
} else {
panic!("unexpected builder.kind in crate: {:?}", builder.kind);
};
let test_kind = builder.kind.into();

builder.ensure(CrateRustdoc {
host: run.host,
Expand Down
23 changes: 9 additions & 14 deletions src/doc/grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,29 +101,24 @@ properties: `ident`, `non_null`, `non_eol`, `non_single_quote` and

### Identifiers

The `ident` production is any nonempty Unicode[^non_ascii_idents] string of
The `ident` production is any nonempty Unicode string of
the following form:

[^non_ascii_idents]: Non-ASCII characters in identifiers are currently feature
gated. This is expected to improve soon.
- The first character is in one of the following ranges `U+0041` to `U+005A`
("A" to "Z"), `U+0061` to `U+007A` ("a" to "z"), or `U+005F` ("\_").
- The remaining characters are in the range `U+0030` to `U+0039` ("0" to "9"),
or any of the prior valid initial characters.

- The first character has property `XID_start`
- The remaining characters have property `XID_continue`

that does _not_ occur in the set of [keywords](#keywords).

> **Note**: `XID_start` and `XID_continue` as character properties cover the
> character ranges used to form the more familiar C and Java language-family
> identifiers.
as long as the identifier does _not_ occur in the set of [keywords](#keywords).

### Delimiter-restricted productions

Some productions are defined by exclusion of particular Unicode characters:

- `non_null` is any single Unicode character aside from `U+0000` (null)
- `non_eol` is `non_null` restricted to exclude `U+000A` (`'\n'`)
- `non_single_quote` is `non_null` restricted to exclude `U+0027` (`'`)
- `non_double_quote` is `non_null` restricted to exclude `U+0022` (`"`)
- `non_eol` is any single Unicode character aside from `U+000A` (`'\n'`)
- `non_single_quote` is any single Unicode character aside from `U+0027` (`'`)
- `non_double_quote` is any single Unicode character aside from `U+0022` (`"`)

## Comments

Expand Down
2 changes: 1 addition & 1 deletion src/doc/tutorial.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
% The Rust Tutorial

This tutorial has been deprecated in favor of [the Book](book/index.html). Go check that out instead!
This tutorial has been deprecated in favor of [the Book](book/index.html), which is available free online and in dead tree form. Go check that out instead!
Loading