about summary refs log tree commit diff
path: root/compiler/rustc_incremental/src
AgeCommit message (Collapse)AuthorLines
2021-12-09Remove redundant [..]sest31-1/+1
2021-12-07Document all public items in `rustc_incremental`pierwill-13/+63
Also: - Review and edit current docs - Enforce documentation for crate Co-authored-by: r00ster <r00ster91@protonmail.com> Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
2021-11-12Add `-Zassert-incr-state` to assert state of incremental cachepierwill-1/+23
2021-11-09Remove `rustc_incremental::persist::fs::dep_graph_path_from`pierwill-4/+1
2021-10-28Revert "Add rustc lint, warning when iterating over hashmaps"Mark Rousskov-1/+0
2021-10-24Rollup merge of #89558 - lcnr:query-stable-lint, r=estebankMatthias Krüger-0/+1
Add rustc lint, warning when iterating over hashmaps r? rust-lang/wg-incr-comp
2021-10-20Merge two query callbacks arrays.Camille GILLOT-32/+29
2021-10-20Rollup merge of #87404 - rylev:artifact-size-profiling, r=wesleywiserYuki Okushi-0/+6
Add support for artifact size profiling This adds support for profiling artifact file sizes (incremental compilation artifacts and query cache to begin with). Eventually we want to track this in perf.rlo so we can ensure that file sizes do not change dramatically on each pull request. This relies on support in measureme: https://github.com/rust-lang/measureme/pull/169. Once that lands we can update this PR to not point to a git dependency. This was worked on together with `@michaelwoerister.` r? `@wesleywiser`
2021-10-16Adopt let_else across the compilerest31-8/+6
This performs a substitution of code following the pattern: let <id> = if let <pat> = ... { identity } else { ... : ! }; To simplify it to: let <pat> = ... { identity } else { ... : ! }; By adopting the let_else feature.
2021-10-15allow `potential_query_instability` everywherelcnr-0/+1
2021-10-07Add support for artifact size profilingRyan Levick-0/+6
2021-09-29Avoid more invocations of hir_crate query.Camille GILLOT-3/+2
2021-09-06Auto merge of #83214 - cjgillot:dep-map, r=michaelwoeristerbors-64/+84
Mmap the incremental data instead of reading it. Instead of reading the full incremental state using `fs::read_file`, we memmap it using a private read-only file-backed map. This allows the system to reclaim any memory we are not using, while ensuring we are not polluted by outside modifications to the file. Suggested in https://github.com/rust-lang/rust/pull/83036#issuecomment-800458082 by `@bjorn3`
2021-09-02Stop using walk_crate.Camille GILLOT-1/+1
2021-08-28Drop the query result memmap before serializing it back.Camille GILLOT-1/+15
2021-08-28Move save_in to file_format.Camille GILLOT-58/+61
2021-08-28Mmap the incremental data instead of reading it.Camille GILLOT-6/+9
2021-08-21Remove `Session.used_attrs` and move logic to `CheckAttrVisitor`Aaron Hill-24/+23
Instead of updating global state to mark attributes as used, we now explicitly emit a warning when an attribute is used in an unsupported position. As a side effect, we are to emit more detailed warning messages (instead of just a generic "unused" message). `Session.check_name` is removed, since its only purpose was to mark the attribute as used. All of the callers are modified to use `Attribute.has_name` Additionally, `AttributeType::AssumedUsed` is removed - an 'assumed used' attribute is implemented by simply not performing any checks in `CheckAttrVisitor` for a particular attribute. We no longer emit unused attribute warnings for the `#[rustc_dummy]` attribute - it's an internal attribute used for tests, so it doesn't mark sense to treat it as 'unused'. With this commit, a large source of global untracked state is removed.
2021-07-18Move OnDiskCache to rustc_query_impl.Camille GILLOT-6/+4
2021-07-06Revert "Revert "Merge CrateDisambiguator into StableCrateId""bjorn3-13/+6
This reverts commit 8176ab8bc18fdd7d3c2cf7f720c51166364c33a3.
2021-06-30Simplify DepGraph creation.Camille GILLOT-6/+9
2021-06-08Do not require the DefPathTable to construct the on-disk cache.Camille GILLOT-6/+2
2021-06-07Revert "Merge CrateDisambiguator into StableCrateId"bjorn3-6/+13
This reverts commit d0ec85d3fb6d322496cb8f4bc1c21e19f23284ad.
2021-06-02Auto merge of #85337 - cjgillot:less-anon, r=michaelwoeristerbors-0/+1
Avoid creating anonymous nodes with zero or one dependency. Anonymous nodes are only useful to encode dependencies, and cannot be replayed from one compilation session to another. As such, anonymous nodes without dependency are always green. Anonymous nodes with only one dependency are equivalent to this dependency. cc #45408 cc `@michaelwoerister`
2021-06-01Auto merge of #85331 - cjgillot:dirty-dancing, r=Aaron1011bors-100/+28
Make rustc_dirty/clean annotations exhaustive by default Fixes #45009
2021-06-01Avoid creating anonymous nodes with zero or one dependency.Camille GILLOT-0/+1
2021-05-30Merge CrateDisambiguator into StableCrateIdbjorn3-13/+6
2021-05-29Auto merge of #85698 - ehuss:incremental-session-panic, r=estebankbors-23/+43
Don't panic when failing to initialize incremental directory. This removes a panic when rustc fails to initialize the incremental directory. This can commonly happen on various filesystems that don't support locking (often various network filesystems). Panics can be confusing and scary, and there are already plenty of issues reporting this. This has been panicking since 1.22 due to I think #44502 which was a major rework of how things work. Previously, things were simpler and the [`load_dep_graph`](https://github.com/rust-lang/rust/blob/1.21.0/src/librustc_incremental/persist/load.rs#L43-L65) function would emit an error and then continue on without panicking. With 1.22, [`load_dep_graph`](https://github.com/rust-lang/rust/blob/1.22.0/src/librustc_incremental/persist/load.rs#L44) was changed so that it assumes it can load the data without errors. Today, the problem is that it calls [`prepare_session_directory`](https://github.com/rust-lang/rust/blob/fbf1b1a7193cda17008ab590e06ad28d9924023b/compiler/rustc_interface/src/passes.rs#L175-L179) and then immediately calls `garbage_collect_session_directories` which will panic since the session is `IncrCompSession::NotInitialized`. The solution here is to have `prepare_session_directory` return an error that must be handled so that compilation stops if it fails. Some other options: * Ignore directory lock failures. * Print a warning on directory lock failure, but otherwise continue with incremental enabled. * Print a warning on directory lock failure, and disable incremental. * Provide a different locking mechanism. Cargo ignores lock errors if locking is not supported, so that would be a precedent for the first option. These options would require quite a bit more changes, but I'm happy to entertain any of them, as I think they all have valid justifications. There is more discussion on the many issues where this is reported: #49773, #59224, #66513, #76251. I'm not sure if this can be considered closing any of those, though, since I think there is some value in discussing if there is a way to avoid the error altogether. But I think it would make sense to at least close all but one to consolidate them.
2021-05-28Add specific help for *how* to fix an incremental lock error.Eric Huss-0/+13
2021-05-25Don't panic when failing to initialize incremental directory.Eric Huss-23/+30
2021-05-22Get rid of PreviousDepGraph.Camille GILLOT-7/+7
2021-05-16Remove remains of rustc_dirty.Camille GILLOT-43/+18
2021-05-15Fix tests on traits.Camille GILLOT-14/+7
2021-05-15Remove `label` in dirty/clean annotations.Camille GILLOT-44/+4
2021-05-12Use () for codegen queries.Camille GILLOT-1/+1
2021-05-12Auto merge of #83610 - bjorn3:driver_cleanup, r=cjgillotbors-3/+3
rustc_driver cleanup Best reviewed one commit at a time.
2021-05-02Let load_query_result_cache take a &DefPathTablebjorn3-3/+3
This allows removing a confusing mem::replace in create_global_ctxt
2021-04-27Add [TRACKED_NO_CRATE_HASH] and [SUBSTRUCT] directivesJoshua Nelson-2/+2
This is necessary for options that should invalidate the incremental hash but *not* affect the crate hash (e.g. --remap-path-prefix). This doesn't add `for_crate_hash` to the trait directly because it's not relevant for *types*, only for *options*, which are fields on a larger struct. Instead, it adds a new `SUBSTRUCT` directive for options, which does take a `for_crate_hash` parameter. - Use TRACKED_NO_CRATE_HASH for --remap-path-prefix - Add test that `remap_path_prefix` is tracked - Reduce duplication in the test suite to avoid future churn
2021-03-30Also profile finishing the encoding.Camille GILLOT-1/+1
2021-03-30Address review.Camille GILLOT-6/+2
2021-03-30Stream the dep-graph to a file.Camille GILLOT-70/+117
2021-03-27Remove (lots of) dead codeJoshua Nelson-14/+0
Found with https://github.com/est31/warnalyzer. Dubious changes: - Is anyone else using rustc_apfloat? I feel weird completely deleting x87 support. - Maybe some of the dead code in rustc_data_structures, in case someone wants to use it in the future? - Don't change rustc_serialize I plan to scrap most of the json module in the near future (see https://github.com/rust-lang/compiler-team/issues/418) and fixing the tests needed more work than I expected. TODO: check if any of the comments on the deleted code should be kept.
2021-03-22Only enable assert_dep_graph when query-dep-graph is enabled.Camille GILLOT-0/+8
2021-03-22Auto merge of #83273 - cjgillot:endecode, r=michaelwoeristerbors-0/+1
Simplify encoder and decoder Extracted from https://github.com/rust-lang/rust/pull/83036 and https://github.com/rust-lang/rust/pull/82780.
2021-03-19Move raw bytes handling to Encoder/Decoder.Camille GILLOT-0/+1
2021-03-16ast/hir: Rename field-related structuresVadim Petrochenkov-2/+2
StructField -> FieldDef ("field definition") Field -> ExprField ("expression field", not "field expression") FieldPat -> PatField ("pattern field", not "field pattern") Also rename visiting and other methods working on them.
2021-03-09Deduplicate unchecked_attrs errors.Camille GILLOT-2/+3
2021-03-09Track HirId when visiting attributes.Camille GILLOT-1/+1
2021-03-09Remove hir::Crate::attrs.Camille GILLOT-1/+1
2021-03-09Access attrs directly from HirId in rustc_incremental::assert_dep_graph.Camille GILLOT-6/+7