]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAuto merge of #43605 - RalfJung:mapdoc, r=michaelwoerister
bors [Wed, 2 Aug 2017 13:40:35 +0000 (13:40 +0000)]
Auto merge of #43605 - RalfJung:mapdoc, r=michaelwoerister

Improve hir::map::Map::get_parent_node doc

The documentation says
```
    /// Similar to get_parent, returns the parent node id or id if there is no
    /// parent.
    /// This function returns the immediate parent in the AST, whereas get_parent
    /// returns the enclosing item.
```
One would think that one can walk up the tree by repeatedly calling `get_parent_node` until it returns the argument, and then work on the `NodeId`s that arise. However, that is not true: `get_parent_node` will return id 0 (the crate itself) for items that sit directly in the crate; calling `get` on that `NodeId` will panic.

So, the fact that `get_parent_node` returns the root when passed the root is actually not really useful, because the root itself is already a somewhat degenerate node. This improves the doc so hopefully people writing code that "walks up the tree" don't run into this issue like I did...

6 years agoAuto merge of #43612 - michaelwoerister:fix-cgu-hashing, r=eddyb
bors [Wed, 2 Aug 2017 11:14:54 +0000 (11:14 +0000)]
Auto merge of #43612 - michaelwoerister:fix-cgu-hashing, r=eddyb

incr.comp.: Properly incorporate symbol linkage and visibility into CGU hash.

This PR fixes the way the CGU hash for incr. comp. is computed. The CGU hash represents which `TransItems` are emitted into which codegen unit with which linkage and visibility. Before the new, LLVM-independent symbol internalizer the CGU hash did not accurately contain `TransItem` linkage and visibility because we would not enable symbol internalization in incremental mode anyway. The new internalizer is also run in incremental mode which uncovered the inaccuracy of CGU hashing. Luckily, the fix is rather simple.

r? @eddyb
cc @nikomatsakis

6 years agoincr.comp.: Properly incorporate symbol linkage and visibility into CGU hash.
Michael Woerister [Wed, 2 Aug 2017 09:56:23 +0000 (11:56 +0200)]
incr.comp.: Properly incorporate symbol linkage and visibility into CGU hash.

6 years agoAuto merge of #43602 - QuietMisdreavus:fantastic-shrinking-headings, r=GuillaumeGomez
bors [Wed, 2 Aug 2017 08:49:02 +0000 (08:49 +0000)]
Auto merge of #43602 - QuietMisdreavus:fantastic-shrinking-headings, r=GuillaumeGomez

rustdoc: shrink headings in non-top-level docblocks

Headings in per-method docs are often bigger than the function names/signatures themselves, so this tones those down to accentuate the methods.

