Commit Graph

77081 Commits

Author SHA1 Message Date
bors
8830a03043 Auto merge of #50020 - oli-obk:clippy, r=Manishearth
Update clippy

r? @Manishearth
2018-04-19 16:39:57 +00:00
bors
8a28d94ea1 Auto merge of #49900 - pnkfelix:compare-mode-nll-followup-3, r=nikomatsakis
Add src/test/ui regression testing for NLL

This PR changes `x.py test` so that when you are running the `ui` test suite, it will also always run `compiletest` in the new `--compare-mode=nll`, which just double-checks that when running under the experimental NLL mode, the output matches the `<source-name>.nll.stderr` file, if present.

In order to reduce the chance of a developer revolt in response to this change, this PR also includes some changes to make the `--compare-mode=nll` more user-friendly:

 1. It now generates nll-specific .stamp files, and uses them (so that repeated runs can reuse previously cached results).
 2. Each line of terminal output distinguishes whether we are running under `--compare-mode=nll` by printing with the prefix `[ui (nll)]` instead of just the prefix `[ui]`.

Subtask of rust-lang/rust#48879
2018-04-19 11:13:10 +00:00
bors
5fe6b58dfc Auto merge of #49949 - oli-obk:const_signed_pat, r=eddyb
Sign extend constants in range patterns

fixes  #49940

r? @Mark-Simulacrum
2018-04-19 08:41:35 +00:00
Oliver Schneider
b22c9c01fb
Sign extend constants in range patterns 2018-04-19 09:01:27 +02:00
Oliver Schneider
0f1f9a79f2
Update clippy 2018-04-19 08:52:52 +02:00
bors
78fc510743 Auto merge of #49890 - varkor:xpy-check-rustc_trans, r=alexcrichton
Add rustc_trans to x.py check

r? @Mark-Simulacrum

I looked at `bootstrap/compile.rs` and `bootstrap/check.rs` to try to work out which steps were appropriate, but I'm sure I've overlooked some details here, so it's worth checking carefully I've got all the steps right (e.g. I wasn't sure whether we want to build LLVM if necessary with `x.py check`, though I thought it was probably better to than to not).

From a quick test, it seems to be working, though.
2018-04-19 06:19:27 +00:00
bors
883bf4ba2e Auto merge of #49630 - npmccallum:shl, r=alexcrichton
Update Rhs on ShlAssign to default to Self

This matches the behavior on ShrAssign and all other *Assign operations.
2018-04-19 03:53:32 +00:00
bors
5dc896e9e7 Auto merge of #50048 - glandium:issue50041, r=eddyb
rustc_trans: also check dominators for SSA values in mir::analyze

Fixes #50041
2018-04-19 01:13:29 +00:00
varkor
86acb09273
Add rerun-if-env-changed=RUST_CHECK to librustc_llvm 2018-04-19 00:09:41 +01:00
bors
e0f9b32357 Auto merge of #50022 - nrc:doc-analysis, r=mark-simulacrum
Only emit save-analysis data for `cargo build` tasks

Previously, we were emittinng analysis data for all tasks, including `doc`. That meant we got two sets of save-analysis data, one from the normal build and one from the docs. That means indexing with the RLS took twice as long and made downloads larger and build times longer.

cc https://github.com/rust-lang-nursery/rls/issues/826

r? @Mark-Simulacrum
2018-04-18 22:30:00 +00:00
bors
ac3c2288f9 Auto merge of #50017 - tinaun:stabilize-all-the-things, r=sfackler
stabilize a bunch of minor api additions

besides `ptr::NonNull::cast` (which is 4 days away from end of FCP) all of these have been finished with FCP for a few weeks now with minimal issues raised

* Closes #41020
* Closes #42818
* Closes #44030
* Closes #44400
* Closes #46507
* Closes #47653
* Closes #46344

the following functions will be stabilized in 1.27:
* `[T]::rsplit`
* `[T]::rsplit_mut`
* `[T]::swap_with_slice`
* `ptr::swap_nonoverlapping`
* `NonNull::cast`
* `Duration::from_micros`
* `Duration::from_nanos`
* `Duration::subsec_millis`
* `Duration::subsec_micros`
* `HashMap::remove_entry`
2018-04-18 19:47:56 +00:00
bors
c8fa49f83b Auto merge of #50006 - rcoh:reorder-compiler-builtins, r=oli-obk
Reorder injection of std to get better compilation error

Per #49851, reorder injection imports to get a better error message.

r? @oli-obk
2018-04-18 17:07:21 +00:00
bors
3dfda16525 Auto merge of #49993 - nnethercote:shrink-Token, r=alexcrichton
Change the hashcounts in raw `Lit` variants from usize to u16.

This reduces the size of `Token` from 32 bytes to 24 bytes on 64-bit
platforms.
2018-04-18 14:44:54 +00:00
Felix S. Klock II
33bcb4ed16 When running under compare-mode=nll, generate expected output to foo.nll.stderr
This allows easy revision of the update-references.sh script (included
here) so that it can update the expected output for nll rather than
stderr. It also reminds the rustc developer via the filename that they
are looking at output generated under comapre-mode=nll.

One could argue that there is still a problem with the strategy encoded here:
if we reach a scenario where a change to the compiler brings the output
under AST and NLL modes back into sync, this code will continue to still
generate output to distinct `foo.stderr` and `foo.nll.stderr` files, and
will continue to copy those two files back to corresponding distinct
files in the source tree, even if the *content* of the two files is now the
same.

  * Arguably the "right thing" to do in that case is to remove the
    `foo.nll.stderr` file entirely.

  * However, I think the real answer is that we will probably want to
    double-check such cases by hand anyway. We should be regularly
    double-checking the diffs between `foo.stderr` and
    `foo.nll.stderr`, and if we see a zero-diff case, then we should
    evaluate whether that is correct, and if so, remove the file by
    hand.)

  * In any case, I think the default behavior encoded here (or at
    least *intended* to be encoded here) is superior to the
    alternative of *only* generating a `foo.nll.stderr` file if one
    already existed in the source tree at the time that `compiletest`
    was invoked (and otherwise unconditionally generating a
    `foo.stderr` file, as was the behavior prior to this commit),
    because that alternative is more likely to cause rustc developers
    to overwrite a `foo.stderr` file with the stderr output from a
    compare-mode=nll run, which will then break the *normal*
    `compiletest` run and probably be much more confusing for the
    average rustc developer.
