about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/query
AgeCommit message (Collapse)AuthorLines
2020-12-04Properly re-use def path hash in incremental modeAaron Hill-1/+1
Fixes #79661 In incremental compilation mode, we update a `DefPathHash -> DefId` mapping every time we create a `DepNode` for a foreign `DefId`. This mapping is written out to the on-disk incremental cache, and is read by the next compilation session to allow us to lazily decode `DefId`s. When we decode a `DepNode` from the current incremental cache, we need to ensure that any previously-recorded `DefPathHash -> DefId` mapping gets recorded in the new mapping that we write out. However, PR #74967 didn't do this in all cases, leading to us being unable to decode a `DefPathHash` in certain circumstances. This PR refactors some of the code around `DepNode` deserialization to prevent this kind of mistake from happening again.
2020-12-03Auto merge of #79637 - spastorino:revert-trait-inheritance-self, ↵bors-23/+1
r=Mark-Simulacrum Revert "Auto merge of #79209 r? `@nikomatsakis` This has caused some issues (#79560) so better to revert and try to come up with a proper fix without rush.
2020-12-02Revert "Auto merge of #79209 - spastorino:trait-inheritance-self, ↵Santiago Pastorino-23/+1
r=nikomatsakis" This reverts commit 349b3b324dade7ca638091db93ba08bbc443c63d, reversing changes made to b776d1c3e3db8befabb123ebb1e46c3531eaed46.
2020-12-01Auto merge of #74967 - Aaron1011:feature/incr-def-path-table, r=pnkfelixbors-7/+172
Implement lazy decoding of DefPathTable during incremental compilation PR https://github.com/rust-lang/rust/pull/75813 implemented lazy decoding of the `DefPathTable` from crate metadata. However, it requires decoding the entire `DefPathTable` when incremental compilation is active, so that we can map a decoded `DefPathHash` to a `DefId` from an arbitrary crate. This PR adds support for lazy decoding of dependency `DefPathTable`s when incremental compilation si active. When we load the incremental cache and dep graph, we need the ability to map a `DefPathHash` to a `DefId` in the current compilation session (if the corresponding definition still exists). This is accomplished by storing the old `DefId` (that is, the `DefId` from the previous compilation session) for each `DefPathHash` we need to remap. Since a `DefPathHash` includes the owning crate, the old crate is guaranteed to be the right one (if the definition still exists). We then use the old `DefIndex` as an initial guess, which we validate by comparing the expected and actual `DefPathHash`es. In most cases, foreign crates will be completely unchanged, which means that we our guess will be correct. If our guess is wrong, we fall back to decoding the entire `DefPathTable` for the foreign crate. This still represents an improvement over the status quo, since we can skip decoding the entire `DefPathTable` for other crates (where all of our guesses were correct).
2020-11-27Allow to self reference associated types in where clausesSantiago Pastorino-0/+11
2020-11-27Allow to use super trait bounds in where clausesSantiago Pastorino-1/+12
2020-11-25Fix rebase falloutAaron Hill-1/+7
2020-11-25Only populate local_def_path_hash_to_def_id when neededAaron Hill-3/+6
2020-11-25Lazy DefPath decoding for incremental compilationAaron Hill-8/+164
2020-11-25Fix typosDániel Buga-2/+2
2020-11-19Only create `OnDiskCache` in incremental compilation modeAaron Hill-3/+4
This lets us skip doing useless work when we're not in incremental compilation mode.
2020-11-14Move Steal to rustc_data_structures.Camille GILLOT-1/+1
2020-10-22Retire rustc_dep_node_try_load_from_on_disk_cache.Camille GILLOT-1/+23
2020-10-22Retire rustc_dep_node_force.Camille GILLOT-13/+36
2020-10-22Unify query name and node name.Camille GILLOT-3/+3
2020-10-22Remove unused category from macros.Camille GILLOT-16/+6
2020-10-22Remove unused ProfileCategory.Camille GILLOT-3/+0
2020-10-22Auto merge of #77871 - Julian-Wollersberger:less-query-context, r=oli-obkbors-18/+21
Make fewer types generic over QueryContext While trying to refactor `rustc_query_system::query::QueryContext` to make it dyn-safe, I noticed some smaller things: * QueryConfig doesn't need to be generic over QueryContext * ~~The `kind` field on QueryJobId is unused~~ * Some unnecessary where clauses * Many types in `job.rs` where generic over `QueryContext` but only needed `QueryContext::Query`. If handle_cycle_error() could be refactored to not take `error: CycleError<CTX::Query>`, all those bounds could be removed as well. Changing `find_cycle_in_stack()` in job.rs to not take a `tcx` argument is the only functional change here. Everything else is just updating type signatures. (aka compile-error driven development ^^) ~~Currently there is a weird bug where memory usage suddenly skyrockets when running UI tests. I'll investigate that tomorrow. A perf run probably won't make sense before that is fixed.~~ EDIT: `kind` actually is used by `Eq`, and re-adding it fixed the memory issue.
2020-10-19Remove <CTX: QueryContext> in a bunch of places.Julian Wollersberger-15/+18
It was only needed by `find_cycle_in_stack()` in job.rs, but needed to be forwarded through dozens of types.
2020-10-16Rollup merge of #77493 - ↵Dylan DPC-3/+10
hosseind88:ICEs_should_always_print_the_top_of_the_query_stack, r=oli-obk ICEs should always print the top of the query stack see #76920
2020-10-14Remove unused code from rustc_middleest31-23/+0
2020-10-13Replace absolute paths with relative onesest31-2/+2
Modern compilers allow reaching external crates like std or core via relative paths in modules outside of lib.rs and main.rs.
2020-10-12Remove generic argument from `QueryConfig`.Julian Wollersberger-3/+3
2020-10-09change condition for end of query stack messagehosseind88-4/+4
2020-10-09fix show we're just showing... message instead of the end of query stack ↵hosseind75-3/+0
message when RUST_BACKTRACE=0
2020-10-09show a message when we are showing limited slice of query stackhosseind75-0/+3
2020-10-09change approach and run ui testshosseind75-5/+1
2020-10-09run full query stack print just when RUST_BACKTRACE is sethosseind75-1/+5
2020-10-09ICEs should print the top of the query stackhosseind75-13/+1
2020-10-09rebase with masterhosseind75-0/+8
2020-10-09fix show we're just showing... message instead of the end of query stack ↵hosseind75-1/+5
message when RUST_BACKTRACE=0
2020-10-09run full query stack print just when RUST_BACKTRACE is sethosseind75-3/+7
2020-10-09ICEs should print the top of the query stackhosseind75-1/+4
2020-09-25Address review commentmarmeladema-4/+6
2020-09-25Fix profiling query key creationmarmeladema-19/+12
2020-09-25Rename `DefPathData::get_name()` to `DefPathData::name()`marmeladema-1/+1
2020-09-25Move from {{closure}}#0 syntax to {closure#0} for (def) path componentsmarmeladema-11/+19
2020-09-19Unify the names of const eval queries and their return typesOliver Scherer-1/+1
2020-09-18support const_evaluatable_checked across crate boundariesBastian Kauschke-0/+6
2020-09-18use abstract consts when unifying ConstKind::UnevaluatedBastian Kauschke-0/+16
2020-08-30mv compiler to compiler/mark-0/+2695