about summary refs log tree commit diff
path: root/src/librustc_metadata
AgeCommit message (Collapse)AuthorLines
2018-01-27rustc: Load the `rustc_trans` crate at runtimeAlex Crichton-4/+23
Building on the work of # 45684 this commit updates the compiler to unconditionally load the `rustc_trans` crate at runtime instead of linking to it at compile time. The end goal of this work is to implement # 46819 where rustc will have multiple backends available to it to load. This commit starts off by removing the `extern crate rustc_trans` from the driver. This involved moving some miscellaneous functionality into the `TransCrate` trait and also required an implementation of how to locate and load the trans backend. This ended up being a little tricky because the sysroot isn't always the right location (for example `--sysroot` arguments) so some extra code was added as well to probe a directory relative to the current dll (the rustc_driver dll). Rustbuild has been updated accordingly as well to have a separate compilation invocation for the `rustc_trans` crate and assembly it accordingly into the sysroot. Finally, the distribution logic for the `rustc` package was also updated to slurp up the trans backends folder. A number of assorted fallout changes were included here as well to ensure tests pass and such, and they should all be commented inline.
2018-01-19Auto merge of #47494 - michaelwoerister:proc-macro-incremental, r=nikomatsakisbors-9/+7
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-16Don't include DefIndex in plugin- and proc-macro registrar fn symbol.Michael Woerister-9/+7
2018-01-15Reexport -> re-export in prose and documentation commentsCarol (Nichols || Goulding)-2/+2
2018-01-15Rollup merge of #47372 - topecongiro:issue-43925, r=alexcrichtonkennytm-3/+13
Avoid panicking when invalid argument is passed to cfg(..) Closes #43925. Closes #43926.
2018-01-13Remove `impl Foo for ..` in favor of `auto trait Foo`leonardo.yvens-25/+1
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-13Auto merge of #47181 - michaelwoerister:var-len-def-index, r=eddybbors-9/+8
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-13Rollup merge of #47328 - mbrubeck:fs_read, r=sfacklerkennytm-5/+3
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-12Avoid panicking when invalid argument is passed to cfg(..)Seiichi Uchida-3/+13
Closes #43925. Closes #43926.
2018-01-11Auto merge of #47087 - Zoxc:incr_no_in_ignore, r=michaelwoeristerbors-15/+15
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-11Auto merge of #47243 - wesleywiser:incr_fingerprint_encoding, r=michaelwoeristerbors-0/+13
[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-10Use the new fs_read_write functions in rustc internalsMatt Brubeck-5/+3
2018-01-09[incremental] Specialize encoding and decoding of FingerprintsWesley Wiser-0/+13
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-09Replace uses of DepGraph.in_ignore with DepGraph.with_ignoreJohn Kåre Alsaker-15/+15
2018-01-09Rollup merge of #47258 - rkruppe:struct-assert, r=eddybkennytm-4/+4
rustc::ty: Rename struct_variant to non_enum_variant r? @eddyb
2018-01-08Use different DefIndex representation that is better suited for variable ↵Michael Woerister-9/+8
length integer encodings.
2018-01-08rustc::ty: Rename `struct_variant` to `non_enum_variant`Robin Kruppe-4/+4
It is also intended for use with unions.
2018-01-07Try to fix a perf regression by updating logMalo Jaffré-2/+2
Upgrade `log` to `0.4` in multiple crates.
2018-01-07Auto merge of #47177 - ↵bors-18/+55
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-06Auto merge of #47141 - alexcrichton:bump-bootstrap, r=alexcrichtonbors-0/+1
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-04rustc: Don't use relative paths for extended errorsAlex Crichton-0/+1
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-04Span Encoding: Replace if with debug_assertion() and add some comments.Michael Woerister-3/+4
2018-01-04Map invalid Spans to DUMMY_SP during crate metadata encoding.Michael Woerister-18/+54
This mirrors what we for stabilizing the incr. comp. cache and is necessary for reproducible builds.
2018-01-03Auto merge of #46913 - Eh2406:master, r=eddybbors-8/+17
CStore switch FxHashMap to IndexVec This is a first attempt to fix #46876.
2018-01-01Update crates and submodules to pull doc fixesMalo Jaffré-1/+1
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.
2017-12-27CStore switch FxHashMap to IndexVecEh2406-8/+17
2017-12-22Auto merge of #46842 - michaelwoerister:fingerprint-vec, r=nikomatsakisbors-1/+1
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-22Auto merge of #46838 - pnkfelix:issue-46112-followup, r=estebankbors-1/+12
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-21Auto merge of #46922 - kennytm:rollup, r=kennytmbors-0/+9
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-21Add GenericParam, refactor Generics in ast, hir, rustdocJonas Platte-3/+3
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-20incr.comp.: Replace Fingerprint::zero() with a constant.Michael Woerister-1/+1
2017-12-19incr.comp.: Precompute small hash for filenames to save some work.Michael Woerister-0/+9
2017-12-19Followup for #46112.Felix S. Klock II-1/+12
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-17Add sync module to rustc_data_structuresJohn Kåre Alsaker-4/+2
2017-12-15incr.comp.: Revert hashing optimization that caused regression.Michael Woerister-2/+0
2017-12-14Auto merge of #45047 - durka:trait-alias, r=petrochenkovbors-1/+3
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-14add trait aliases to HIRAlex Burka-1/+3
2017-12-14incr.comp.: Do less hashing per Span.Michael Woerister-0/+2
2017-12-14Use PathBuf instead of String where applicableOliver Schneider-17/+19
2017-12-13Auto merge of #46708 - pnkfelix:fix-issue-46112, r=arielb1bors-5/+19
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-13Auto merge of #46419 - jseyfried:all_imports_in_metadata, r=nrcbors-10/+23
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-12Fix #46112: visible_parent_map construction needs a BFS over whole crate forest.Felix S. Klock II-5/+19
2017-12-13Resolve absolute paths as extern under a feature flagVadim Petrochenkov-0/+4
2017-12-12rustc_metadata: Refactor away `ExternCrateInfo`Vadim Petrochenkov-54/+26
2017-12-09Use Try syntax for Option in place of macros or matchMatt Brubeck-4/+1
2017-12-08incr.comp.: Make Span decoding more consistent so it doesn't mess up ↵Michael Woerister-13/+21
-Zincremental-verify-ich
2017-12-08incr.comp.: Hash spans unconditionally for full accuracy.Michael Woerister-3/+1
2017-12-05Add field `is_import` to `def::Export`.Jeffrey Seyfried-4/+10
2017-12-05Include non-`pub` `use` and `extern crate` items in the crate metadata for ↵Jeffrey Seyfried-10/+17
macros 2.0.
2017-12-04rustc_back: move dynamic_lib to rustc_metadata.Irina-Gabriela Popa-1/+292