about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query
AgeCommit message (Collapse)AuthorLines
2022-01-31Auto merge of #93373 - spastorino:def_id_to_hir_id_refactor, r=oli-obkbors-1/+9
Store def_id_to_hir_id as variant in hir_owner. If hir_owner is Owner(_), the LocalDefId is pointing to an owner, so the ItemLocalId is 0. If the HIR node does not exist, we store Phantom. Otherwise, we store the HirId associated to the LocalDefId. Related to #89278 r? `@oli-obk`
2022-01-30Rollup merge of #92887 - pietroalbini:pa-bootstrap-update, r=Mark-SimulacrumEric Huss-17/+4
Bootstrap compiler update r? ``@Mark-Simulacrum``
2022-01-29Make local_def_id_to_hir_id query directly returh HirIdSantiago Pastorino-1/+1
2022-01-28Make local_def_id_to_hir_id return MaybeOwner<()>Santiago Pastorino-1/+1
2022-01-28Separate hir_owner query into two queries to avoid using extensive data on ↵Santiago Pastorino-1/+9
incr comp most of the time
2022-01-28update cfg(bootstrap)sPietro Albini-17/+4
2022-01-27Store def_id_to_hir_id as variant in hir_owner.Camille GILLOT-2/+2
If hir_owner is Owner(_), the LocalDefId is pointing to an owner, so the ItemLocalId is 0. If the HIR node does not exist, we store Phantom. Otherwise, we store the HirId associated to the LocalDefId.
2022-01-25Return an indexmap in `all_local_trait_impls` querypierwill-1/+1
The data structure previously used here required Ord. As part of #90317, we do not want DefId to implement Ord.
2022-01-22Use an `indexmap` to avoid sorting `LocalDefId`spierwill-1/+1
Update `indexmap` to 1.8.0. Bless test
2022-01-15attempt to re-add `ty::Unevaluated` visitor and friendsEllen-3/+2
2022-01-15initial revertEllen-6/+3
2022-01-13Rollup merge of #92142 - wesleywiser:fix_codecoverage_partitioning, r=tmandryMatthias Krüger-10/+0
[code coverage] Fix missing dead code in modules that are never called The issue here is that the logic used to determine which CGU to put the dead function stubs in doesn't handle cases where a module is never assigned to a CGU (which is what happens when all of the code in the module is dead). The partitioning logic also caused issues in #85461 where inline functions were duplicated into multiple CGUs resulting in duplicate symbols. This commit fixes the issue by removing the complex logic used to assign dead code stubs to CGUs and replaces it with a much simpler model: we pick one CGU to hold all the dead code stubs. We pick a CGU which has exported items which increases the likelihood the linker won't throw away our dead functions and we pick the smallest to minimize the impact on compilation times for crates with very large CGUs. Fixes #91661 Fixes #86177 Fixes #85718 Fixes #79622 r? ```@tmandry``` cc ```@richkadel``` This PR is not urgent so please don't let it interrupt your holidays! 🎄 🎁
2022-01-12Auto merge of #92169 - In-line:no-cache-selector-lrc, r=Mark-Simulacrumbors-2/+1
Remove ArenaCacheSelector for visible_parent_map query ( + LRC)
2022-01-09Auto merge of #92690 - matthiaskrgr:rollup-rw0oz05, r=matthiaskrgrbors-7/+0
Rollup of 8 pull requests Successful merges: - #92055 (Add release notes for 1.58) - #92490 (Move crate drop-down to search results page) - #92510 (Don't resolve blocks in foreign functions) - #92573 (expand: Refactor InvocationCollector visitor for better code reuse) - #92608 (rustdoc: Introduce a resolver cache for sharing data between early doc link resolution and later passes) - #92657 (Implemented const casts of raw pointers) - #92671 (Make `Atomic*::from_mut` return `&mut Atomic*`) - #92673 (Remove useless collapse toggle on "all items" page) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-01-09Rollup merge of #92608 - petrochenkov:doctrscope3, r=CraftSpiderMatthias Krüger-7/+0
rustdoc: Introduce a resolver cache for sharing data between early doc link resolution and later passes The refactoring parts of https://github.com/rust-lang/rust/pull/88679, shouldn't cause any slowdowns. r? `@jyn514`
2022-01-09rustc_middle: Rename `Export` to `ModChild` and add some commentsVadim Petrochenkov-4/+4
Also rename `module_exports`/`export_map` to `module_reexports`/`reexport_map` for clarity.
2022-01-09rustc_metadata: Rename `item_children(_untracked)` to ↵Vadim Petrochenkov-1/+1
`module_children(_untracked)` And `each_child_of_item` to `for_each_module_child`
2022-01-07Add query to avoid name comparison in `leaf_def`Matthew Jasper-0/+26
2022-01-07rustdoc: Introduce a resolver cache for sharing data between early doc link ↵Vadim Petrochenkov-7/+0
resolution and later passes
2022-01-06rustc_middle: Add a method for getting a `SimplifiedType` definition/IDVadim Petrochenkov-4/+2
Import `SimplifiedType` more
2022-01-01Stabilize -Z instrument-coverage as -C instrument-coverageJosh Triplett-1/+1
Continue supporting -Z instrument-coverage for compatibility for now, but show a deprecation warning for it. Update uses and documentation to use the -C option. Move the documentation from the unstable book to stable rustc documentation.
2021-12-28rustc_metadata: Encode list of all crate's traits into metadataVadim Petrochenkov-5/+5
2021-12-21Remove ArenaCacheSelector for visible_parent_map query.Alik Aslanyan-2/+1
Optimize visible_parent_map to use LRC to prevent unnecessary cloning
2021-12-20[code coverage] Fix missing dead code in modules that are never calledWesley Wiser-10/+0
The issue here is that the logic used to determine which CGU to put the dead function stubs in doesn't handle cases where a module is never assigned to a CGU. The partitioning logic also caused issues in #85461 where inline functions were duplicated into multiple CGUs resulting in duplicate symbols. This commit fixes the issue by removing the complex logic used to assign dead code stubs to CGUs and replaces it with a much simplier model: we pick one CGU to hold all the dead code stubs. We pick a CGU which has exported items which increases the likelihood the linker won't throw away our dead functions and we pick the smallest to minimize the impact on compilation times for crates with very large CGUs. Fixes #86177 Fixes #85718 Fixes #79622
2021-12-20Auto merge of #91924 - Aaron1011:serialize-adt-def, r=michaelwoeristerbors-0/+1
Fully serialize AdtDef This avoids needing to invoke the `adt_def` query during the decoding of another query's result. Split out from https://github.com/rust-lang/rust/pull/91919 See https://github.com/rust-lang/rust/issues/91696#issuecomment-993043710
2021-12-17Add a temporary hack before env fix lands in bootstrapDeadbeef-4/+17
2021-12-16Only cache local adt_def results on diskAaron Hill-1/+1
An `AdtDef` contains `Span`s, and we don't appear to actually encode the `SourceFile` for foreign spans in the incremental cache in some cases.
2021-12-15Cache adt_def query result on diskAaron Hill-0/+1
2021-12-13get rid of normalize_generic_arg... queriesb-naber-21/+0
2021-12-12Remap more env constness for queriesDeadbeef-0/+11
2021-12-12Query modifierDeadbeef-0/+20
2021-12-01address reviewb-naber-0/+5
2021-12-01fix query descriptionb-naber-2/+2
2021-12-01implement version of normalize_erasing_regions that doesn't assume value is ↵b-naber-0/+14
normalizable
2021-11-28Remove eval_always for lib_features.Camille GILLOT-2/+1
2021-11-25Auto merge of #90580 - cjgillot:no-ee-upvar, r=Aaron1011bors-1/+0
Remove eval_always from upvars. Split off https://github.com/rust-lang/rust/pull/86056 r? `@ghost`
2021-11-24Auto merge of #90579 - cjgillot:no-ee-ii, r=Aaron1011bors-5/+1
Remove eval_always for inherent_impls. Split off https://github.com/rust-lang/rust/pull/86056 r? `@ghost`
2021-11-10no overlap errors after failing the orphan checklcnr-5/+8
2021-11-07Rename functions reflect that inline const is also "typeck_child"Gary Guo-1/+1
2021-11-07Implement type inference for inline constsGary Guo-1/+1
In most cases it is handled in the same way as closures.
2021-11-04Remove eval_always from upvars.Camille GILLOT-1/+0
2021-11-04Remove eval_always for inherent_impls.Camille GILLOT-5/+1
2021-10-29Add a few query descriptionsWesley Wiser-1/+8
2021-10-25Avoid a branch on key being local for queries that use the same local and ↵bjorn3-4/+82
extern providers
2021-10-21Do not depend on the stored value when trying to cache on disk.Camille GILLOT-4/+1
2021-10-18Auto merge of #89124 - cjgillot:owner-info, r=michaelwoeristerbors-21/+2
Index and hash HIR as part of lowering Part of https://github.com/rust-lang/rust/pull/88186 ~Based on https://github.com/rust-lang/rust/pull/88880 (see merge commit).~ Once HIR is lowered, it is later indexed by the `index_hir` query and hashed for `crate_hash`. This PR moves those post-processing steps to lowering itself. As a side objective, the HIR crate data structure is refactored as an `IndexVec<LocalDefId, Option<OwnerInfo<'hir>>>` where `OwnerInfo` stores all the relevant information for an HIR owner. r? `@michaelwoerister` cc `@petrochenkov`
2021-10-17Auto merge of #89514 - davidtwco:polymorphize-shims-and-predicates, r=lcnrbors-3/+3
polymorphization: shims and predicates Supersedes #75737 and #75414. This pull request includes up some changes to polymorphization which hadn't landed previously and gets stage2 bootstrapping and the test suite passing when polymorphization is enabled. There are still issues with `type_id` and polymorphization to investigate but this should get polymorphization in a reasonable state to work on. - #75737 and #75414 both worked but were blocked on having the rest of the test suite pass (with polymorphization enabled) with and without the PRs. It makes more sense to just land these so that the changes are in. - #75737's changes remove the restriction of `InstanceDef::Item` on polymorphization, so that shims can now be polymorphized. This won't have much of an effect until polymorphization's analysis is more advanced, but it doesn't hurt. - #75414's changes remove all logic which marks parameters as used based on their presence in predicates - given #75675, this will enable more polymorphization and avoid the symbol clashes that predicate logic previously sidestepped. - Polymorphization now explicitly checks (and skips) foreign items, this is necessary for stage2 bootstrapping to work when polymorphization is enabled. - The conditional determining the emission of a note adding context to a post-monomorphization error has been modified. Polymorphization results in `optimized_mir` running for shims during collection where that wouldn't happen previously, some errors are emitted during `optimized_mir` and these were considered post-monomorphization errors with the existing logic (more errors and shims have a `DefId` coming from the std crate, not the local crate), adding a note that resulted in tests failing. It isn't particularly feasible to change where polymorphization runs or prevent it from using `optimized_mir`, so it seemed more reasonable to not change the conditional. - `characteristic_def_id_of_type` was being invoked during partitioning for self types of impl blocks which had projections that depended on the value of unused generic parameters of a function - this caused a ICE in a debuginfo test. If partitioning is enabled and the instance needs substitution then this is skipped. That test still fails for me locally, but not with an ICE, but it fails in a fresh checkout too, so 🤷‍♂️. r? `@lcnr`
2021-10-10Compute full HIR hash during lowering.Camille GILLOT-1/+0
2021-10-10Directly use AttributeMap inside OwnerInfo.Camille GILLOT-1/+1
2021-10-09Perform indexing during lowering.Camille GILLOT-8/+1
Do not access DefId<->HirId maps before they are initialized.