2018-04-18 15:37:30 +02:00
Felix S. Klock II
1a4326d3fb Workaround rust-lang/rust#49998 by opting into experimental -Z nll-subminimal-causes flag
This commit only applies the flag to the one test case,
ui/span/dropck_vec_cycle_checked.rs, that absolutely needs it. Without
the flag, that test takes an unknown amount of time (greater than 1
minute) to compile. But its possible that other tests would also
benefit from the flag, and we may want to make it the default (after
evaluating its impact on other tests).

In terms of its known impact on other tests, I have only evaluated the
ui tests, and the *only* ui test I have found that the flag impacts
(running under NLL mode, of course), is src/test/ui/nll/issue-31567.rs

In particular:

```
% ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/nll/issue-31567.rs
error[E0597]: `*v.0` does not live long enough
  --> ../src/test/ui/nll/issue-31567.rs:22:26
   |
22 |     let s_inner: &'a S = &*v.0; //~ ERROR `*v.0` does not live long enough
   |                          ^^^^^ borrowed value does not live long enough
23 |     &s_inner.0
24 | }
   | - borrowed value only lives until here
   |
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 21:1...
  --> ../src/test/ui/nll/issue-31567.rs:21:1
   |
21 | fn get_dangling<'a>(v: VecWrapper<'a>) -> &'a u32 {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0597`.
% ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/nll/issue-31567.rs  -Z nll-subminimal-causes
error[E0597]: `*v.0` does not live long enough
  --> ../src/test/ui/nll/issue-31567.rs:22:26
   |
22 |     let s_inner: &'a S = &*v.0; //~ ERROR `*v.0` does not live long enough
   |                          ^^^^^ borrowed value does not live long enough
23 |     &s_inner.0
24 | }
   | -
   | |
   | borrowed value only lives until here
   | borrow later used here, when `v` is dropped

error: aborting due to previous error

