Commit Graph

53392 Commits

Author SHA1 Message Date
Stefan Schindler
22615adf02 Catch thread in example
- Consume result of thread join()
 - Add link to threading model
2016-05-19 23:05:08 +02:00
bors
764ef92ae7 Auto merge of #33742 - Manishearth:rollup, r=Manishearth
Rollup of 10 pull requests

- Successful merges: #33353, #33611, #33696, #33698, #33705, #33708, #33712, #33720, #33721, #33730
- Failed merges:
2016-05-19 09:45:53 -07:00
Manish Goregaokar
acd2c11c5e Rollup merge of #33730 - jseyfried:fix_macro_backtrace_diagnostics, r=nikomatsakis
Fix macro expansion backtrace diagnostics

Fixes #33704.
r? @nikomatsakis
2016-05-19 21:21:08 +05:30
Manish Goregaokar
5928d49aa0 Rollup merge of #33721 - royalstream:royalstream-doc-highlights, r=Manishearth
Rust syntax coloring for some ignore, should-panic and no-run snippets.

In the book, some code blocks were missing the `rust` specifier which is needed for them to highlight correctly.
2016-05-19 21:21:07 +05:30
Manish Goregaokar
f6f5cdfcec Rollup merge of #33720 - mark-summerfield:patch-1, r=steveklabnik
Clarified that `let(mut x, y) =` only makes x mutable, not y

Closes #33716
2016-05-19 21:21:07 +05:30
Manish Goregaokar
8b4b3a8b09 Rollup merge of #33712 - jseyfried:fix_expanded_expr_span_bug, r=nrc
Fix bug in macro expression spans

Fix a bug in macro expression spans.
r? @nrc
2016-05-19 21:21:07 +05:30
Manish Goregaokar
14661aeb0a Rollup merge of #33708 - nham:zero-elided-lifetimes, r=sanxiyn
Only print parameters with elided lifetimes in elision error messages.

When displaying the function parameters for a lifetime elision error message,
this changes it to first filter out the parameters that don't have elided
lifetimes.

Fixes #30255.
2016-05-19 21:21:06 +05:30
Manish Goregaokar
355d9f98f5 Rollup merge of #33705 - lqd:rustdoc-version-tooltip, r=GuillaumeGomez
rustdoc: Make the #[stable(since)] version attribute clearer with a tooltip

Rustdoc's new 'since' version placement only shows the version number in which the item was marked stable. This gains space but might make the meaning of this version string less clear in the docs, so I tried to bring some explicitness in a tooltip.
2016-05-19 21:21:06 +05:30
Manish Goregaokar
26f666b7ad Rollup merge of #33698 - alexcrichton:update-libc, r=japaric
std: Update libc submodule

Brings in a fix where `-lutil` is no longer passed for musl targets, lifting the
need for a musl toolchain to be installed again.

Closes #33608
2016-05-19 21:21:06 +05:30
Manish Goregaokar
7acb22ab54 Rollup merge of #33696 - nham:add-test-21225, r=luqmana
Add regression tests for error message when using enum variant as a type

I'm guessing these were actually fixed with PR #27085.

Closes #21225
Closes #19197
2016-05-19 21:21:05 +05:30
Manish Goregaokar
e4f33d5ae7 Rollup merge of #33611 - vvanders:master, r=steveklabnik
Add a note about Higher-Ranked Trait Bounds in docs on Closures.

I hit a snag with lifetimes a few days ago and it wasn't until @birkenfeld pointed out Higher-Ranked Trait Bounds that I was able to solve the issue involving lifetimes on closure traits. This adds a small section in the book so that other users can find it.

r? @steveklabnik
2016-05-19 21:21:05 +05:30
Manish Goregaokar
c9ca735a7b Rollup merge of #33353 - timothy-mcroy:E0502, r=sanxiyn
Add error explanation for E0502

I am questioning the order of presentation on the suggested code fixes, but I'm not sure what would be best.  Thoughts?