![screenshot of this change on Vec::swap_remove](https://user-images.githubusercontent.com/5217170/28849380-6116a830-76dc-11e7-8ce2-04433d09463a.png)

Fixes #17193

6 years agoAuto merge of #43584 - arielb1:unused-reads, r=eddyb
bors [Wed, 2 Aug 2017 05:56:06 +0000 (05:56 +0000)]
Auto merge of #43584 - arielb1:unused-reads, r=eddyb

Fix quadratic performance with lots of use statements

This fixes 2 problems that caused quadratic performance when lots of use-statements were present. After this patch, performance is linear (and very fast) even with 1M uses.

Fixes #43572.
Fixes #43573.

r? @eddyb

6 years agoAuto merge of #43603 - frewsxcv:rollup, r=frewsxcv
bors [Wed, 2 Aug 2017 03:39:27 +0000 (03:39 +0000)]
Auto merge of #43603 - frewsxcv:rollup, r=frewsxcv

Rollup of 6 pull requests

- Successful merges: #43389, #43423, #43581, #43585, #43597, #43598
- Failed merges:

6 years agoimprove hir::map::Map::get_parent_node doc
Ralf Jung [Wed, 2 Aug 2017 02:13:47 +0000 (19:13 -0700)]
improve hir::map::Map::get_parent_node doc

6 years agorustdoc: shrink headings in non-top-level docblocks
QuietMisdreavus [Tue, 1 Aug 2017 22:08:33 +0000 (17:08 -0500)]
rustdoc: shrink headings in non-top-level docblocks

6 years agoRollup merge of #43598 - ibabushkin:master, r=eddyb
Corey Farwell [Wed, 2 Aug 2017 01:22:30 +0000 (01:22 +0000)]
Rollup merge of #43598 - ibabushkin:master, r=eddyb

Derive `Hash` on `AssociatedKind`.

This is a trivial change useful in downstream code poking in rustc's
innards, in particular the semver verification tool I'm currently working on.

r? @eddyb

6 years agoRollup merge of #43597 - dhduvall:master, r=alexcrichton
Corey Farwell [Wed, 2 Aug 2017 01:22:29 +0000 (01:22 +0000)]
Rollup merge of #43597 - dhduvall:master, r=alexcrichton

Fix the Solaris pthread_t raw type in std to match what's in libc

The old type causes failures when building cargo 0.20.0 after rust-lang/libc@8304e06b5.

6 years agoRollup merge of #43585 - frewsxcv:frewsxcv-hashset-docs, r=steveklabnik,quietmisdreavus
Corey Farwell [Wed, 2 Aug 2017 01:22:28 +0000 (01:22 +0000)]
Rollup merge of #43585 - frewsxcv:frewsxcv-hashset-docs, r=steveklabnik,quietmisdreavus

Improve docs & doc examples for HashSet.

None

6 years agoRollup merge of #43581 - alexcrichton:inline-more, r=michaelwoerister
Corey Farwell [Wed, 2 Aug 2017 01:22:27 +0000 (01:22 +0000)]
Rollup merge of #43581 - alexcrichton:inline-more, r=michaelwoerister

rustc: Inline bitwise modification operators

These need to be inlined across crates to avoid showing up as one-instruction
functions in profiles! In the benchmark from #43578 this decreased the
translation item collection step from 30s to 23s, and looks like it also allowed
vectorization elsewhere of the operations!

6 years agoRollup merge of #43423 - xliiv:cell-example, r=steveklabnik
Corey Farwell [Wed, 2 Aug 2017 01:22:27 +0000 (01:22 +0000)]
Rollup merge of #43423 - xliiv:cell-example, r=steveklabnik

Add simple docs example for struct Cell

6 years agoRollup merge of #43389 - alexcrichton:thread-error, r=michaelwoerister
Corey Farwell [Wed, 2 Aug 2017 01:22:26 +0000 (01:22 +0000)]
Rollup merge of #43389 - alexcrichton:thread-error, r=michaelwoerister

Thread through the original error when opening archives

This updates the management of opening archives to thread through the original
piece of error information from LLVM over to the end consumer, trans.

6 years agoAuto merge of #43579 - cuviper:extern-llvm-features, r=alexcrichton
bors [Wed, 2 Aug 2017 01:13:02 +0000 (01:13 +0000)]
Auto merge of #43579 - cuviper:extern-llvm-features, r=alexcrichton

Gate LLVMRustHasFeature on LLVM_RUSTLLVM

Commit c4710203c098b in #43492 make `LLVMRustHasFeature` "more robust"
by using `getFeatureTable()`.  However, this function is specific to
Rust's own LLVM fork, not upstream LLVM-4.0, so we need to use
`#if LLVM_RUSTLLVM` to guard this call.

Closes #43555.

6 years agoAdd doc example for HashSet::drain.
Corey Farwell [Tue, 1 Aug 2017 12:12:01 +0000 (08:12 -0400)]
Add doc example for HashSet::drain.

6 years agoRemove unnecessary clones in doc examples.
Corey Farwell [Tue, 1 Aug 2017 11:55:44 +0000 (07:55 -0400)]
Remove unnecessary clones in doc examples.

6 years agoShow the capacity in HashSet::with_capacity doc example.
Corey Farwell [Tue, 1 Aug 2017 11:47:17 +0000 (07:47 -0400)]
Show the capacity in HashSet::with_capacity doc example.

6 years agoRemove unnecessary 'mut' bindings.
Corey Farwell [Tue, 1 Aug 2017 11:46:41 +0000 (07:46 -0400)]
Remove unnecessary 'mut' bindings.

6 years agoIndicate HashSet is code-like in docs.
Corey Farwell [Tue, 1 Aug 2017 11:44:43 +0000 (07:44 -0400)]
Indicate HashSet is code-like in docs.

6 years agoShow that the capacity changed in HashSet::reserve doc example.
Corey Farwell [Tue, 1 Aug 2017 11:42:59 +0000 (07:42 -0400)]
Show that the capacity changed in HashSet::reserve doc example.

6 years agoAdd doc example for HashSet::hasher.
Corey Farwell [Tue, 1 Aug 2017 11:41:06 +0000 (07:41 -0400)]
Add doc example for HashSet::hasher.

6 years agoAuto merge of #43576 - arielb1:no-unneeded-unwind, r=eddyb
bors [Tue, 1 Aug 2017 22:43:15 +0000 (22:43 +0000)]
Auto merge of #43576 - arielb1:no-unneeded-unwind, r=eddyb

rustc_mir: don't build unused unwind cleanup blocks

When building a scope exit, don't build unwind cleanup blocks unless they will actually be used by the unwind path of a drop - the unused blocks are removed by SimplifyCfg, but they can cause a significant performance slowdown before they are removed. That fixes #43511.

Also a few other small MIR cleanups & optimizations.

r? @eddyb

6 years agoDerive `Hash` on `AssociatedKind`.
Inokentiy Babushkin [Tue, 1 Aug 2017 20:27:30 +0000 (22:27 +0200)]
Derive `Hash` on `AssociatedKind`.

This is a trivial change useful in downstream code poking in rustc's
innards.

6 years agoAuto merge of #43529 - QuietMisdreavus:fn-docs, r=steveklabnik
bors [Tue, 1 Aug 2017 19:59:53 +0000 (19:59 +0000)]
Auto merge of #43529 - QuietMisdreavus:fn-docs, r=steveklabnik

add documentation for function pointers as a primitive

This PR adds a new kind of primitive to the standard library documentation: Function pointers. It's useful to be able to discuss them separately from closure-trait-objects, and to have something to point to when discussing function pointers as a *type* and not a *trait*.

Fixes #17104

6 years agoFix the Solaris pthread_t raw type in std to match what's in libc
Danek Duvall [Tue, 1 Aug 2017 19:38:36 +0000 (12:38 -0700)]
Fix the Solaris pthread_t raw type in std to match what's in libc

The old type causes failures when building cargo 0.20.0 after
changeset 8304e06b5 in the libc repo.

6 years agoAuto merge of #43506 - michaelwoerister:async-llvm, r=alexcrichton
bors [Tue, 1 Aug 2017 17:21:24 +0000 (17:21 +0000)]
Auto merge of #43506 - michaelwoerister:async-llvm, r=alexcrichton

Run translation and LLVM in parallel when compiling with multiple CGUs

This is still a work in progress but the bulk of the implementation is done, so I thought it would be good to get it in front of more eyes.

This PR makes the compiler start running LLVM while translation is still in progress, effectively allowing for more parallelism towards the end of the compilation pipeline. It also allows the main thread to switch between either translation or running LLVM, which allows to reduce peak memory usage since not all LLVM module have to be kept in memory until linking. This is especially good for incr. comp. but it works just as well when running with `-Ccodegen-units=N`.

In order to help tuning and debugging the work scheduler, the PR adds the `-Ztrans-time-graph` flag which spits out html files that show how work packages where scheduled:
![Building regex](https://user-images.githubusercontent.com/1825894/28679272-f6752bd8-72f2-11e7-8a6c-56207855ce95.png)
(red is translation, green is llvm)

One side effect here is that `-Ztime-passes` might show something not quite correct because trans and LLVM are not strictly separated anymore. I plan to have some special handling there that will try to produce useful output.

One open question is how to determine whether the trans-thread should switch to intermediate LLVM processing.

TODO:
- [x] Restore `-Z time-passes` output for LLVM.
- [x] Update documentation, esp. for work package scheduling.
- [x] Tune the scheduling algorithm.

cc @alexcrichton @rust-lang/compiler

6 years agoadd documentation for function pointers as a primitive
QuietMisdreavus [Fri, 28 Jul 2017 17:55:30 +0000 (12:55 -0500)]
add documentation for function pointers as a primitive

6 years agoAuto merge of #43568 - arielb1:constant-recovery, r=eddyb
bors [Tue, 1 Aug 2017 14:20:23 +0000 (14:20 +0000)]
Auto merge of #43568 - arielb1:constant-recovery, r=eddyb

trans::mir::constant - fix assignment error recovery

trans::mir::constant - fix assignment error recovery

We used to not store anything when the RHS of an assignment returned an error, which caused ICEs downstream.

Fixes #43197.

6 years agoasync-llvm(29): Adapt run-make/llvm-phase test case to LLVM module not being availabl...
Michael Woerister [Tue, 1 Aug 2017 13:57:38 +0000 (15:57 +0200)]
async-llvm(29): Adapt run-make/llvm-phase test case to LLVM module not being available in memory.

6 years agoasync-llvm(28): Make some error messages more informative.
Michael Woerister [Tue, 1 Aug 2017 09:04:24 +0000 (11:04 +0200)]
async-llvm(28): Make some error messages more informative.

6 years agorustc::hir::map::definitions - fix O(n^2) when disambiguating
Ariel Ben-Yehuda [Tue, 1 Aug 2017 11:44:20 +0000 (14:44 +0300)]
rustc::hir::map::definitions - fix O(n^2) when disambiguating

Instead of finding the next free disambiguator by incrementing it until
you find a place, store the next available disambiguator in an hash-map.

This avoids O(n^2) performance when lots of items have the same
un-disambiguated `DefPathData` - e.g. all `use` items have
`DefPathData::Misc`.

6 years agosyntax: avoid loading the same source-file multiple times
Ariel Ben-Yehuda [Tue, 1 Aug 2017 11:17:11 +0000 (14:17 +0300)]
syntax: avoid loading the same source-file multiple times

We already had a cache for file contents, but we read the source-file
before testing the cache, causing obvious slowness, so this just avoids
loading the source-file when the cache already has the contents.

6 years agopacify the merciless tidy
Ariel Ben-Yehuda [Tue, 1 Aug 2017 08:57:26 +0000 (11:57 +0300)]
pacify the merciless tidy

6 years agoAuto merge of #43560 - QuietMisdreavus:ref-docs, r=steveklabnik
bors [Tue, 1 Aug 2017 08:23:41 +0000 (08:23 +0000)]
Auto merge of #43560 - QuietMisdreavus:ref-docs, r=steveklabnik

add docs for references as a primitive

Just like #43529 did for function pointers, here is a new primitive page for references.

This PR will pull in impls on references if it's a reference to a generic type parameter. Initially i was only able to pull in impls that were re-exported from another crate; crate-local impls got a different representation in the AST, and i had to change how types were resolved when cleaning it. (This is the change at the bottom of `librustdoc/clean/mod.rs`, in `resolve_type`.) I'm unsure the full ramifications of the change, but from what it looks like, it shouldn't impact anything major. Likewise, references to generic type parameters also get the `&'a [mut]` linked to the new page.

cc @rust-lang/docs: Is this sufficient information? The listing of trait impls kinda feels redundant (especially if we can get the automated impl listing sorted again), but i still think it's useful to point out that you can use these in a generic context.

Fixes #15654

6 years agoAuto merge of #43552 - petrochenkov:instab, r=jseyfried
bors [Tue, 1 Aug 2017 06:05:34 +0000 (06:05 +0000)]
Auto merge of #43552 - petrochenkov:instab, r=jseyfried

resolve: Try to fix instability in import suggestions

cc https://github.com/rust-lang/rust/pull/42033

`lookup_import_candidates` walks module graph in DFS order and skips modules that were already visited (which is correct because there can be cycles).
However it means that if we visited `std::prelude::v1::Result::Ok` first, we will never visit `std::result::Result::Ok` because `Result` will be skipped as already visited (note: enums are also modules here), and otherwise, if we visited `std::result::Result::Ok` first, we will never get to `std::prelude::v1::Result::Ok`.
What child module of `std` (`prelude` or `result`) we will visit first, depends on randomized hashing, so we have instability in diagnostics.

With this patch modules' children are visited in stable order in `lookup_import_candidates`, this should fix the issue, but let's see what Travis will say.

r? @oli-obk

6 years agoAuto merge of #43533 - nrc:macro-save, r=jseyfried,
bors [Tue, 1 Aug 2017 03:52:14 +0000 (03:52 +0000)]
Auto merge of #43533 - nrc:macro-save, r=jseyfried,

Three small fixes for save-analysis

First commit does some naive deduplication of macro uses. We end up with lots of duplication here because of the weird way we get this data (we extract a use for every span generated by a macro use).

Second commit is basically a typo fix.

Third commit is a bit interesting, it partially reverts a change from #40939 where temporary variables in format! (and thus println!) got a span with the primary pointing at the value stored into the temporary (e.g., `x` in `println!("...", x)`). If `format!` had a definition it should point at the temporary in the macro def, but since it is built-in, that is not possible (for now), so `DUMMY_SP` is the best we can do (using the span in the callee really breaks save-analysis because it thinks `x` is a definition as well as a reference).

There aren't a test for this stuff because: the deduplication is filtered by any of the users of save-analysis, so it is purely an efficiency change. I couldn't actually find an example for the second commit that we have any machinery to test, and the third commit is tested by the RLS, so there will be a test once I update the RLS version and and uncomment the previously failing tests).

r? @jseyfried

6 years agoreview changes
Nick Cameron [Tue, 1 Aug 2017 02:43:11 +0000 (14:43 +1200)]
review changes

6 years agorustc: Inline bitwise modification operators
Alex Crichton [Tue, 1 Aug 2017 01:39:25 +0000 (18:39 -0700)]
rustc: Inline bitwise modification operators

These need to be inlined across crates to avoid showing up as one-instruction
functions in profiles! In the benchmark from #43578 this decreased the
translation item collection step from 30s to 23s, and looks like it also allowed
vectorization elsewhere of the operations!

6 years agoGate LLVMRustHasFeature on LLVM_RUSTLLVM
Josh Stone [Tue, 1 Aug 2017 01:10:01 +0000 (18:10 -0700)]
Gate LLVMRustHasFeature on LLVM_RUSTLLVM

Commit c4710203c098b in #43492 make `LLVMRustHasFeature` "more robust"
by using `getFeatureTable()`.  However, this function is specific to
Rust's own LLVM fork, not upstream LLVM-4.0, so we need to use
`#if LLVM_RUSTLLVM` to guard this call.

6 years agoAuto merge of #43547 - arielb1:no-borrow-no-check, r=nikomatsakis
bors [Mon, 31 Jul 2017 23:21:24 +0000 (23:21 +0000)]
Auto merge of #43547 - arielb1:no-borrow-no-check, r=nikomatsakis

borrowck: skip CFG construction when there is nothing to propagate

CFG construction takes a large amount of time and memory, especially for
large constants. If such a constant contains no actions on lvalues, it
can't have borrowck problems and can be ignored by it.

This removes the 4.9GB borrowck peak from #36799. It seems that HIR had
grown by 300MB and MIR had grown by 500MB from the last massif
collection and that remains to be investigated, but this at least shaves
the borrowck peak.

r? @nikomatsakis

6 years agorustc_mir::transform::simplify - remove nops first
Ariel Ben-Yehuda [Mon, 31 Jul 2017 21:10:46 +0000 (00:10 +0300)]
rustc_mir::transform::simplify - remove nops first

Removing nops can allow more basic blocks to be merged, but merging
basic blocks can't allow for more nops to be removed, so we should
remove nops first.

This doesn't matter *that* much, because normally we run SimplifyCfg
several times, but there's no reason not to do it.

6 years agouse an iterator when visiting MIR basic blocks
Ariel Ben-Yehuda [Mon, 31 Jul 2017 21:09:32 +0000 (00:09 +0300)]
use an iterator when visiting MIR basic blocks

I saw MIR cache invalidation somewhat hot on my profiler when per-BB
indexin was used. That shouldn't matter much, but there is no good
reason not to use an iterator.

6 years agorustc_mir: don't build unused unwind cleanup blocks
Ariel Ben-Yehuda [Mon, 31 Jul 2017 20:25:27 +0000 (23:25 +0300)]
rustc_mir: don't build unused unwind cleanup blocks

The unused blocks are removed by SimplifyCfg, but they can cause a
significant performance slowdown before they are removed.

6 years agoremove the span field from `diverge_cleanup`
Ariel Ben-Yehuda [Mon, 31 Jul 2017 13:00:12 +0000 (16:00 +0300)]
remove the span field from `diverge_cleanup`

6 years agoAuto merge of #43399 - tschottdorf:bndmode-pat-adjustments, r=nikomatsakis
bors [Mon, 31 Jul 2017 20:47:42 +0000 (20:47 +0000)]
Auto merge of #43399 - tschottdorf:bndmode-pat-adjustments, r=nikomatsakis

default binding modes: add pat_binding_modes

This PR kicks off the implementation of the [default binding modes RFC][1] by
introducing the `pat_binding_modes` typeck table mentioned in the [mentoring
instructions][2].

It is a WIP because I wasn't able to avoid all uses of the binding modes as
not all call sites are close enough to the typeck tables. I added marker
comments to any line matching `BindByRef|BindByValue` so that reviewers
are aware of all of them.

I will look into changing the HIR (as suggested in [2]) to not carry a
`BindingMode` unless one was explicitly specified, but this PR is good for
a first round of comments.

The actual changes are quite small and CI will fail due to overlong lines
caused by the marker comments.

See #42640.

cc @nikomatsakis

[1]: https://github.com/rust-lang/rfcs/pull/2005
[2]: https://github.com/rust-lang/rust/issues/42640#issuecomment-313535089

6 years agoasync-llvm(27): Move #[rustc_error] check to an earlier point in order to restore...
Michael Woerister [Mon, 31 Jul 2017 16:51:39 +0000 (18:51 +0200)]
async-llvm(27): Move #[rustc_error] check to an earlier point in order to restore some test expections.

6 years agoadd comments from arielb1
Niko Matsakis [Mon, 31 Jul 2017 15:13:49 +0000 (18:13 +0300)]
add comments from arielb1

6 years agotrans::mir::constant - fix assignment error recovery
Ariel Ben-Yehuda [Mon, 31 Jul 2017 14:42:42 +0000 (17:42 +0300)]
trans::mir::constant - fix assignment error recovery

We used to not store anything when the RHS of an assignment returned an
error, which caused ICEs downstream.

Fixes #43197.

6 years agofix `-Z treat-err-as-bug`
Ariel Ben-Yehuda [Mon, 31 Jul 2017 12:54:16 +0000 (15:54 +0300)]
fix `-Z treat-err-as-bug`

6 years agoasync-llvm(26): Print error when failing to acquire Jobserver token.
Michael Woerister [Mon, 31 Jul 2017 13:41:41 +0000 (15:41 +0200)]
async-llvm(26): Print error when failing to acquire Jobserver token.

6 years agoasync-llvm(25): Restore -Ztime-passes output for trans and LLVM.
Michael Woerister [Mon, 31 Jul 2017 12:51:47 +0000 (14:51 +0200)]
async-llvm(25): Restore -Ztime-passes output for trans and LLVM.

6 years agoasync-llvm(24): Improve scheduling and documentation.
Michael Woerister [Fri, 28 Jul 2017 12:28:08 +0000 (14:28 +0200)]
async-llvm(24): Improve scheduling and documentation.

6 years agoasync-llvm(23): Let the main thread also do LLVM work in order to reduce memory pressure.
Michael Woerister [Thu, 27 Jul 2017 14:59:30 +0000 (16:59 +0200)]
async-llvm(23): Let the main thread also do LLVM work in order to reduce memory pressure.

6 years agoasync-llvm(22): mw invokes mad html skillz to produce graphical LLVM timing reports.
Michael Woerister [Thu, 27 Jul 2017 11:02:31 +0000 (13:02 +0200)]
async-llvm(22): mw invokes mad html skillz to produce graphical LLVM timing reports.

6 years agoasync-llvm(21): Re-use worker-ids in order to simulate persistent worker threads.
Michael Woerister [Thu, 27 Jul 2017 09:51:27 +0000 (11:51 +0200)]
async-llvm(21): Re-use worker-ids in order to simulate persistent worker threads.

6 years agoasync-llvm(20): Do some cleanup.
Michael Woerister [Wed, 26 Jul 2017 14:12:34 +0000 (16:12 +0200)]
async-llvm(20): Do some cleanup.

6 years agoasync-llvm(19): Already start LLVM while still translating.
Michael Woerister [Wed, 26 Jul 2017 14:02:32 +0000 (16:02 +0200)]
async-llvm(19): Already start LLVM while still translating.

6 years agoasync-llvm(18): Instantiate OngoingCrateTranslation before starting translation.
Michael Woerister [Wed, 26 Jul 2017 13:02:53 +0000 (15:02 +0200)]
async-llvm(18): Instantiate OngoingCrateTranslation before starting translation.

6 years agoasync-llvm(17): Create MSVC __imp_ symbols immediately for each module.
Michael Woerister [Wed, 26 Jul 2017 12:29:13 +0000 (14:29 +0200)]
async-llvm(17): Create MSVC __imp_ symbols immediately for each module.

6 years agoasync-llvm(16): Inject allocator shim into LLVM module immediately if necessary.
Michael Woerister [Wed, 26 Jul 2017 12:21:01 +0000 (14:21 +0200)]
async-llvm(16): Inject allocator shim into LLVM module immediately if necessary.

6 years agoasync-llvm(15): Don't require number of codegen units upfront.
Michael Woerister [Wed, 26 Jul 2017 12:18:11 +0000 (14:18 +0200)]
async-llvm(15): Don't require number of codegen units upfront.

6 years agoasync-llvm(14): Move LTO/codegen-unit conflict check to beginning of compilation...
Michael Woerister [Wed, 26 Jul 2017 12:14:40 +0000 (14:14 +0200)]
async-llvm(14): Move LTO/codegen-unit conflict check to beginning of compilation process.

6 years agoasync-llvm(13): Submit LLVM work packages from base::trans_crate().
Michael Woerister [Wed, 26 Jul 2017 10:35:23 +0000 (12:35 +0200)]
async-llvm(13): Submit LLVM work packages from base::trans_crate().

6 years agoasync-llvm(12): Hide no_integrated_as logic in write::run_passes.
Michael Woerister [Wed, 26 Jul 2017 09:50:45 +0000 (11:50 +0200)]
async-llvm(12): Hide no_integrated_as logic in write::run_passes.

6 years agoasync-llvm(11): Delay joining ongoing translation until right before linking.
Michael Woerister [Wed, 26 Jul 2017 09:41:34 +0000 (11:41 +0200)]
async-llvm(11): Delay joining ongoing translation until right before linking.

6 years agoasync-llvm(10): Factor compile output files cleanup into separate functions.
Michael Woerister [Wed, 26 Jul 2017 08:48:54 +0000 (10:48 +0200)]
async-llvm(10): Factor compile output files cleanup into separate functions.

6 years agoasync-llvm(9): Move OngoingCrateTranslation into back::write.
Michael Woerister [Wed, 26 Jul 2017 08:27:24 +0000 (10:27 +0200)]
async-llvm(9): Move OngoingCrateTranslation into back::write.

6 years agoasync-llvm(8): Clean up resource management and drop LLVM modules ASAP.
Michael Woerister [Tue, 25 Jul 2017 15:26:24 +0000 (17:26 +0200)]
async-llvm(8): Clean up resource management and drop LLVM modules ASAP.

6 years agoasync-llvm(7): Clean up error handling a bit.
Michael Woerister [Mon, 24 Jul 2017 14:18:11 +0000 (16:18 +0200)]
async-llvm(7): Clean up error handling a bit.

6 years agoasync-llvm(6): Make the LLVM work coordinator get its work package through a channel...
Michael Woerister [Mon, 24 Jul 2017 13:50:42 +0000 (15:50 +0200)]
async-llvm(6): Make the LLVM work coordinator get its work package through a channel instead of upfront.

6 years agoasync-llvm(5): Do continuous error handling on main thread.
Michael Woerister [Mon, 24 Jul 2017 12:51:00 +0000 (14:51 +0200)]
async-llvm(5): Do continuous error handling on main thread.

6 years agoasync-llvm(4): Move work coordination to separate thread in order to free up the...
Michael Woerister [Mon, 24 Jul 2017 12:21:28 +0000 (14:21 +0200)]
async-llvm(4): Move work coordination to separate thread in order to free up the main thread for translation.

6 years agoasync-llvm(3): Make write::CodegenContext Clone and Send.
Michael Woerister [Mon, 24 Jul 2017 11:54:18 +0000 (13:54 +0200)]
async-llvm(3): Make write::CodegenContext Clone and Send.

6 years agoasync-llvm(2): Decouple diagnostics emission from LLVM worker coordination.
Michael Woerister [Fri, 21 Jul 2017 15:15:18 +0000 (17:15 +0200)]
async-llvm(2): Decouple diagnostics emission from LLVM worker coordination.

6 years agoasync-llvm(1): Run LLVM already in trans_crate().
Michael Woerister [Fri, 21 Jul 2017 13:14:21 +0000 (15:14 +0200)]
async-llvm(1): Run LLVM already in trans_crate().

6 years agoborrowck: skip CFG construction when there is nothing to propagate
Ariel Ben-Yehuda [Sat, 29 Jul 2017 17:30:44 +0000 (20:30 +0300)]
borrowck: skip CFG construction when there is nothing to propagate

CFG construction takes a large amount of time and memory, especially for
large constants. If such a constant contains no actions on lvalues, it
can't have borrowck problems and can be ignored by it.

This removes the 4.9GB borrowck peak from #36799. It seems that HIR had
grown by 300MB and MIR had grown by 500MB from the last massif
collection and that remains to be investigated, but this at least shaves
the borrowck peak.

6 years agoAuto merge of #43562 - alexcrichton:no-clean-rebuild, r=petrochenkov
bors [Mon, 31 Jul 2017 08:35:36 +0000 (08:35 +0000)]
Auto merge of #43562 - alexcrichton:no-clean-rebuild, r=petrochenkov

rustbuild: Remove `--enable-llvm-clean-rebuild`

This was intended for bots back in the day where we'd persist caches of LLVM
builds across runs, but nowadays we don't do that on any of the bots so this
option is no longer necessary

6 years agoAuto merge of #43546 - nikomatsakis:issue-43132, r=arielb1
bors [Mon, 31 Jul 2017 04:58:10 +0000 (04:58 +0000)]
Auto merge of #43546 - nikomatsakis:issue-43132, r=arielb1

save subobligations in the projection cache

The projection cache explicitly chose not to "preserve" subobligations for projections, since the fulfillment context ought to have been doing so. But for the trait evaluation scheme that causes problems. This PR reproduces subobligations. This has the potential to slow down compilation, but minimal investigation suggests it does not do so.

One hesitation about this PR: I could not find a way to make a standalone test case for #43132 (but admittedly I did not try very hard).

Fixes #43132.

r? @arielb1

6 years agoAuto merge of #43519 - zackmdavis:long_diagnostics_ever_after, r=GuillaumeGomez
bors [Mon, 31 Jul 2017 01:00:13 +0000 (01:00 +0000)]
Auto merge of #43519 - zackmdavis:long_diagnostics_ever_after, r=GuillaumeGomez

a couple more error explanations for posterity

E0436, E0595, and moving E0569 to where it belongs in the file rather than being bizarrely out of numerical order

r? @GuillaumeGomez

6 years agoAuto merge of #43563 - tbu-:pr_from_str_radix_panic, r=alexcrichton
bors [Sun, 30 Jul 2017 22:39:23 +0000 (22:39 +0000)]
Auto merge of #43563 - tbu-:pr_from_str_radix_panic, r=alexcrichton

Document the `from_str_radix` panic

CC #42034

6 years agoDocument the `from_str_radix` panic
Tobias Bucher [Sun, 30 Jul 2017 21:20:54 +0000 (23:20 +0200)]
Document the `from_str_radix` panic

CC #42034

6 years agorustbuild: Remove `--enable-llvm-clean-rebuild`
Alex Crichton [Sun, 30 Jul 2017 20:48:49 +0000 (13:48 -0700)]
rustbuild: Remove `--enable-llvm-clean-rebuild`

This was intended for bots back in the day where we'd persist caches of LLVM
builds across runs, but nowadays we don't do that on any of the bots so this
option is no longer necessary

6 years agoAuto merge of #43556 - dmizuk:remove-z-opt-usage, r=arielb1
bors [Sun, 30 Jul 2017 20:19:53 +0000 (20:19 +0000)]
Auto merge of #43556 - dmizuk:remove-z-opt-usage, r=arielb1

librustc_driver: Remove -Z option from usage on stable compiler

The `-Z` flag has been disabled since Rust 1.19 stable, but it still shows in `rustc --help`.

This PR addresses the inconsistency by removing the message on the stable channel.

6 years agoadd docs for references as a primitive
QuietMisdreavus [Sun, 30 Jul 2017 19:59:08 +0000 (14:59 -0500)]
add docs for references as a primitive

6 years agoextended info for E0595 closure cannot mutate immutable local variable
Zack M. Davis [Fri, 28 Jul 2017 04:42:03 +0000 (21:42 -0700)]
extended info for E0595 closure cannot mutate immutable local variable

6 years agomove extended info for E0569 to numerical-order location in file
Zack M. Davis [Thu, 27 Jul 2017 22:08:29 +0000 (15:08 -0700)]
move extended info for E0569 to numerical-order location in file

We want the error explanations to appear in numerical order so that
they're easy to find. (Also, any other order would be arbitrary and thus
not constitute a Schelling point.) Bizarrely, the extended information
for E0569 was placed between E0244 and E0318 in
librustc_typeck/diagnostics.rs (when the code was introduced in
9a649c32). This commit moves it to be between E0562 and E0570, where it
belongs.

(Also, at reviewer request, say "Erroneous code example", the standard
verbiage that it has been decided that we say everywhere.)

6 years agoadd extended info for E0436 functional record update syntax needs struct
Zack M. Davis [Thu, 27 Jul 2017 21:22:49 +0000 (14:22 -0700)]
add extended info for E0436 functional record update syntax needs struct

This example focuses on struct-like enum variants, because it's not
immediately obvious in what other context we can get E0436 alone,
without any other, more serious, errors. (Triggering E0436 with a union
also emits a separate "union expressions should have exactly one field"
error.)

(One might argue that we ought to accept the functional record update
syntax for struct-like enums, but that is beyond the scope of this
error-index-comprehensiveness commit.)

6 years agosave the subobligations as well
Niko Matsakis [Sat, 29 Jul 2017 18:40:37 +0000 (21:40 +0300)]
save the subobligations as well

6 years agoAuto merge of #43515 - QuietMisdreavus:show-assoc-types, r=GuillaumeGomez
bors [Sun, 30 Jul 2017 17:42:32 +0000 (17:42 +0000)]
Auto merge of #43515 - QuietMisdreavus:show-assoc-types, r=GuillaumeGomez

rustdoc: print associated types in traits "implementors" section

When viewing a trait's implementors, they won't show anything about the implementation other than any bounds on the generics. You can see the full implementation details on the page for the type, but if the type is external (e.g. it's an extension trait being implemented for primitives), then you'll never be able to see the details of the implementation without opening the source code. This doesn't solve everything about that, but it does still show an incredibly useful piece of information: the associated types. This can help immensely for traits like `Deref` or `IntoIterator` in libstd, and also for traits like `IntoFuture` outside the standard library.

Fixes #24200

🚨 BIKESHED ALERT ðŸš¨ The indentation and sizing of the types is suspect. I put it in the small text so it wouldn't blend in with the next impl line. (It shares a CSS class with the where clauses, as you can see in the following image.) However, the indentation is nonstandard. I initially tried with no indentation (looked awkward and blended too well with the surrounding impls) and with 4-space indentation (too easy to confuse with where clauses), before settling on the 2-space indentation seen below. It's... okay, i guess. Open to suggestions.

![snippet of the implementors of IntoIterator, showing the associated types](https://user-images.githubusercontent.com/5217170/28697456-a4e01a12-7301-11e7-868e-2a6441d6c9e0.png)

6 years agodefault binding modes: add pat_binding_modes
Tobias Schottdorf [Fri, 21 Jul 2017 23:29:43 +0000 (19:29 -0400)]
default binding modes: add pat_binding_modes

This PR kicks off the implementation of the [default binding modes RFC][1] by
introducing the `pat_binding_modes` typeck table mentioned in the [mentoring
instructions][2].

`pat_binding_modes` is populated in `librustc_typeck/check/_match.rs` and
used wherever the HIR would be scraped prior to this PR. Unfortunately, one
blemish, namely a two callers to `contains_explicit_ref_binding`, remains.
This will likely have to be removed when the second part of [1], the
`pat_adjustments` table, is tackled. Appropriate comments have been added.

See #42640.

[1]: https://github.com/rust-lang/rfcs/pull/2005
[2]: https://github.com/rust-lang/rust/issues/42640#issuecomment-313535089

6 years agoAuto merge of #43543 - petrochenkov:32330, r=nikomatsakis
bors [Sun, 30 Jul 2017 12:48:20 +0000 (12:48 +0000)]
Auto merge of #43543 - petrochenkov:32330, r=nikomatsakis

Cleanup some remains of `hr_lifetime_in_assoc_type` compatibility lint

r? @nikomatsakis

6 years agolibrustc_driver: Remove -Z option from usage on stable compiler
Daiki Mizukami [Sun, 30 Jul 2017 09:17:22 +0000 (18:17 +0900)]
librustc_driver: Remove -Z option from usage on stable compiler

6 years agoresolve: Fix instability in import suggestions
Vadim Petrochenkov [Sat, 29 Jul 2017 23:28:30 +0000 (02:28 +0300)]
resolve: Fix instability in import suggestions

6 years agoAuto merge of #43551 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Sun, 30 Jul 2017 01:40:11 +0000 (01:40 +0000)]
Auto merge of #43551 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 8 pull requests

- Successful merges: #43409, #43501, #43509, #43512, #43513, #43536, #43544, #43549
- Failed merges:

6 years agoRollup merge of #43549 - alexcrichton:build-llvm, r=Mark-Simulacrum
Mark Simulacrum [Sun, 30 Jul 2017 00:03:58 +0000 (18:03 -0600)]
Rollup merge of #43549 - alexcrichton:build-llvm, r=Mark-Simulacrum

rustbuild: Enable building LLVM

I use this from time to time debugging LLVM builds, useful to have!

6 years agoRollup merge of #43544 - redox-os:update_redox_sys, r=sfackler
Mark Simulacrum [Sun, 30 Jul 2017 00:03:57 +0000 (18:03 -0600)]
Rollup merge of #43544 - redox-os:update_redox_sys, r=sfackler

Update redox sys

- Add JoinHandleExt
- Split FL and FD for fcntl

6 years agoRollup merge of #43536 - alexcrichton:privileged, r=TimNN
Mark Simulacrum [Sun, 30 Jul 2017 00:03:56 +0000 (18:03 -0600)]
Rollup merge of #43536 - alexcrichton:privileged, r=TimNN

Flag docker invocations as --privileged on CI

When upgrading to LLVM 5.0 it was found that the leak sanitizer tests were
failing with fatal errors, but they were passing locally when run. Turns out it
looks like they may be using new ptrace-like syscalls so the docker container
now needs `--privileged` when executing to complete the test.

6 years agoRollup merge of #43513 - alexcrichton:inline-repeat, r=BurntSushi
Mark Simulacrum [Sun, 30 Jul 2017 00:03:55 +0000 (18:03 -0600)]
Rollup merge of #43513 - alexcrichton:inline-repeat, r=BurntSushi

std: Mark `Layout::repeat` as `#[inline]`

This fixes an optimization regression by allowing LLVM to see through more
functions.

Closes #43272

6 years agoRollup merge of #43512 - arielb1:untyped-move-paths, r=eddyb
Mark Simulacrum [Sun, 30 Jul 2017 00:03:54 +0000 (18:03 -0600)]
Rollup merge of #43512 - arielb1:untyped-move-paths, r=eddyb

erase types in the move-path abstract domain

Leaving types unerased would lead to 2 types with a different "name"
getting different move-paths, which would cause major brokenness (see
e.g. #42903).

This does not fix any *known* issue, but is required if we want to use
abs_domain with non-erased regions (because the same can easily
have different names). cc @RalfJung.

r? @eddyb