about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/hir/mod.rs
AgeCommit message (Collapse)AuthorLines
2023-12-12Move some methods from `tcx.hir()` to `tcx`zetanumbers-1/+1
Renamings: - find -> opt_hir_node - get -> hir_node - find_by_def_id -> opt_hir_node_by_def_id - get_by_def_id -> hir_node_by_def_id Fix rebase changes using removed methods Use `tcx.hir_node_by_def_id()` whenever possible in compiler Fix clippy errors Fix compiler Apply suggestions from code review Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> Add FIXME for `tcx.hir()` returned type about its removal Simplify with with `tcx.hir_node_by_def_id`
2023-11-28resolve: Feed the `def_kind` query immediately on `DefId` creationVadim Petrochenkov-1/+0
2023-11-26rustc: `hir().local_def_id_to_hir_id()` -> `tcx.local_def_id_to_hir_id()` ↵Vadim Petrochenkov-4/+4
cleanup
2023-11-25rustc: Make `def_kind` mandatory for all `DefId`sVadim Petrochenkov-1/+1
2023-10-20Avoid a `track_errors` by bubbling up most errors from `check_well_formed`Oli Scherer-10/+22
2023-08-19remove redundant var rebindingsMatthias Krüger-5/+2
2023-08-14Use `{Local}ModDefId` in many queriesNilstrieb-5/+5
2023-08-05parent_module_from_def_id does not need to be a query.Camille GILLOT-5/+15
2023-05-24Use `Option::is_some_and` and `Result::is_ok_and` in the compilerMaybe Waffle-1/+1
2023-05-17Retire is_foreign_item query.Camille GILLOT-0/+7
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-1/+1
2023-05-06introduce `DynSend` and `DynSync` auto traitSparrowLii-5/+5
2023-04-13make impl_subject more readableKyle Matsuda-6/+4
2023-04-13make tcx.impl_subject return EarlyBinder, remove bound_impl_subject, rename ↵Kyle Matsuda-6/+8
usages of bound_impl_subject to impl_subject
2023-03-21Use local key in providersMichael Goulet-8/+6
2023-03-13Don't opt_rpitit_info as a separate queryMichael Goulet-1/+0
2023-03-08Only compute the crate hash when necessary.Nicholas Nethercote-5/+5
The crate hash is needed: - if debug assertions are enabled, or - if incr. comp. is enabled, or - if metadata is being generated, or - if `-C instrumentation-coverage` is enabled. This commit avoids computing the crate hash when these conditions are all false, such as when doing a release build of a binary crate. It uses `Option` to store the hashes when needed, rather than computing them on demand, because some of them are needed in multiple places and computing them on demand would make compilation slower. The commit also removes `Owner::hash_without_bodies`. There is no benefit to pre-computing that one, it can just be done in the normal fashion.
2023-03-02rustc_middle: Remove trait `DefIdTree`Vadim Petrochenkov-1/+1
This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-03-01Add opt_rpitit_info querySantiago Pastorino-0/+1
2023-02-26Simplify diagnostic_items.Camille GILLOT-5/+9
2023-02-17Make encode_attrs use opt_local_def_id_to_hir_id so we can feed it with None ↵Santiago Pastorino-3/+3
for definitions that have no HIR
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-1/+1
in metadata
2023-02-16change usages of type_of to bound_type_ofKyle Matsuda-1/+1
2023-01-17Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726Matthias Krüger-1/+1
Remove double spaces after dots in comments Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-1/+1
2023-01-14change impl_trait_ref query to return EarlyBinder; remove ↵Kyle Matsuda-1/+1
bound_impl_trait_ref query; add EarlyBinder to impl_trait_ref in metadata
2023-01-14change usages of impl_trait_ref to bound_impl_trait_refKyle Matsuda-1/+2
2022-12-27Provide local extern function arg namesMichael Goulet-1/+5
2022-12-09Move the untracked cstore and source_span into a structOli Scherer-2/+0
2022-11-26Verify that HIR parenting and Def parenting match.Camille GILLOT-7/+2
2022-10-29Rename some `OwnerId` fields.Nicholas Nethercote-4/+4
spastorino noticed some silly expressions like `item_id.def_id.def_id`. This commit renames several `def_id: OwnerId` fields as `owner_id`, so those expressions become `item_id.owner_id.def_id`. `item_id.owner_id.local_def_id` would be even clearer, but the use of `def_id` for values of type `LocalDefId` is *very* widespread, so I left that alone.
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-16/+20
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-07-29Rename local_did to def_idMiguel Guarniz-3/+3
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29Change maybe_body_owned_by to take local def idMiguel Guarniz-2/+3
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-15Auto merge of #98203 - kckeiks:gather-body-owners-in-hir-item-queries, ↵bors-0/+1
r=cjgillot gather body owners Issue #96341
2022-07-07Auto merge of #95573 - cjgillot:lower-query, r=michaelwoeristerbors-1/+0
Make lowering a query Split from https://github.com/rust-lang/rust/pull/88186. This PR refactors the relationship between lowering and the resolver outputs in order to make lowering itself a query. In a first part, lowering is changed to avoid modifying resolver outputs, by maintaining its own data structures for creating new `NodeId`s and so. Then, the `TyCtxt` is modified to allow creating new `LocalDefId`s from inside it. This is done by: - enclosing `Definitions` in a lock, so as to allow modification; - creating a query `register_def` whose purpose is to declare a `LocalDefId` to the query system. See `TyCtxt::create_def` and `TyCtxt::iter_local_def_id` for more detailed explanations of the design.
2022-07-06gather body ownersMiguel Guarniz-0/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-06Make AST lowering a query.Camille GILLOT-1/+0
2022-06-28Do not fetch HIR to compute variances.Camille GILLOT-0/+9
2022-06-22Fix parallel compiler.Camille GILLOT-0/+17
2022-06-14Separate `source_span` and `expn_that_defined` from `Definitions`.Camille GILLOT-3/+4
2022-06-14Separate Definitions and CrateStore from ResolverOutputs.Camille GILLOT-10/+7
2022-06-10Call def_span inside span_if_local.Camille GILLOT-1/+5
2022-06-10Implement def_ident_span in rustc_middle.Camille GILLOT-0/+5
2022-05-13Cache more queries on disk.Camille GILLOT-1/+1
2022-04-09use copied() and avoid creating a vector in items and par_itemsMiguel Guarniz-8/+11
2022-04-08remove some uses of visit_all_item_likes in incremental, metadata and ↵Miguel Guarniz-0/+15
interface crates Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-04-08Refactor HIR item-like traversal (part 1)Miguel Guarniz-0/+1
- Create hir_crate_items query which traverses tcx.hir_crate(()).owners to return a hir::ModuleItems - use tcx.hir_crate_items in tcx.hir().items() to return an iterator of hir::ItemId - add par_items(impl Fn(hir::ItemId)) to traverse all items in parallel Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-03-22impl_header -> impl_subjectSantiago Pastorino-1/+1
2022-03-20Extract ImplSubject informationSantiago Pastorino-2/+8