Commit Graph

66492 Commits

Author SHA1 Message Date
Ralf Jung
7d8dc7a979 also release-validate return value before a call 2017-08-01 21:06:33 -07:00
Nick Cameron
4e6c1dddff save-analysis: only emit public fields in value of a struct if the config permits 2017-08-02 15:46:59 +12:00
bors
4f3062c88e Auto merge of #43603 - frewsxcv:rollup, r=frewsxcv
Rollup of 6 pull requests

- Successful merges: #43389, #43423, #43581, #43585, #43597, #43598
- Failed merges:
2017-08-02 03:39:27 +00:00
Mario Idival
fefe63ce04 Remove unecessary test code #43219 2017-08-02 00:06:42 -03:00
Ralf Jung
e92ddbf5f7 improve hir::map::Map::get_parent_node doc 2017-08-01 19:22:23 -07:00
QuietMisdreavus
5c4c2d9235 rustdoc: shrink headings in non-top-level docblocks 2017-08-01 21:09:34 -05:00
Daan Sprenkels
92836e397c Add regression test for #40510 2017-08-02 04:02:30 +02:00
Ralf Jung
321a72c1c1 closure unsafety check: stop moving up when we hit an item 2017-08-01 18:26:28 -07:00
Corey Farwell
368f1a8e93 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
2017-08-02 01:22:30 +00:00
Corey Farwell
1c91c785da 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.
2017-08-02 01:22:29 +00:00
Corey Farwell
08c0bbd062 Rollup merge of #43585 - frewsxcv:frewsxcv-hashset-docs, r=steveklabnik,quietmisdreavus
Improve docs & doc examples for HashSet.

None
2017-08-02 01:22:28 +00:00
Corey Farwell
c96ce4064a 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!
2017-08-02 01:22:27 +00:00
Corey Farwell
2d9893fda7 Rollup merge of #43423 - xliiv:cell-example, r=steveklabnik
Add simple docs example for struct Cell
2017-08-02 01:22:27 +00:00
Corey Farwell
ab3fb956f3 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.
2017-08-02 01:22:26 +00:00
bors
f5f58d0298 Auto merge of #43579 - cuviper:extern-llvm-features, r=alexcrichton
Gate LLVMRustHasFeature on LLVM_RUSTLLVM

Commit c4710203c0 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.
2017-08-02 01:13:02 +00:00
Eduard-Mihai Burtescu
1409d205ad rustc_apfloat: complete the IEEE & PPC implementations. 2017-08-02 03:45:03 +03:00
Eduard-Mihai Burtescu
7a5fccf331 rustc_apfloat: port the suite of unit tests. 2017-08-02 03:45:03 +03:00
Eduard-Mihai Burtescu
2686a7af79 rustc_apfloat: stub IEEE & PPC implementations. 2017-08-02 03:45:03 +03:00
Eduard-Mihai Burtescu
877ec94654 rustc_apfloat: introduce the base Float API. 2017-08-02 03:45:03 +03:00
Isaac van Bakel
d3236a85ff Fixed another problem. 2017-08-02 00:55:05 +01:00
Corey Farwell
d9df2963ad Add doc example for HashSet::drain. 2017-08-01 19:51:00 -04:00
Corey Farwell
34c1bfb0e1 Remove unnecessary clones in doc examples. 2017-08-01 19:51:00 -04:00
Corey Farwell
1599fad5b4 Show the capacity in HashSet::with_capacity doc example. 2017-08-01 19:51:00 -04:00
Corey Farwell
9e2b0c6390 Remove unnecessary 'mut' bindings. 2017-08-01 19:51:00 -04:00
Corey Farwell
070eb3c667 Indicate HashSet is code-like in docs. 2017-08-01 19:51:00 -04:00
Corey Farwell
9e19260286 Show that the capacity changed in HashSet::reserve doc example. 2017-08-01 19:51:00 -04:00
Corey Farwell
881062776a Add doc example for HashSet::hasher. 2017-08-01 19:51:00 -04:00
bors
640cfc852a 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
2017-08-01 22:43:15 +00:00
Florian Zeitz
c3603f3ec6 trans: Check LLVM type instead of Layout 2017-08-02 00:32:14 +02:00
Isaac van Bakel
bb578b6e12 Added tests for bugs fixed. 2017-08-01 23:01:25 +01:00
Isaac van Bakel
d817d58fe4 Fixed formatting. 2017-08-01 23:01:25 +01:00
Isaac van Bakel
c623375326 Fixed extra cases found in better checking. 2017-08-01 23:01:24 +01:00
Isaac van Bakel
8e4c9e4e9d Fixed interior mutable references causing a mark
The mutability system now checks where derefs go through borrows in the
loan chain, and can correctly detect mutable borrows inside structs and
tuples.
2017-08-01 23:01:24 +01:00
Isaac van Bakel
400075d9d9 Fixed all unnecessary muts in language core 2017-08-01 23:01:24 +01:00
Isaac van Bakel
35b9bd0559 Fixed refs being marked used mutably on mut deref
Boxes are the exception - since a Box is as mutable as its contents.
2017-08-01 23:01:24 +01:00
Inokentiy Babushkin
1b831cf54e
Derive Hash on AssociatedKind.
This is a trivial change useful in downstream code poking in rustc's
innards.
2017-08-01 22:27:30 +02:00
Ralf Jung
a8129d128c add a closure inside an unsafe fn to the tests 2017-08-01 13:14:32 -07:00
Ralf Jung
c5154d036d use FnLike to recognize functions for us 2017-08-01 13:07:45 -07:00
bors
dd53dd5f9e 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
2017-08-01 19:59:53 +00:00
Danek Duvall
bdb53e55b0 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.
2017-08-01 12:38:36 -07:00
oyvindln
4bb9a8b4ac 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
2017-08-01 19:31:50 +02:00
bors
e772c28d2e 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
2017-08-01 17:21:24 +00:00
Ralf Jung
8f910bcbbc handle trait items as well 2017-08-01 09:22:58 -07:00
Ralf Jung
4310edb4cb handle tuple struct ctors 2017-08-01 08:48:28 -07:00
Michael Woerister
6bb0693fde incr.comp.: Assert that no DepNode is re-opened (see issue #42298). 2017-08-01 16:47:49 +02:00
QuietMisdreavus
71751db491 add documentation for function pointers as a primitive 2017-08-01 09:42:12 -05:00
bors
c2407516ff 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.
2017-08-01 14:20:23 +00:00
Michael Woerister
6468cad977 async-llvm(29): Adapt run-make/llvm-phase test case to LLVM module not being available in memory. 2017-08-01 15:57:38 +02:00
Michael Woerister
b8d441350b async-llvm(28): Make some error messages more informative. 2017-08-01 14:43:55 +02:00
Ariel Ben-Yehuda
70478ca5c8 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`.
2017-08-01 14:44:20 +03:00