]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAuto merge of #43634 - dhduvall:solaris-test-fixes, r=sanxiyn
bors [Fri, 4 Aug 2017 05:30:12 +0000 (05:30 +0000)]
Auto merge of #43634 - dhduvall:solaris-test-fixes, r=sanxiyn

Fix a number of failing tests on Solaris and SPARC

6 years agoAuto merge of #43459 - ids1024:asrawfd, r=alexcrichton
bors [Fri, 4 Aug 2017 02:15:04 +0000 (02:15 +0000)]
Auto merge of #43459 - ids1024:asrawfd, r=alexcrichton

Implement AsRawFd for Stdin, Stdout, and Stderr

https://github.com/rust-lang/rfcs/issues/2074

6 years agotrans: Reuse immediate value in call to call_memset()
Florian Zeitz [Fri, 4 Aug 2017 00:27:30 +0000 (02:27 +0200)]
trans: Reuse immediate value in call to call_memset()

6 years agoAdd support for Vector Subtract Carryout on PowerPC
Luca Barbato [Fri, 4 Aug 2017 00:19:58 +0000 (00:19 +0000)]
Add support for Vector Subtract Carryout on PowerPC

6 years agoRecognize SPARC in more tests where architecture matters.
Danek Duvall [Fri, 4 Aug 2017 00:19:19 +0000 (17:19 -0700)]
Recognize SPARC in more tests where architecture matters.

6 years agoSolaris linker options need to be accounted for in one test.
Danek Duvall [Fri, 4 Aug 2017 00:18:19 +0000 (17:18 -0700)]
Solaris linker options need to be accounted for in one test.

This is a follow-up to f189d7a6937 and 9d11b089ad1.  While `-z ignore`
is what needs to be passed to the Solaris linker, because gcc is used as
the default linker, both that form and `-Wl,-z -Wl,ignore` (including
extra double quotes) need to be taken into account, which explains the
more complex regular expression.

6 years agoAdd support for Vector Subtract Saturated on PowerPC
Luca Barbato [Fri, 4 Aug 2017 00:16:22 +0000 (00:16 +0000)]
Add support for Vector Subtract Saturated on PowerPC

6 years agoFix AsRawHandle
Ian Douglas Scott [Thu, 3 Aug 2017 22:54:53 +0000 (15:54 -0700)]
Fix AsRawHandle

6 years agoExclude Windows from LLVM_LINK_LLVM_DYLIB
Josh Stone [Thu, 3 Aug 2017 22:42:05 +0000 (15:42 -0700)]
Exclude Windows from LLVM_LINK_LLVM_DYLIB

6 years agoSome tests use `res_init()` and need `-lresolv` on Solaris
Danek Duvall [Thu, 3 Aug 2017 22:38:34 +0000 (15:38 -0700)]
Some tests use `res_init()` and need `-lresolv` on Solaris

This is a follow-up to ea23e50f, which fixed it for the build.

6 years agoFix a dangling symlink bug in `remove_dir_all()` on Solaris
Danek Duvall [Thu, 3 Aug 2017 21:55:01 +0000 (14:55 -0700)]
Fix a dangling symlink bug in `remove_dir_all()` on Solaris

This fixes a handful of long-failing tests.

6 years agoUpdate highlight colors
Guillaume Gomez [Thu, 3 Aug 2017 20:55:17 +0000 (22:55 +0200)]
Update highlight colors

6 years agoImplement AsRawHandle for Std* on Windows
Ian Douglas Scott [Fri, 28 Jul 2017 23:34:16 +0000 (16:34 -0700)]
Implement AsRawHandle for Std* on Windows

6 years agoAuto merge of #43619 - frewsxcv:frewsxcv-thread, r=QuietMisdreavus
bors [Thu, 3 Aug 2017 19:40:27 +0000 (19:40 +0000)]
Auto merge of #43619 - frewsxcv:frewsxcv-thread, r=QuietMisdreavus

