about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query
AgeCommit message (Collapse)AuthorLines
2021-07-06Revert "Revert "Merge CrateDisambiguator into StableCrateId""bjorn3-4/+0
This reverts commit 8176ab8bc18fdd7d3c2cf7f720c51166364c33a3.
2021-07-05Auto merge of #86674 - Aaron1011:new-querify-limits, r=michaelwoeristerbors-0/+4
Query-ify global limit attribute handling Currently, we read various 'global limits' from inner attributes the crate root (`recursion_limit`, `move_size_limit`, `type_length_limit`, `const_eval_limit`). These limits are then stored in `Sessions`, allowing them to be access from a `TyCtxt` without registering a dependency on the crate root attributes. This PR moves the calculation of these global limits behind queries, so that we properly track dependencies on crate root attributes. During the setup of macro expansion (before we've created a `TyCtxt`), we need to access the recursion limit, which is now done by directly calling into the code shared by the normal query implementations.
2021-07-04Combine individual limit queries into single `limits` queryAaron Hill-20/+2
2021-07-04Query-ify global limit attribute handlingAaron Hill-0/+22
2021-07-04allow inference vars in type_implements_traitNiko Matsakis-1/+14
2021-07-01Rename all_crate_nums query to crates and remove useless wrapperbjorn3-1/+1
2021-06-20Make allocator_kind a query.Camille GILLOT-0/+4
2021-06-17Rollup merge of #86353 - JohnTitor:remove-projection_ty_from_predicates, ↵Yuki Okushi-4/+0
r=oli-obk Remove `projection_ty_from_predicates` Fixes #86350 r? ``@oli-obk``
2021-06-16Remove `projection_ty_from_predicates`Yuki Okushi-4/+0
2021-06-15Refactor to make interpreter and codegen backend neutral to vtable internal ↵Charles Lew-3/+3
representation.
2021-06-07Revert "Merge CrateDisambiguator into StableCrateId"bjorn3-0/+4
This reverts commit d0ec85d3fb6d322496cb8f4bc1c21e19f23284ad.
2021-06-05Update compiler/rustc_middle/src/query/mod.rsCamille Gillot-1/+0
2021-06-04Always go through the expn_that_defined query.Camille GILLOT-0/+1
2021-06-04Support forwarding caller location through trait object method callAaron Hill-0/+4
Since PR #69251, the `#[track_caller]` attribute has been supported on traits. However, it only has an effect on direct (monomorphized) method calls. Calling a `#[track_caller]` method on a trait object will *not* propagate caller location information - instead, `Location::caller()` will return the location of the method definition. This PR forwards caller location information when `#[track_caller]` is present on the method definition in the trait. This is possible because `#[track_caller]` in this position is 'inherited' by any impls of that trait, so all implementations will have the same ABI. This PR does *not* change the behavior in the case where `#[track_caller]` is present only on the impl of a trait. While all implementations of the method might have an explicit `#[track_caller]`, we cannot know this at codegen time, since other crates may have impls of the trait. Therefore, we keep the current behavior of not forwarding the caller location, ensuring that all implementations of the trait will have the correct ABI. See the modified test for examples of how this works
2021-06-02Restrict access to crate_name.Camille GILLOT-4/+0
Also remove original_crate_name, which had the exact same implementation
2021-06-02Auto merge of #85908 - cjgillot:private-dep-query, r=Aaron1011bors-0/+6
Make is_private_dep a query. Part of #85153 r? `@Aaron1011`
2021-06-01Make is_private_dep a query.Camille GILLOT-0/+6
2021-06-01Remove StableVec.Camille GILLOT-1/+1
2021-06-01Only compute the trait_map once.Camille GILLOT-1/+0
2021-06-01Revert "Reduce the amount of untracked state in TyCtxt"Camille Gillot-16/+16
2021-06-01Auto merge of #85153 - cjgillot:qresolve, r=Aaron1011bors-16/+16
Reduce the amount of untracked state in TyCtxt Access to untracked global state may generate instances of #84970. The GlobalCtxt contains the lowered HIR, the resolver outputs and interners. By wrapping the resolver inside a query, we make sure those accesses are properly tracked. As a no_hash query, all dependent queries essentially become `eval_always`, what they should have been from the beginning.
2021-05-31Auto merge of #85266 - cjgillot:hir-dep-clean, r=michaelwoeristerbors-1/+1
Remove obsolete workaround. The regression test for #62649 appears to pass even without the workaround.
2021-05-30Make is_private_dep a query.Camille GILLOT-0/+5
2021-05-30Make allocator_kind a query.Camille GILLOT-0/+3
2021-05-30Remove StableVec.Camille GILLOT-1/+1
2021-05-30Restrict access to crate_name.Camille GILLOT-4/+0
Also remove original_crate_name, which had the exact same implementation
2021-05-30Make resolutions a query.Camille GILLOT-10/+7
2021-05-30Only compute the trait_map once.Camille GILLOT-1/+0
2021-05-30Merge CrateDisambiguator into StableCrateIdbjorn3-4/+0
2021-05-28Merge fields and comment.Camille GILLOT-1/+1
2021-05-27Update compiler/rustc_middle/src/query/mod.rsNiko Matsakis-0/+1
Co-authored-by: Léo Lanteri Thauvin <leseulartichaut@gmail.com>
2021-05-26Don't hash `thir_body`LeSeulArtichaut-0/+1
2021-05-22Handle typeck errors properlyLeSeulArtichaut-1/+1
2021-05-22Make THIR building a stealable queryLeSeulArtichaut-0/+5
2021-05-17Auto merge of #85178 - cjgillot:local-crate, r=oli-obkbors-53/+38
Remove CrateNum parameter for queries that only work on local crate The pervasive `CrateNum` parameter is a remnant of the multi-crate rustc idea. Using `()` as query key in those cases avoids having to worry about the validity of the query key.
2021-05-15Auto merge of #85328 - GuillaumeGomez:rollup-exe9nbj, r=GuillaumeGomezbors-3/+2
Rollup of 12 pull requests Successful merges: - #84461 (rustdoc: Remove unnecessary `StripItem` wrapper) - #85067 (Minimize amount of fake `DefId`s used in rustdoc) - #85207 (Fix typo in comment) - #85215 (coverage bug fixes and some refactoring) - #85221 (dbg macro: Discuss use in tests, and slightly clarify) - #85246 (Miner code formatting) - #85253 (swap function order for better read flow) - #85256 (Fix display for "implementors" section) - #85268 (Use my real name) - #85278 (Improve match statements) - #85289 (Fix toggle position on mobile) - #85323 (Fix eslint errors) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-05-15Rollup merge of #85215 - richkadel:ice-fixes-minus-dead-blocks, r=tmandryGuillaume Gomez-3/+2
coverage bug fixes and some refactoring This replaces the relevant commits (2 and 3) from PR #85082, and also corrects an error querying for coverageinfo. 1. `coverageinfo` query needs to use the same MIR as codegen I ran into an error trying to fix dead block coverage and realized the `coverageinfo` query is getting a different MIR compared to the codegenned MIR, which can sometimes be a problem during mapgen. I changed that query to use the `InstandeDef` (which includes the generic parameter substitutions, prosibly specific to const params) instead of the `DefId` (without unknown/default const substitutions). 2. Simplified body_span and filtered span code Some code cleanup extracted from future (but unfinished) commit to fix coverage in attr macro functions. 3. Spanview needs the relevant body_span used for coverage The coverage body_span doesn't always match the function body_span. r? ```@tmandry```
2021-05-14add new attribute rustc_insignificant_dtor and a query to check if a type ↵Dhruv Jauhar-0/+15
has a significant drop
2021-05-13Auto merge of #83129 - LeSeulArtichaut:thir-unsafeck, r=nikomatsakisbors-0/+13
Introduce the beginning of a THIR unsafety checker This poses the foundations for the THIR unsafety checker, so that it can be implemented incrementally: - implements a rudimentary `Visitor` for the THIR (which will definitely need some tweaking in the future) - introduces a new `-Zthir-unsafeck` flag which tells the compiler to use THIR unsafeck instead of MIR unsafeck - implements detection of unsafe functions - adds revisions to the UI tests to test THIR unsafeck alongside MIR unsafeck This uses a very simple query design, where bodies are unsafety-checked on a body per body basis. This however has some big flaws: - the unsafety-checker builds the THIR itself, which means a lot of work is duplicated with MIR building constructing its own copy of the THIR - unsafety-checking closures is currently completely wrong: closures should take into account the "safety context" in which they are created, here we are considering that closures are always a safe context I had intended to fix these problems in follow-up PRs since they are always gated under the `-Zthir-unsafeck` flag (which is explicitely noted to be unsound). r? `@nikomatsakis` cc https://github.com/rust-lang/project-thir-unsafeck/issues/3 https://github.com/rust-lang/project-thir-unsafeck/issues/7
2021-05-12`coverageinfo` query needs to use the same MIR as codegenRich Kadel-3/+2
I ran into an error trying to fix dead block coverage and realized the `coverageinfo` query is getting a different MIR compared to the codegenned MIR, which can sometimes be a problem during mapgen. I changed that query to use the `InstandeDef` (which includes the generic parameter substitutions, prosibly specific to const params) instead of the `DefId` (without unknown/default const substitutions).
2021-05-12Use () for analysis.Camille GILLOT-4/+3
2021-05-12Use () for codegen queries.Camille GILLOT-10/+6
2021-05-12Use () for all_traits.Camille GILLOT-1/+1
2021-05-12Use () for visible_parent_map.Camille GILLOT-4/+2
2021-05-12Use () for lang items.Camille GILLOT-8/+6
2021-05-12Use () for privacy.Camille GILLOT-2/+2
2021-05-12Use () for typeck_item_bodies.Camille GILLOT-1/+1
2021-05-12Use () for inherent_impls.Camille GILLOT-6/+3
2021-05-12Use () for inferred_outlives_crate.Camille GILLOT-2/+1
2021-05-12Use () for crate_variances.Camille GILLOT-1/+1