For more information about this error, try `rustc --explain E0597`.
%
```
2018-04-18 15:37:30 +02:00
Felix S. Klock II
a771b0f075 Work around rust-lang/rust#49998 with experimental code that does less updating of cause map.
This seems to avoid poor scaling on src/test/ui/span/dropck_vec_cycle_checked.rs
2018-04-18 15:37:30 +02:00
Felix S. Klock II
699c98ec6a Removed .nll.stderr files that currently match their corresponding .stderr files. 2018-04-18 15:37:30 +02:00
Felix S. Klock II
032081cdff Trivial updates to .nll.stderr files post-rebase, reflecting s/-Znll/nll/ in messages. 2018-04-18 15:37:23 +02:00
Felix S. Klock II
ea454746b3 Update the previously checkpointed (but unused by bors) tests to reflect current reality. 2018-04-18 15:37:18 +02:00
Felix S. Klock II
02a7809f1c Generate separate stamp files for --compare-mode=nll, and also use them. :) 2018-04-18 14:47:28 +02:00
Felix S. Klock II
ae6a9d4ba4 Change output of compiletest to include the compare-mode when present.
E.g. when running with `--compare-mode=nll`, then each test line will
look like e.g.:

```
test [ui (nll)] ui/issue-10969.rs ... ok
```
2018-04-18 14:47:28 +02:00
Felix S. Klock II
5589550356 Expand x.py test to also run with --compare-mode=nll on src/test/ui suite. 2018-04-18 14:47:24 +02:00
bors
65d201f7d6 Auto merge of #49981 - nox:fix-signed-niches, r=eddyb
Properly handle ranges of signed enums using both extremums (fixes #49973)

Fixes #49973.
2018-04-18 12:22:11 +00:00
Eduard-Mihai Burtescu
45fd7416a4 rustc_trans: also check dominators for SSA values in mir::analyze.
Fixes #50041
2018-04-18 20:02:23 +09:00
varkor
84f52a7162 Replace Build with Builder 2018-04-18 10:56:04 +01:00
varkor
1db9fabdf7 Do not rebuild LLVM for x.py check 2018-04-18 10:49:00 +01:00
varkor
f31c01c713 Abstract LLVM building from bootstrap
This deduplicates the LLVM building functionality from compile.rs and check.rs.
2018-04-18 10:49:00 +01:00
varkor
49b677346f Correct the timestamp for CodegenBackend check 2018-04-18 10:44:47 +01:00
varkor
b53468f500 Add rustc_trans to x.py check 2018-04-18 10:44:09 +01:00
bors
f4bb956278 Auto merge of #49349 - Zoxc:sync-errors, r=michaelwoerister
Make Handler more thread-safe

The use of `code_emitted` to suppress extended explanations is not thread safe. I'm not sure why we keep the documentation for errors outside `diagnostics.rs` anyway. It would be better to add a `teach` method to `DiagnosticsBuilder`, so instead of:
```
if self.tcx.sess.teach(&err.get_code().unwrap()) {
    err.note("...");
}
```
we'd use `err.teach("...")`

cc @estebank

r? @michaelwoerister
2018-04-18 08:29:14 +00:00
bors
23561c6747 Auto merge of #49972 - Mark-Simulacrum:remove-build, r=alexcrichton
Remove uses of Build across Builder steps

This is purely a code cleanup; there should be no functional changes.

r? @alexcrichton
2018-04-18 05:54:21 +00:00
bors
dcb44ca2f7 Auto merge of #49969 - mark-i-m:allocator_fmt, r=estebank
Various rustfmt and commenting changes

These are factored out of #49320

There aren't actually any changes in functionality, just rustfmt and doccomments.
2018-04-18 03:35:55 +00:00
Mark Simulacrum
be1e7893d5 Remove uses of Build across Builder steps 2018-04-17 19:50:50 -06:00
bors
b91e6a2672 Auto merge of #49950 - Zoxc:default-span, r=estebank
Improve query cycle error message

r? @michaelwoerister
2018-04-18 01:04:04 +00:00
bors
9a59133c09 Auto merge of #50036 - nrc:update, r=alexcrichton
Update Rustfmt

Fixes RLS and Rustfmt and enables a new nightly

r? @alexcrichton
2018-04-17 21:56:50 +00:00
Nick Cameron
70539d084e Update Rustfmt 2018-04-18 08:21:19 +12:00
bors
786e3058d2 Auto merge of #49904 - michaelwoerister:no-debug-attr, r=alexcrichton
Work around LLVM debuginfo problem in librustc_driver.

Works around a problem (https://github.com/rust-lang/rust/issues/48910) with global variable debuginfo generation for `rustc_driver::get_trans::LOAD` by applying `#[no_debug]` to it (which just disables debuginfo generation for that variable). This way we can build the compiler with debuginfo again.

