Commit Graph

53367 Commits

Author SHA1 Message Date
Steven Burns
519cc8280c Book: small improvement to a table to make it clearer 2016-05-19 11:05:13 -06: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
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
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
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
Manish Goregaokar
9246cc41a6 Rollup merge of #33675 - apasel422:issue-33662, r=pnkfelix
Add missing code fence to `diagnostics.rs`

Closes #33662
2016-05-18 14:07:45 +05:30
Manish Goregaokar
f91360f24e Rollup merge of #33673 - GuillaumeGomez:fix-selected-item-style, r=steveklabnik
Fix selected item background style

r? @steveklabnik
2016-05-18 14:07:45 +05:30
Manish Goregaokar
83429f9e31 Rollup merge of #33666 - xen0n:no-more-nest-levels, r=nikomatsakis
syntax_ext: format: nest_level's are no more

Just noticed this while working on #33642 and here's a quick fix, shouldn't touch anything else. It's some historic code indeed...
2016-05-18 14:07:45 +05:30
Manish Goregaokar
7a759d7ab6 Rollup merge of #33656 - GuillaumeGomez:lifetime_bound, r=steveklabnik
Add lifetime's bounds in doc generation

Fixes #33653

![screenshot from 2016-05-15 15 30 38](https://cloud.githubusercontent.com/assets/3050060/15274445/024dbd5c-1ab2-11e6-9387-274301a05627.png)

r? @steveklabnik
2016-05-18 14:07:44 +05:30
bors
310d8996f4 Auto merge of #33654 - petrochenkov:hirident, r=nrc
Remove hir::Ident

Now when name resolution is done on AST, `hir::Ident` is no longer necessary.
See https://github.com/rust-lang/rust/pull/30145 for more details.

r? @nrc
2016-05-18 00:27:49 -07:00
bors
75e23e1b03 Auto merge of #33137 - nikomatsakis:issue-32330-lbr-in-return-type-warning-2, r=aturon
Warnings for issue #32330

This is an extension of the previous PR that issues warnings in more situations than before. It does not handle *all* cases of #32330 but I believe it issues warnings for all cases I've seen in practice.

Before merging I'd like to address:

- open a good issue explaining the problem and how to fix it (I have a [draft writeup][])
- work on the error message, which I think is not as clear as it could/should be (suggestions welcome)

r? @aturon

[draft writeup]: https://gist.github.com/nikomatsakis/631ec8b4af9a18b5d062d9d9b7d3d967
2016-05-17 18:10:53 -07:00
Niko Matsakis
639890d92d fix stale method names 2016-05-17 20:25:18 -04:00
Niko Matsakis
ccfb74e800 warn for where/return-types that reference regions
This is a step towards fixing #32330. The full fix would be a breaking
change, so we begin by issuing warnings for scenarios that will break.
2016-05-17 20:25:18 -04:00
Niko Matsakis
97ca8d799c fix -Z treat-err-as-bug 2016-05-17 16:27:23 -04:00
Niko Matsakis
df5c62bed2 refactor: use select inside of a probe
We ought not to be affecting inference state when assembling candidates,
so invoke select inside of a probe.
2016-05-17 16:27:23 -04:00
bors
0667ae93fb Auto merge of #33665 - golddranks:thread-park-add-big-picture-explanation, r=aturon
Added a big-picture explanation for thread::park() & co.

As I said in https://www.reddit.com/r/rust/comments/4ihvv1/hey_rust_programmers_got_a_question_ask_here/d372s4i, the current explanation of the `park()` and `unpark()` is a bit unclear. It says that they're used for blocking, but then it goes on explaining the semantics in detail, leaving the bigger picture a bit unclear.

I added a short high-level explanation that explains how the functions are used. I also exposed the full paths (`thread::park()` and `thread::Thread::unpark()`), because `unpark()`, being a method, is not directly visible at the module level.
2016-05-17 13:11:57 -07:00
Niko Matsakis
29dad1a280 introduce a specializes cache
This query is frequently used during trait selection and caching the
result can be a reasonable performance win.
2016-05-17 15:52:03 -04:00
Jonathan Turner
c1c1ad5ec5 Fix for #33559 2016-05-17 11:27:58 -04:00
bors
30422de32d Auto merge of #33682 - GuillaumeGomez:fix-error-explanation-enum, r=sanxiyn
Fix invalid enum declaration

r? @steveklabnik
cc @Ms2ger
2016-05-17 07:53:49 -07:00
Guillaume Gomez
6e1154dc9d Fix invalid enum declaration 2016-05-17 13:43:23 +02:00
bors
5d12502d3a Auto merge of #33617 - sanmai-NL:gitignore_IntelliJ, r=nikomatsakis
IntelliJ support, ordering, cleanup
2016-05-17 04:02:15 -07:00
Jonathan Turner
175ecfefd5 Improve a few errors and fix #33366 2016-05-17 06:46:08 -04:00
Jonathan Turner
3e9747af49 De-emph minimized spans, add better debugging output 2016-05-17 06:46:08 -04:00