Commit Graph

851 Commits

Author SHA1 Message Date
bors
10333dde82 Auto merge of #47494 - michaelwoerister:proc-macro-incremental, r=nikomatsakis
Don't include DefIndex in proc-macro registrar function symbol.

There can only ever be one registrar function per plugin or proc-macro crate, so adding the `DefIndex` to the function's symbol name does not serve a real purpose. Remove the `DefIndex` from the symbol name makes it stable across incremental compilation sessions.

This should fix issue #47292.
2018-01-19 04:45:22 +00:00
Michael Woerister
8756ef6385 Don't include DefIndex in plugin- and proc-macro registrar fn symbol. 2018-01-16 17:30:11 +01:00
Carol (Nichols || Goulding)
e168aa385b
Reexport -> re-export in prose and documentation comments 2018-01-15 13:36:53 -05:00
kennytm
f98a9a681e
Rollup merge of #47372 - topecongiro:issue-43925, r=alexcrichton
Avoid panicking when invalid argument is passed to cfg(..)

Closes #43925.
Closes #43926.
2018-01-15 18:49:36 +08:00
leonardo.yvens
f93183adb4 Remove impl Foo for .. in favor of auto trait Foo
No longer parse it.
Remove AutoTrait variant from AST and HIR.
Remove backwards compatibility lint.
Remove coherence checks, they make no sense for the new syntax.
Remove from rustdoc.
2018-01-13 18:48:00 +03:00
bors
ca092937aa Auto merge of #47181 - michaelwoerister:var-len-def-index, r=eddyb
Use DefIndex encoding that works better with on-disk variable length integer representations.

Use the least instead of the most significant bit for representing the address space.

r? @eddyb
2018-01-13 09:11:59 +00:00
kennytm
7ffdabd401 Rollup merge of #47328 - mbrubeck:fs_read, r=sfackler
Use the new fs_read_write functions in rustc internals

