Oliver Middleton [Sat, 14 Oct 2017 15:35:25 +0000 (16:35 +0100)]
rustbuild: Don't try to build rustdoc API docs with compiler docs
rustdoc is built separately to rustc now so the docs would need to be
generated separately as well. Also rustdoc doesn't build at stage 1
which prevented the compiler docs being built at stage 1.
bors [Sat, 14 Oct 2017 11:22:46 +0000 (11:22 +0000)]
Auto merge of #45162 - chrisvittal:mir-testing, r=nikomatsakis
Modify MIR testing to require consecutive lines
MIR testing now requires that lines be consecutive. To achive this,
instead of collecting the expected mir as a string, it is now wrapped in
an `ExpectedLine` enum, that is either `Elision` or `Text(T)` where `T:
AsRef<str>`. `Text` lines must be matched in order, unless separated by
`Elision` lines. Elision occurs lazily, that is, an Elision will skip
as few lines as possible.
To add a new elision marker. Put a comment containing only "..." and
whitespace in any MIR testing block. Like so:
bors [Sat, 14 Oct 2017 06:34:20 +0000 (06:34 +0000)]
Auto merge of #45137 - theotherjimmy:vtable-methods-query, r=nikomatsakis
Queryify Vtable methods
This query might come with a downside: It converts an iterator to a Vec, which may increase the working set of rustc on programs that use many many traits (I think that's where this is used).
kennytm [Fri, 13 Oct 2017 15:38:04 +0000 (23:38 +0800)]
Rollup merge of #45245 - stjepang:more-padding-between-impls, r=QuietMisdreavus
Rustdoc: Increase padding between consecutive impls
Currently, [implementors](https://doc.rust-lang.org/nightly/std/iter/trait.IntoIterator.html#implementors) list is a bit too condensed. More spacing makes the list easier to read.
Check out [this comment](https://github.com/rust-lang/rust/issues/41879#issuecomment-333121118) to see what's the effect of this change.
kennytm [Fri, 13 Oct 2017 15:38:02 +0000 (23:38 +0800)]
Rollup merge of #45236 - alexcrichton:build-less, r=Mark-Simulacrum
rustbuild: Prevent spurious rebuilds of the RLS
The RLS currently is rebuilt every time you test it because the `OPENSSL_DIR`
env var is changing, which is in turn caused by an accidental omission of
`prepare_tool_cargo` when testing the RLS.
kennytm [Fri, 13 Oct 2017 15:38:00 +0000 (23:38 +0800)]
Rollup merge of #45209 - kennytm:treat-checksum-error-as-download-error, r=Mark-Simulacrum
rustbuild: Make openssl download more reliable.
1. Add `-f` flag to curl, so when the server returns 403 or 500 it will fail immediately.
2. Moved the checksum part into the retry loop, assuming checksum failure is due to broken download that can be fixed by downloading again.
This PR is created responding to two recent spurious failures in https://github.com/rust-lang/rust/pull/45075#issuecomment-335202319 and https://github.com/rust-lang/rust/pull/45030#issuecomment-335029356.
kennytm [Fri, 13 Oct 2017 15:37:59 +0000 (23:37 +0800)]
Rollup merge of #45203 - alexcrichton:update-llvm, r=michaelwoerister
rustc: Update LLVM with a ThinLTO fix
This commit updates LLVM with a patch that's landed upstream to fix an assertion
that was tripping when ThinLTO was activated. Unfortunately I wasn't able to get
a reduced test case, but I've tested manually on the affected crates and the
assertion is indeed fixed.
kennytm [Fri, 13 Oct 2017 15:37:58 +0000 (23:37 +0800)]
Rollup merge of #45189 - alexcrichton:thinlto-allocators, r=michaelwoerister
rustc: Handle `#[no_mangle]` anywhere in a crate
This commit updates the reachability pass of the compiler to seed the local
worklist with `#[no_mangle]`-like items anywhere in a crate, not just those
reachable from public items.
kennytm [Fri, 13 Oct 2017 15:37:57 +0000 (23:37 +0800)]
Rollup merge of #45178 - Badel2:comma-after-struct, r=petrochenkov
Better error message for comma after base struct
#41834
This adds a better error for commas after the base struct:
```
let foo = Foo {
one: 111,
..Foo::default(), // This comma is a syntax error
};
```
The current error is a generic `expected one of ...` which isn't beginner-friendly. My error looks like this:
```
error: cannot use a comma after the base struct
--> tmp/example.rs:26:9
|
26 | ..Foo::default(),
| ^^^^^^^^^^^^^^^^- help: remove this comma
|
= note: the base struct expansion must always be the last field
```
I even added a note for people who don't know why this isn't allowed.
bors [Fri, 13 Oct 2017 15:04:12 +0000 (15:04 +0000)]
Auto merge of #45063 - michaelwoerister:bring-back-incremental-info, r=nikomatsakis
incr.comp.: Bring back output of -Zincremental-info.
This got kind lost during the transition to red/green.
I also switched back from `eprintln!()` to `println!()` since the former never actually produced any output. I suspect this has to do with `libterm` somehow monopolizing `stderr`.
bors [Fri, 13 Oct 2017 08:57:08 +0000 (08:57 +0000)]
Auto merge of #45032 - alexcrichton:target-cfu, r=michaelwoerister
rustc: Allow target-specific default cgus
Some targets, like msp430 and nvptx, don't work with multiple codegen units
right now for bugs or fundamental reasons. To expose this allow targets to
express a default.
bors [Fri, 13 Oct 2017 06:32:10 +0000 (06:32 +0000)]
Auto merge of #45031 - alexcrichton:nounwind, r=arielb1
rustc: Add LLVM `nounwind` with `-C panic=abort`
This informs LLVM that functions can't unwind, which while it should typically
have already been inferred when necessary or otherwise not impact codegen is
apparently needed on targets like ARM to avoid references to unnecessary
symbols.
trait_defs.rs and trait_impl.rs are blocked on a hard to triage
compiler ICE (at least hard for a newbie like me) having to do
with some DepNodes not getting computed for traits.
A FIXME has been added in the source to reflect this continued
work.
bors [Fri, 13 Oct 2017 04:00:55 +0000 (04:00 +0000)]
Auto merge of #45025 - pnkfelix:mir-borrowck-moves-of-supporting-prefixes-invalidate-uses-too, r=arielb1
MIR-borrowck: moves of prefixes invalidate uses too
I overlooked the fact that when we check if a path is moved, we need to check for interference between the (shallow) prefixes and the use in question.
~~Long term, we may want to revise how this computation is done. For example, it might be better to represent the set of invalidated prefixes in the dataflow computation (the `maybe_uninitialized` dataflow), and thus avoid one of the loops in the code here.~~
* Update: I was wrong in my original recollection of the dataflow code, which actually does the right thing, in terms of precisely tracking substructure initialization and movement.
Fix #44833
----
Update: The initial version of this PR's description (and the code as well) erroneously focused on supporting prefixes. ~~But the two main cases of interest are: 1. the *shallow* prefixes, and 2. the deref-free prefix built off a local (if the lvalue is indeed built off a local)~~
Update 2: The main cases of interest are in fact: 1. the nearest prefix with a MovePath, and 2. the suffixes.
bors [Fri, 13 Oct 2017 01:33:34 +0000 (01:33 +0000)]
Auto merge of #45013 - chrisvittal:mir_pretty_printing_pr, r=nikomatsakis
Extend mir dump to dump each region
Building on #44878, implement the feature discussed in #44872.
Through discussions on the WG-nll-gitter, @nikomatsakis and I decided to implement this by extending `dump_mir` and all functions that it calls to take a callback of signature `FnMut(PassWhere, &mut Write) -> io::Result<()>` where `PassWhere` is an enum that represents possible locations that we may want to print out extra data in the process of dumping the MIR.
I'm not particularly wedded to the name `PassWhere`, but I felt that simply calling the enum `Where` wasn't the right thing to name it.
This work depends strongly on #44878, and should be rebased on the final version of that tree, whatever that may be.
kennytm [Thu, 12 Oct 2017 08:14:22 +0000 (16:14 +0800)]
Rollup merge of #44989 - QuietMisdreavus:what-is-your-quest, r=GuillaumeGomez
let rustdoc print the crate version into docs
This PR adds a new unstable flag to rustdoc, `--crate-version`, which when present will add a new entry to the sidebar of the root module, printing the given version number:
![Screenshot of a test crate, showing "Version 1.3.37" under the crate name](https://user-images.githubusercontent.com/5217170/31104096-805e3f4c-a7a0-11e7-96fc-368b6fe063d6.png)
Closes #24336
(The WIP status is because i don't want to merge this until i can get the std docs to use it, which i need help from rustbuild people to make sure i get right.)
bors [Thu, 12 Oct 2017 17:34:21 +0000 (17:34 +0000)]
Auto merge of #45007 - undecidabot:optimize-iter, r=bluss
Optimize comparison functions of Iterator
Replaced matching on tuples which led to less performant code generation. Testing on microbenchmarks consistently showed ~1.35x improvement in performance on my machine.
Alex Crichton [Tue, 10 Oct 2017 22:54:49 +0000 (15:54 -0700)]
rustc: Handle `#[linkage]` anywhere in a crate
This commit updates the reachability pass of the compiler to seed the local
worklist with `#[linkage]`-like items anywhere in a crate, not just those
reachable from public items.
Alex Crichton [Thu, 12 Oct 2017 15:02:39 +0000 (08:02 -0700)]
rustbuild: Prevent spurious rebuilds of the RLS
The RLS currently is rebuilt every time you test it because the `OPENSSL_DIR`
env var is changing, which is in turn caused by an accidental omission of
`prepare_tool_cargo` when testing the RLS.
Added `revisions: ast mir` template to tests that this PR sync'ed ast+mir borrowcks.
(There are other tests that this PR also improves, but were not
completely synchronized. I chose to wait until later to pull those
into the `revisions: ast mir` testing pattern; later being either when
they *are* synchronized, or in some PR where we migrate all borrowck
tests, regardless of whether MIR-borrowck is "finished" for them or
not.)
MIR-borrowck: Big fix to `fn check_if_path_is_moved`.
Fix #44833 (a very specific instance of a very broad bug).
In `check_if_path_is_moved(L)`, check nearest prefix of L with
MovePath, and suffixes of L with MovePaths.
Over the course of review, ariel pointed out a number of issues that
led to this version of the commit:
1. Looking solely at supporting prefixes does not suffice: it
overlooks checking if the path was ever actually initialized in the
first place. So you need to be willing to consider non-supporting
prefixes. Once you are looking at all prefixes, you *could* just
look at the local that forms the base of the projection, but to
handle partial initialization (which still needs to be formally
specified), this code instead looks at the nearest prefix of L that
has an associated MovePath (which, in the limit, will end up being
a local).
2. You also need to consider the suffixes of the given Lvalue, due to
how dataflow is representing partial moves of individual fields out
of struct values.
3. (There was originally a third search, but ariel pointed out that
the first and third could be folded into one.)
Also includes some drive-by refactorings to simplify some method
signatures and prefer `for _ in _` over `loop { }` (at least when it
comes semi-naturally).
bors [Wed, 11 Oct 2017 19:32:19 +0000 (19:32 +0000)]
Auto merge of #44963 - JLockerman:fix_spsc, r=alexcrichton
Improve performance of spsc_queue and stream.
This PR makes two main changes:
1. It switches the `spsc_queue` node caching strategy from keeping a shared
counter of the number of nodes in the cache to keeping a consumer only counter
of the number of node eligible to be cached.
2. It separates the consumer and producers fields of `spsc_queue` and `stream` into
a producer cache line and consumer cache line.
Overall, it speeds up `mpsc` in `spsc` mode by 2-10x.
Variance is higher than I'd like (that 2-10x speedup is on one benchmark), I believe this is due to the drop check in `send` (`fn stream::Queue::send:107`). I think this check can be combined with the sleep detection code into a version which only uses 1 shared variable, and only one atomic access per `send`, but I haven't looked through the select implementation enough to be sure.
The code currently assumes a cache line size of 64 bytes. I added a CacheAligned newtype in `mpsc` which I expect to reuse for `shared`. It doesn't really belong there, it would probably be best put in `core::sync::atomic`, but putting it in `core` would involve making it public, which I thought would require an RFC.
kennytm [Wed, 11 Oct 2017 17:20:55 +0000 (01:20 +0800)]
rustbuild: Make openssl download more reliable.
1. Add -f flag to curl, so when the server returns 403 or 500 it will fail
immediately.
2. Moved the checksum part into the retry loop, assuming checksum failure
is due to broken download that can be fixed by downloading again.
Alex Crichton [Wed, 11 Oct 2017 15:33:46 +0000 (08:33 -0700)]
rustc: Update LLVM with a ThinLTO fix
This commit updates LLVM with a patch that's landed upstream to fix an assertion
that was tripping when ThinLTO was activated. Unfortunately I wasn't able to get
a reduced test case, but I've tested manually on the affected crates and the
assertion is indeed fixed.
Alex Crichton [Wed, 4 Oct 2017 21:54:28 +0000 (14:54 -0700)]
rustc: Add LLVM `nounwind` with `-C panic=abort`
This informs LLVM that functions can't unwind, which while it should typically
have already been inferred when necessary or otherwise not impact codegen is
apparently needed on targets like ARM to avoid references to unnecessary
symbols.
bors [Wed, 11 Oct 2017 05:18:13 +0000 (05:18 +0000)]
Auto merge of #45193 - alexcrichton:fix-travis, r=alexcrichton
ci: Fix installing the Android SDK
Apparently the https urls are broken due to some certificate validation
whatnots, and so far the least intrusive solution I've found is to just disable
that.
Alex Crichton [Wed, 11 Oct 2017 01:59:40 +0000 (18:59 -0700)]
ci: Fix installing the Android SDK
Apparently the https urls are broken due to some certificate validation
whatnots, and so far the least intrusive solution I've found is to just disable
that.
Steve Klabnik [Wed, 11 Oct 2017 00:22:27 +0000 (20:22 -0400)]
Rollup merge of #45148 - gaurikholkar:master, r=nikomatsakis
Update let-expressions.rs with DepNode labels
As a part of #44924, the PR has tests verified for the following dependency nodes for **let-expressions**
```
- MirValidated
- MirOptimized
- TypeCheckTables
- TypeOfItem
- GenericsOfItem
- PredicatesOfItem
- FnSignature
```
As we are more concerned with the function body, the following fingerprints do not change over compilation sessions.
```- TypeOfItem
- GenericsOfItem
- PredicatesOfItem
- FnSignature
```
Steve Klabnik [Wed, 11 Oct 2017 00:22:24 +0000 (20:22 -0400)]
Rollup merge of #45071 - tromey:use-gdb-lazy-string, r=michaelwoerister
Implement display_hint in gdb pretty printers
A few pretty-printers were returning a quoted string from their
to_string method. It's preferable in gdb to return a lazy string and to
let gdb handle the display by having a "display_hint" method that
returns "string" -- it lets gdb settings (like "set print ...") work, it
handles corrupted strings a bit better, and it passes the information
along to IDEs.