Thread docs fix and improvements.

None

6 years agoAuto merge of #43618 - SimonSapin:nomiconup, r=steveklabnik
bors [Thu, 3 Aug 2017 16:54:22 +0000 (16:54 +0000)]
Auto merge of #43618 - SimonSapin:nomiconup, r=steveklabnik

Update nomicon

(This should have been in https://github.com/rust-lang/rust/pull/42959.)

6 years agoAuto merge of #43609 - dsprenkels:issue-40510, r=Mark-Simulacrum
bors [Thu, 3 Aug 2017 14:21:37 +0000 (14:21 +0000)]
Auto merge of #43609 - dsprenkels:issue-40510, r=Mark-Simulacrum

Add regression test for #40510

This pull request adds a test case for issue #40510.

Fixes #40510.

6 years agoUpdate RELEASES.md
Aaron Power [Thu, 3 Aug 2017 14:16:49 +0000 (15:16 +0100)]
Update RELEASES.md

6 years agofixed some formatting
Aaron Power [Thu, 3 Aug 2017 14:07:41 +0000 (15:07 +0100)]
fixed some formatting

6 years agoUpdated release notes for 1.20
Aaron Power [Thu, 3 Aug 2017 13:56:25 +0000 (14:56 +0100)]
Updated release notes for 1.20

6 years agoincr.comp.: Make ConstEval dep-node anonymous.
Michael Woerister [Thu, 3 Aug 2017 12:45:01 +0000 (14:45 +0200)]
incr.comp.: Make ConstEval dep-node anonymous.

6 years agoTweak error message
scalexm [Thu, 3 Aug 2017 11:50:06 +0000 (13:50 +0200)]
Tweak error message

6 years agoHandle ambiguous cases
scalexm [Wed, 2 Aug 2017 10:17:34 +0000 (12:17 +0200)]
Handle ambiguous cases

6 years agoAdd a more precise error message
scalexm [Tue, 1 Aug 2017 19:38:52 +0000 (21:38 +0200)]
Add a more precise error message
When trying to perform static dispatch on something which derefs
to a trait object, and the target trait is not in scope, we had
confusing error messages if the target method had a
`Self: Sized` bound. We add a more precise error message in this
case: "consider using trait ...".

Fixes #35976.

6 years agoAuto merge of #43622 - RalfJung:config.toml, r=michaelwoerister
bors [Thu, 3 Aug 2017 11:50:29 +0000 (11:50 +0000)]
Auto merge of #43622 - RalfJung:config.toml, r=michaelwoerister

extend config.toml doc for debug-assertions

Even after I knew that I had to change config.toml to get any printing from debug! and trace!, going over the entire fail did not make it clear to me that `debug-assertions` is the option controlling that.

6 years agoInvert constant and function color
Guillaume Gomez [Thu, 3 Aug 2017 10:46:35 +0000 (12:46 +0200)]
Invert constant and function color

6 years agoAuto merge of #43616 - mbrubeck:fnv, r=michaelwoerister
bors [Thu, 3 Aug 2017 08:25:49 +0000 (08:25 +0000)]
Auto merge of #43616 - mbrubeck:fnv, r=michaelwoerister

Remove unused FnvHash code

None

6 years agoAdd more regression tests for #40510
Daan Sprenkels [Thu, 3 Aug 2017 02:14:16 +0000 (04:14 +0200)]
Add more regression tests for #40510

6 years agoAuto merge of #43611 - nrc:save-tidy, r=eddyb
bors [Thu, 3 Aug 2017 04:32:37 +0000 (04:32 +0000)]
Auto merge of #43611 - nrc:save-tidy, r=eddyb

Update RLS and deps

This PR further moves towards configuring save-analysis using the rls-data Config struct. We remove completely the concept of api_crate. Updates the RLS so the client is expecting these changes and which pulls in a commit re-enabling all RLS tests (been disabled due to a span error for a while).

6 years agoAppease tidy and fix save-analysis config for dist builds
Nick Cameron [Wed, 2 Aug 2017 22:20:01 +0000 (10:20 +1200)]
Appease tidy and fix save-analysis config for dist builds

6 years agoextend config.toml doc
Ralf Jung [Thu, 3 Aug 2017 04:12:36 +0000 (21:12 -0700)]
extend config.toml doc

6 years agoIndicate how `ThreadId` is created.
Corey Farwell [Thu, 3 Aug 2017 00:59:33 +0000 (20:59 -0400)]
Indicate how `ThreadId` is created.

6 years agoFix broken links in `Thread` docs.
Corey Farwell [Thu, 3 Aug 2017 00:57:47 +0000 (20:57 -0400)]
Fix broken links in `Thread` docs.

6 years agoUpdate nomicon
Simon Sapin [Wed, 2 Aug 2017 22:36:43 +0000 (00:36 +0200)]
Update nomicon

6 years agoImprove functions
Guillaume Gomez [Wed, 2 Aug 2017 21:09:41 +0000 (23:09 +0200)]
Improve functions

6 years agoImprove color theme for color blind issues
Guillaume Gomez [Wed, 2 Aug 2017 21:00:35 +0000 (23:00 +0200)]
Improve color theme for color blind issues

6 years agoAuto merge of #43614 - pornel:is_gotcha, r=BurntSushi
bors [Wed, 2 Aug 2017 19:01:01 +0000 (19:01 +0000)]
Auto merge of #43614 - pornel:is_gotcha, r=BurntSushi

Emphasise that these functions look at the disk, not just the path

I thought that `PathBuf::new("foo/bar/").is_dir()` is always true, because the path ends in `/`. However, this is not what `is_dir()` function does. So I've updated the docs to make it clear.

6 years agoRemove unused fnv hash code
Matt Brubeck [Wed, 2 Aug 2017 17:42:12 +0000 (10:42 -0700)]
Remove unused fnv hash code

6 years agoFix some unaligned reads on SPARC in LTO
Danek Duvall [Wed, 2 Aug 2017 16:58:16 +0000 (09:58 -0700)]
Fix some unaligned reads on SPARC in LTO

This fixes #43593 by eliminating some undefined behavior.

6 years agoAuto merge of #43607 - marioidival:master, r=alexcrichton
bors [Wed, 2 Aug 2017 16:21:39 +0000 (16:21 +0000)]
Auto merge of #43607 - marioidival:master, r=alexcrichton

Remove unecessary test code #43219

related #43219

6 years agoEmphasise that these functions look at the disk, not just the path
Kornel [Wed, 2 Aug 2017 14:40:08 +0000 (15:40 +0100)]
Emphasise that these functions look at the disk, not just the path

6 years agorustc_trans: do not pass floating-point values to LLVM through FFI.
Eduard-Mihai Burtescu [Sun, 30 Jul 2017 17:43:53 +0000 (20:43 +0300)]
rustc_trans: do not pass floating-point values to LLVM through FFI.

6 years agorustc_const_math: use apfloat::ieee::{Single,Double} in ConstFloat.
Eduard-Mihai Burtescu [Sun, 30 Jul 2017 04:32:11 +0000 (07:32 +0300)]
rustc_const_math: use apfloat::ieee::{Single,Double} in ConstFloat.

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 agoUpdate RLS
Nick Cameron [Wed, 2 Aug 2017 05:21:12 +0000 (17:21 +1200)]
Update RLS

6 years agoUpdate rls-data dep
Nick Cameron [Wed, 2 Aug 2017 04:57:50 +0000 (16:57 +1200)]
Update rls-data dep

6 years agoalso release-validate return value before a call
Ralf Jung [Wed, 2 Aug 2017 04:06:33 +0000 (21:06 -0700)]
also release-validate return value before a call

6 years agosave-analysis: only emit public fields in value of a struct if the config permits
Nick Cameron [Wed, 2 Aug 2017 03:46:59 +0000 (15:46 +1200)]
save-analysis: only emit public fields in value of a struct if the config permits

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 agoRemove unecessary test code #43219
Mario Idival [Wed, 2 Aug 2017 03:06:42 +0000 (00:06 -0300)]
Remove unecessary test code #43219

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 agoAdd regression test for #40510
Daan Sprenkels [Wed, 2 Aug 2017 01:44:11 +0000 (03:44 +0200)]
Add regression test for #40510

6 years agoclosure unsafety check: stop moving up when we hit an item
Ralf Jung [Wed, 2 Aug 2017 01:26:28 +0000 (18:26 -0700)]
closure unsafety check: stop moving up when we hit an item

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 agorustc_apfloat: complete the IEEE & PPC implementations.
Eduard-Mihai Burtescu [Fri, 28 Jul 2017 18:10:06 +0000 (21:10 +0300)]
rustc_apfloat: complete the IEEE & PPC implementations.

6 years agorustc_apfloat: port the suite of unit tests.
Eduard-Mihai Burtescu [Tue, 11 Jul 2017 22:06:56 +0000 (01:06 +0300)]
rustc_apfloat: port the suite of unit tests.

6 years agorustc_apfloat: stub IEEE & PPC implementations.
Eduard-Mihai Burtescu [Tue, 11 Jul 2017 22:06:02 +0000 (01:06 +0300)]
rustc_apfloat: stub IEEE & PPC implementations.

6 years agorustc_apfloat: introduce the base Float API.
Eduard-Mihai Burtescu [Sat, 8 Jul 2017 17:46:43 +0000 (20:46 +0300)]
rustc_apfloat: introduce the base Float API.

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 agotrans: Check LLVM type instead of Layout
Florian Zeitz [Tue, 1 Aug 2017 22:32:14 +0000 (00:32 +0200)]
trans: Check LLVM type instead of Layout

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 agoadd a closure inside an unsafe fn to the tests
Ralf Jung [Tue, 1 Aug 2017 20:14:32 +0000 (13:14 -0700)]
add a closure inside an unsafe fn to the tests

6 years agouse FnLike to recognize functions for us
Ralf Jung [Tue, 1 Aug 2017 20:07:45 +0000 (13:07 -0700)]
use FnLike to recognize functions for us

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 agoAdd an overflow check in the Iter::next() impl for Range<_>
oyvindln [Tue, 1 Aug 2017 17:17:33 +0000 (19:17 +0200)]
Add an overflow check in the Iter::next() impl for Range<_>

This helps with vectorization in some cases, such as (0..u16::MAX).collect::<Vec<u16>>(),
 as LLVM is able to change the loop condition to use equality instead of less than

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 agohandle trait items as well
Ralf Jung [Tue, 1 Aug 2017 16:22:58 +0000 (09:22 -0700)]
handle trait items as well

6 years agohandle tuple struct ctors
Ralf Jung [Tue, 1 Aug 2017 15:48:28 +0000 (08:48 -0700)]
handle tuple struct ctors

6 years agoincr.comp.: Assert that no DepNode is re-opened (see issue #42298).
Michael Woerister [Tue, 1 Aug 2017 14:34:20 +0000 (16:34 +0200)]
incr.comp.: Assert that no DepNode is re-opened (see issue #42298).

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 agoHandle closures. Add some more tests.
Ralf Jung [Tue, 1 Aug 2017 02:51:10 +0000 (19:51 -0700)]
Handle closures.  Add some more tests.

6 years agolimit and delimit available fields in note
Zack M. Davis [Mon, 31 Jul 2017 07:31:32 +0000 (00:31 -0700)]
limit and delimit available fields in note

Also, don't show the note if no fields are available (usually due to
privacy).