Uses `fs::read` and `fs::write` (added by #45837) where appropriate, to simplify code and dog-food these new APIs.  This also improves performance, when combined with #47324.
2018-01-13 02:26:35 +08:00
Seiichi Uchida
d088b25d7e Avoid panicking when invalid argument is passed to cfg(..)
Closes #43925.
Closes #43926.
2018-01-12 21:48:17 +09:00
bors
619ced0578 Auto merge of #47087 - Zoxc:incr_no_in_ignore, r=michaelwoerister
Replace uses of DepGraph.in_ignore with DepGraph.with_ignore

I currently plan to track tasks in thread local storage. Ignoring things in a closure ensures that the ignore tasks do not overlap the beginning or end of any other task. The TLS API will also use a closure to change a TLS value, so having the ignore task be a closure also helps there.

It also adds `assert_ignored` which is used before a `TyCtxt` is created. Instead of adding a new ignore task this simply ensures that we are in a context where reads are ignored.

r? @michaelwoerister
2018-01-11 03:24:16 +00:00
bors
c9c2980736 Auto merge of #47243 - wesleywiser:incr_fingerprint_encoding, r=michaelwoerister
[incremental] Specialize encoding and decoding of Fingerprints

This saves the storage space used by about 32 bits per `Fingerprint`.
On average, this reduces the size of the `/target/{mode}/incremental`
folder by roughly 5% [Full details here](https://gist.github.com/wesleywiser/264076314794fbd6a4c110d7c1adc43e).

Fixes #45875

r? @michaelwoerister
2018-01-11 00:23:23 +00:00
Matt Brubeck
3f9c057ea6 Use the new fs_read_write functions in rustc internals 2018-01-10 14:53:40 -08:00
Wesley Wiser
01c890ee96 [incremental] Specialize encoding and decoding of Fingerprints
This saves the storage space used by about 32 bits per `Fingerprint`.
On average, this reduces the size of the `/target/{mode}/incremental`
folder by roughly 5%.

Fixes #45875
2018-01-09 20:20:50 -05:00
John Kåre Alsaker
9508922499 Replace uses of DepGraph.in_ignore with DepGraph.with_ignore 2018-01-09 18:35:50 +01:00
kennytm
6648dcd353
Rollup merge of #47258 - rkruppe:struct-assert, r=eddyb
rustc::ty: Rename struct_variant to non_enum_variant

r? @eddyb
2018-01-09 03:37:16 +08:00
Michael Woerister
c9d25e3269 Use different DefIndex representation that is better suited for variable length integer encodings. 2018-01-08 14:15:17 +01:00
Robin Kruppe
cf3fefe97f rustc::ty: Rename struct_variant to non_enum_variant
It is also intended for use with unions.
2018-01-08 00:28:05 +01:00
Malo Jaffré
3f073c409a Try to fix a perf regression by updating log
Upgrade `log` to `0.4` in multiple crates.
2018-01-07 16:54:05 +01:00
bors
69f17d1a0a Auto merge of #47177 - michaelwoerister:erase-invalid-spans-during-metadata-encoding, r=alexcrichton
Map invalid Spans to DUMMY_SP during crate metadata encoding.

This mirrors what we do for stabilizing the incr. comp. cache and is necessary for reproducible builds. For the incr. comp. cache, we *have* to do this because the encoding there cannot represent broken Spans. Metadata encoding has to be in sync with that as not to get unexpected interactions when compiling incrementally.

This should help with fixing issue https://github.com/rust-lang/rust/issues/47066.

r? @alexcrichton
2018-01-07 09:23:33 +00:00
bors
72176cf96c Auto merge of #47141 - alexcrichton:bump-bootstrap, r=alexcrichton
Bump to 1.25.0

* Bump the release version to 1.25
* Bump the bootstrap compiler to the recent beta
* Allow using unstable rustdoc features on beta - this fix has been applied to
  the beta branch but needed to go to the master branch as well.
2018-01-06 14:50:14 +00:00
Alex Crichton
8c9bf663d4 rustc: Don't use relative paths for extended errors
These no longer work now that Cargo changes the cwd of rustc while it's running.
Instead use an absolute path that's set by rustbuild.
2018-01-04 07:21:22 -08:00
Michael Woerister
30d921fb1e Span Encoding: Replace if with debug_assertion() and add some comments. 2018-01-04 13:13:32 +01:00
Michael Woerister
4aa48a3241 Map invalid Spans to DUMMY_SP during crate metadata encoding.
This mirrors what we for stabilizing the incr. comp. cache and is
necessary for reproducible builds.
2018-01-04 11:26:47 +01:00
bors
8d1a30289e Auto merge of #46913 - Eh2406:master, r=eddyb
CStore switch FxHashMap to IndexVec

This is a first attempt to fix #46876.
2018-01-03 12:59:52 +00:00
Malo Jaffré
8ed13d643a Update crates and submodules to pull doc fixes
Update `rand` crate to `0.3.19`.
Update `log` crate to `0.3.9` and `0.4.1`.
Update `parking_lot_core` crate to `0.2.9`.
Upgrade all flate2 dependencies to `1.0.1`.
- Update `rust-installer` submodule.
2018-01-01 14:44:10 +01:00
Eh2406
2c69473222 CStore switch FxHashMap to IndexVec 2017-12-27 10:36:52 -05:00
bors
f0cf23e115 Auto merge of #46842 - michaelwoerister:fingerprint-vec, r=nikomatsakis
incr.comp.: Use an array instead of a hashmap for storing result hashes.

Doing so should result in some of the core tracking components being faster.

r? @nikomatsakis
2017-12-22 23:34:29 +00:00
bors
5165ee9e20 Auto merge of #46838 - pnkfelix:issue-46112-followup, r=estebank
Followup for #46112.

Sorting by crate-num should ensure that we favor `std::foo::bar` over
`any_other_crate::foo::bar`.

Interestingly, *this* change had a much larger impact on our internal
test suite than PR #46708 (which was my original fix to #46112).
2017-12-22 16:02:31 +00:00
bors
ba2741594b Auto merge of #46922 - kennytm:rollup, r=kennytm
Rollup of 14 pull requests

- Successful merges: #46636, #46780, #46784, #46809, #46814, #46820, #46839, #46847, #46858, #46878, #46884, #46890, #46898, #46918
- Failed merges:
2017-12-21 23:01:27 +00:00
Jonas Platte
78493ed21a Add GenericParam, refactor Generics in ast, hir, rustdoc
The Generics now contain one Vec of an enum for the generic parameters,
rather than two separate Vec's for lifetime and type parameters.

Additionally, places that previously used Vec<LifetimeDef> now use
Vec<GenericParam> instead.
2017-12-21 13:38:10 +01:00
Michael Woerister
b2f72394ce incr.comp.: Replace Fingerprint::zero() with a constant. 2017-12-20 14:06:11 +01:00
Michael Woerister
0258c6daca incr.comp.: Precompute small hash for filenames to save some work. 2017-12-19 15:27:50 +01:00
Felix S. Klock II
aa030dd3de Followup for #46112.
Sorting by crate-num should ensure that we favor `std::foo::bar` over
`any_other_crate::foo::bar`.

Interestingly, *this* change had a much larger impact on our internal
test suite than PR #46708 (which was my original fix to #46112).
2017-12-19 15:04:02 +01:00
John Kåre Alsaker
970c613e4a Add sync module to rustc_data_structures 2017-12-17 14:14:51 +01:00
Michael Woerister
c7e5b703cd incr.comp.: Revert hashing optimization that caused regression. 2017-12-15 16:50:07 -06:00
bors
0077d128d3 Auto merge of #45047 - durka:trait-alias, r=petrochenkov
trait alias infrastructure

This will be an implementation of trait aliases (RFC 1733, #41517).

Progress so far:

- [x] Feature gate
- [x] Add to parser
  - [x] `where` clauses
    - [x] prohibit LHS type parameter bounds via AST validation https://github.com/rust-lang/rust/pull/45047#discussion_r143575575
- [x] Add to AST and HIR
  - [x] make a separate PathSource for trait alias contexts https://github.com/rust-lang/rust/pull/45047#discussion_r143353932
- [x] Stub out enough of typeck and resolve to just barely not ICE

Postponed:

- [ ] Actually implement the alias part
- [ ] #21903
- [ ] #24010

I need some pointers on where to start with that last one. The test currently does this:

```
error[E0283]: type annotations required: cannot resolve `_: CD`
  --> src/test/run-pass/trait-alias.rs:34:16
   |
34 |     let both = foo();
   |                ^^^
   |
   = note: required by `foo`
```
2017-12-14 20:57:09 +00:00
Alex Burka
2eefc9db15 add trait aliases to HIR 2017-12-14 12:56:26 -05:00
Michael Woerister
0b4c2cccac incr.comp.: Do less hashing per Span. 2017-12-14 10:29:16 -06:00
Oliver Schneider
d732da813b
Use PathBuf instead of String where applicable 2017-12-14 11:22:08 +01:00
bors
0142781ad1 Auto merge of #46708 - pnkfelix:fix-issue-46112, r=arielb1
Fix visible_parent_map to choose globally minimal paths

Fix #46112: visible_parent_map construction needs a BFS over whole crate forest to get globally minimal paths.

(There are other latent bugs that were e.g. causing this test case to have weirdness like `<unnamed>` in the diagnostic output. Those bugs are not fixed here, since they are issues long-standing in the stable channel.)
2017-12-13 23:43:56 +00:00
bors
61100840e5 Auto merge of #46419 - jseyfried:all_imports_in_metadata, r=nrc
Record all imports (`use`, `extern crate`) in the crate metadata

This PR adds non-`pub` `use` and `extern crate` imports in the crate metadata since hygienic macros invoked in other crates may use them. We already include all other non-`pub` items in the crate metadata. This improves import suggestions in some cases.

Fixes #42337.

r? @nrc
2017-12-13 08:32:25 +00:00
Felix S. Klock II
43406d2681 Fix #46112: visible_parent_map construction needs a BFS over whole crate forest. 2017-12-12 19:06:19 -06:00
Vadim Petrochenkov
b07e26e36e Resolve absolute paths as extern under a feature flag 2017-12-13 00:02:23 +03:00
Vadim Petrochenkov
9552b9cfd2 rustc_metadata: Refactor away ExternCrateInfo 2017-12-12 23:50:35 +03:00
Matt Brubeck
3024c1434a Use Try syntax for Option in place of macros or match 2017-12-09 14:18:33 -08:00
Michael Woerister
f5bd1ca678 incr.comp.: Make Span decoding more consistent so it doesn't mess up -Zincremental-verify-ich 2017-12-08 10:02:26 +01:00
Michael Woerister
c5dd9f5301 incr.comp.: Hash spans unconditionally for full accuracy. 2017-12-08 10:02:26 +01:00
Jeffrey Seyfried
1b9d0584a0 Add field is_import to def::Export. 2017-12-05 17:23:01 -08:00
Jeffrey Seyfried
58e80400b2 Include non-pub use and extern crate items in the crate metadata for macros 2.0. 2017-12-05 17:23:01 -08:00
Irina-Gabriela Popa
dda924ab6a rustc_back: move dynamic_lib to rustc_metadata. 2017-12-04 18:25:29 +02:00
bors
d8a60c9611 Auto merge of #46370 - michaelwoerister:rm-metadata-hashing, r=eddyb
incr.comp.: Remove ability to produce incr. comp. hashes during metadata export.

This functionality has been superseded by on-import hashing, which can be less conservative and does not require extra infrastructure.

r? @nikomatsakis
2017-12-01 00:46:08 +00:00