Since the problem is also present in beta, this workaround might have to be backported.

r? @alexcrichton
2018-04-17 19:26:25 +00:00
bors
9379bcdd0b Auto merge of #50033 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - #49699 (Removed 'proc' from the reserved keywords list)
 - #49966 (Multiple query search)
 - #50013 (Remove no longer necessary comparison to Vec::splice.)
 - #50032 (rustdoc: Don't include private paths in all.html)

Failed merges:
2018-04-17 16:51:55 +00:00
Guillaume Gomez
92d29c1267
Rollup merge of #50032 - ollie27:rustdoc_all_private, r=GuillaumeGomez
rustdoc: Don't include private paths in all.html

For example the `std` [`all.html`](https://doc.rust-lang.org/nightly/std/all.html) includes references to the `coresimd` module which is a private implementation detail.

r? @GuillaumeGomez
2018-04-17 18:43:17 +02:00
Guillaume Gomez
6f5fc47ccc
Rollup merge of #50013 - frewsxcv:frewsxcv-ssplice, r=GuillaumeGomez
Remove no longer necessary comparison to Vec::splice.

`String::replace_range` was previously called `String::splice`, so this
note was necessary to differentiate it from the `Vec` method. Now that
it's renamed, this note no longer seems necessary.
2018-04-17 18:43:16 +02:00
Guillaume Gomez
7a6fad32af
Rollup merge of #49966 - GuillaumeGomez:comma-search, r=QuietMisdreavus
Multiple query search

Part of #49757.

r? @QuietMisdreavus
2018-04-17 18:43:15 +02:00
Guillaume Gomez
7a39e90afc
Rollup merge of #49699 - zesterer:master, r=joshtriplett
Removed 'proc' from the reserved keywords list

Remove 'proc' from the reserved keywords list.

'proc' is a very useful identifier name for a lot of things. It's especially useful when dealing with processes, operating system internals, and kernel development.
2018-04-17 18:43:13 +02:00
Mark Mansi
787b70592f Turn some comments into doccomments 2018-04-17 10:54:10 -05:00
Mark Mansi
5977818678 run rustfmt on rustc_driver/driver.rs 2018-04-17 10:54:10 -05:00
Mark Mansi
3d6d9f98d1 Run rustfmt 2018-04-17 10:52:33 -05:00
John Kåre Alsaker
e5fc06da8a Make one_time_diagnostics thread-safe 2018-04-17 16:43:30 +02:00
John Kåre Alsaker
bf06a53265 Make Handler more thread-safe 2018-04-17 16:43:30 +02:00
bors
881a7cd86e Auto merge of #49836 - nikomatsakis:nll-facts-prep, r=pnkfelix
prep work for using timely dataflow with NLL

Two major changes:

**Two-phase borrows are overhauled.** We no longer have two bits per borrow. Instead, we track -- for each borrow -- an (optional) "activation point". Then, for each point P where the borrow is in scope, we check where P falls relative to the activation point. If P is between the reservation point and the activation point, then this is the "reservation" phase of the borrow, else the borrow is considered active. This is simpler and means that the dataflow doesn't have to care about 2-phase at all, at last not yet.

**We no longer support using the MIR borrow checker without NLL.** It is going to be increasingly untenable to support lexical mode as we go forward, I think, and also of increasingly little value. This also exposed a few bugs in NLL mode due to increased testing.

r? @pnkfelix
cc @bobtwinkles
2018-04-17 14:23:57 +00:00
Michael Woerister
281492898b Clean up attribute handling in create_function_debug_context(). 2018-04-17 16:23:48 +02:00
Michael Woerister
6f9c36e400 Use #[no_debug] to work around LLVM problem with rustc_driver::get_trans::LOAD. 2018-04-17 15:49:54 +02:00