r? @GuillaumeGomez
2016-05-19 21:21:05 +05:30
bors
2fb6f8e2c9 Auto merge of #33702 - crimsun:pr33678, r=alexcrichton
Resolved rustdoc crash (#33678) by aborting instead of unwrapping.

Also removed Option use and comment to match.

Fixes https://github.com/rust-lang/rust/issues/33678
2016-05-19 05:48:11 -07:00
Rémy Rakic
352a70b3a0 Make the #[stable(since)] version attribute clearer with a tooltip 2016-05-19 13:44:09 +02:00
bors
d0ca0ca063 Auto merge of #33694 - arielb1:fuzzy-on-unimplemented, r=nikomatsakis
implement fuzzy matching in on_unimplemented

Fixes #31062

r? @nikomatsakis
2016-05-19 01:50:53 -07:00
bors
0c5d651d0b Auto merge of #33688 - jonathandturner:fix_old_school, r=nikomatsakis
Fix for old school error issues, improvements to new school

This PR:
* Fixes some old school error issues, specifically #33559, #33543, #33366
* Improves wording borrowck errors with match patterns
* De-emphasize multi-line spans, so we don't color the single source character when we're trying to say "span starts here"
* Rollup of #33392 (which should help fix #33390)

r? @nikomatsakis
2016-05-18 21:19:07 -07:00
Jeffrey Seyfried
f8e9c15027 Fix macro expansion backtrace diagnostics 2016-05-19 00:24:43 +00:00
bors
9c6904ca1e Auto merge of #33686 - GuillaumeGomez:error-code-tests, r=steveklabnik
Add new error code tests

r? @steveklabnik
2016-05-18 15:12:56 -07:00
Ariel Ben-Yehuda
b9a201c6df address review comments 2016-05-18 23:28:31 +03:00
Nick Hamann
a50c82bc3b Simplify report_elision_failure a little bit. 2016-05-18 13:09:25 -05:00
Steven Burns
c9517189d7 Rust syntax coloring for some ignore, should-panic and no-run snippets. 2016-05-18 11:30:50 -06:00
mark-summerfield
98f1c35c77 Clarified that let(mut x, y) = only makes x mutable, not y 2016-05-18 17:43:22 +01:00
Ariel Ben-Yehuda
b344c7171e implement fuzzy matching in on_unimplemented 2016-05-18 19:13:09 +03:00
bors
9a140454ea Auto merge of #33476 - nikomatsakis:incr-comp-xcrate, r=mw
track incr. comp. dependencies across crates

This PR refactors the compiler's incremental compilation hashing so that it can track dependencies across crates. The main bits are:

- computing a hash representing the metadata for an item we are emitting
  - we do this by making `MetaData(X)` be the current task while computing metadata for an item
  - this naturally registers reads from any tables and things that we read for that purpose
  - we can then hash all the inputs to those tables
- tracking when we access metadata
  - we do this by registering a read of `MetaData(X)` for each foreign item `X` whose metadata we read
- hashing metadata from foreign items
  - we do this by loading up metadata from a file in the incr. comp. directory
  - if there is no file, we use the SVH for the entire crate

There is one very simple test only at this point. The next PR will be focused on expanding out the tests.

Note that this is based on top of https://github.com/rust-lang/rust/pull/33228

r? @michaelwoerister
2016-05-18 08:47:53 -07:00
Niko Matsakis
f860f8b7c9 add task for linking
In MSVC (at least), linking requires accessing metadata, which generates
reads.
2016-05-18 10:11:36 -04:00
Niko Matsakis
4d3ef6b63d fix indentation of session/mod.rs 2016-05-18 10:11:36 -04:00
Niko Matsakis
eaafe45c08 add debug info to dep_graph 2016-05-18 10:11:36 -04:00
Niko Matsakis
e4c31de61e nit: cache crate-hash for next time 2016-05-18 10:11:36 -04:00
Niko Matsakis
c981001389 nit: use format! instead of iterator 2016-05-18 10:11:36 -04:00
Niko Matsakis
bed7ea8609 basic tests for cross-crate hashing 2016-05-18 10:11:36 -04:00
Niko Matsakis
3a2edd7e61 load/save hashes of metadata
This commit reorganizes how the persist code treats hashing. The idea is
that each crate saves a file containing hashes representing the metadata
for each item X. When we see a read from `MetaData(X)`, we can load this
hash up (if we don't find a file for that crate, we just use the SVH for
the entire crate).

To compute the hash for `MetaData(Y)`, where Y is some local item, we
examine all the predecessors of the `MetaData(Y)` node and hash their
hashes together.
2016-05-18 10:11:36 -04:00
Niko Matsakis
b01919a144 allow retracing paths across crates
For external crates, we must build up a map that goes from
the DefKey to the DefIndex. We do this by iterating over each
index that is found in the metadata and loading the associated
DefKey.
2016-05-18 10:11:36 -04:00
Niko Matsakis
303fdc17f6 cleanup dep-graph debugging code
Create some re-usable filtering subroutines.
2016-05-18 10:11:36 -04:00
Niko Matsakis
0082fc0ad4 change svh to store a u64
We used to store a u64 converted to a String for some reason. Now we
don't.
2016-05-18 10:11:35 -04:00
Niko Matsakis
08837d2975 pass revision and incr_comp directory to auxbuild
This is needed for incremental compilation harness to support
cross-crate testing. Also support cfg for typechecking prettyprint
2016-05-18 10:11:35 -04:00
Niko Matsakis
8f3a8c24cd always encode variant fields
we need them to be able to retrace.
2016-05-18 10:11:35 -04:00
Niko Matsakis
c7840cfe14 make the filename computation take a cratenum 2016-05-18 10:11:35 -04:00
Niko Matsakis
f89041bbe3 identify inputs of MetaData(X) nodes
Generate a second hash file that contains the metadata for an X node.
2016-05-18 10:11:35 -04:00
Niko Matsakis
bc02a54d12 rename the dep-graph file to include crate ident
This way, multiple compilations can share the same work directory.
2016-05-18 10:11:35 -04:00
Niko Matsakis
ef902a211b when encoding, push MetaData(foo) task on stack
This lets us determine what was used to construct the metadata.

Conflicts:
	src/librustc_metadata/encoder.rs
2016-05-18 10:11:35 -04:00
Niko Matsakis
5bcdf4c192 add a MetaData node and trigger reads from it
Conflicts:
	src/librustc_metadata/csearch.rs
2016-05-18 10:11:35 -04:00
Niko Matsakis
7734308f89 ignore dep-graph in resolve and lower_crate
This got removed at some point, it seems.
2016-05-18 10:11:35 -04:00
Niko Matsakis
b711734a5f thread the DepGraph to session/crate-store
This is a [breaking-change] for plugin authors.
You must now create a dep-graph earlier.
2016-05-18 10:10:45 -04:00
Niko Matsakis
2237e89908 remove the Any bound from CrateStore
This is a [breaking-change] for plugins, which
ought by now to have stopped relying on downcasting.
2016-05-18 10:10:45 -04:00
Niko Matsakis
47af3f1935 add MetaData DepNode variant 2016-05-18 10:10:45 -04:00
Jonathan Turner
b0a317dc6f Fix tidy error 2016-05-18 08:30:46 -04:00
bors
9743c661b0 Auto merge of #33710 - Manishearth:rollup, r=Manishearth
Rollup of 5 pull requests

- Successful merges: #33656, #33666, #33673, #33675, #33695
- Failed merges:
2016-05-18 05:04:26 -07:00
Jeffrey Seyfried
f630419351 Fix bug in macro expression spans 2016-05-18 11:46:08 +00:00
ggomez
afd4cccd62 Add new error code tests 2016-05-18 12:05:59 +02:00
Manish Goregaokar
07194a0350 Rollup merge of #33695 - nikomatsakis:spezializes-cache, r=aturon
introduce a specializes cache

This query is frequently used during trait selection and caching the
result can be a reasonable performance win.

The one case I examined thus far was the mrusty package (v0.5.1), where I saw an improvement in "typeck item bodies" from ~8.3s to ~1.9s.

r? @aturon
2016-05-18 14:07:46 +05:30