about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/hir/mod.rs
AgeCommit message (Collapse)AuthorLines
2025-09-17Remove ImplSubjectCameron Steffen-8/+1
2025-08-02Return a struct with named fields from `hash_owner_nodes`Zalathar-3/+19
2025-08-02Flatten `hash_owner_nodes` with an early-returnZalathar-21/+21
2025-07-07Add `ty_span` queryOli Scherer-2/+10
2025-06-20Rollup merge of #142687 - cjgillot:less-hir_crate, r=oli-obkTrevor Gross-3/+7
Reduce uses of `hir_crate`. I tried rebasing my old incremental-HIR branch. This is a by-product, which is required if we want to get rid of `hir_crate` entirely. The second commit is a drive-by cleanup. It can be pulled into its own PR. r? ````@oli-obk````
2025-06-18Reduce uses of `hir_crate`.Camille GILLOT-3/+7
2025-06-13collect delayed lints in hir_crate_itemsJana Dönszelmann-0/+6
2025-06-12introduce new lint infraJana Dönszelmann-3/+13
lint on duplicates during attribute parsing To do this we stuff them in the diagnostic context to be emitted after hir is constructed
2025-06-05wfcheck closuresOli Scherer-0/+9
2025-04-14Remove `rustc_middle::hir::Map`.Nicholas Nethercote-5/+0
It's unused.
2025-04-11Auto merge of #139011 - Zoxc:no-rayon-iters, r=oli-obkbors-5/+5
Remove the use of Rayon iterators This removes the use of Rayon iterators and the use of the `rustc-rayon` crate. `rustc-rayon-core` is still used however. In parallel loops, instead of a Rayon iterator a serial iterator are used to collect items into a `Vec` and we use a parallel loop over its elements using the new `par_slice` function which is built on `rustc-rayon-core`'s `join`. This change makes it easier to bring `rustc-rayon-core` in-tree. Tests using 7 threads: <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th><td align="right">Physical Memory</td><td align="right">Physical Memory</td><td align="right">%</th><td align="right">Committed Memory</td><td align="right">Committed Memory</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">0.4827s</td><td align="right">0.4828s</td><td align="right"> 0.02%</td><td align="right">201.23 MiB</td><td align="right">201.31 MiB</td><td align="right"> 0.04%</td><td align="right">279.03 MiB</td><td align="right">279.46 MiB</td><td align="right"> 0.15%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.1443s</td><td align="right">0.1401s</td><td align="right">💚 -2.91%</td><td align="right">126.42 MiB</td><td align="right">126.70 MiB</td><td align="right"> 0.22%</td><td align="right">199.79 MiB</td><td align="right">199.99 MiB</td><td align="right"> 0.10%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">0.3252s</td><td align="right">0.3065s</td><td align="right">💚 -5.78%</td><td align="right">161.87 MiB</td><td align="right">161.78 MiB</td><td align="right"> -0.05%</td><td align="right">229.59 MiB</td><td align="right">230.23 MiB</td><td align="right"> 0.28%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">0.5845s</td><td align="right">0.5876s</td><td align="right"> 0.53%</td><td align="right">197.01 MiB</td><td align="right">196.89 MiB</td><td align="right"> -0.06%</td><td align="right">267.62 MiB</td><td align="right">267.47 MiB</td><td align="right"> -0.06%</td></tr><tr><td>Total</td><td align="right">1.5367s</td><td align="right">1.5169s</td><td align="right">💚 -1.29%</td><td align="right">686.53 MiB</td><td align="right">686.68 MiB</td><td align="right"> 0.02%</td><td align="right">976.04 MiB</td><td align="right">977.14 MiB</td><td align="right"> 0.11%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9796s</td><td align="right">💚 -2.04%</td><td align="right">1 byte</td><td align="right">1.00 bytes</td><td align="right"> 0.04%</td><td align="right">1 byte</td><td align="right">1.00 bytes</td><td align="right"> 0.12%</td></tr></table> <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th><td align="right">Physical Memory</td><td align="right">Physical Memory</td><td align="right">%</th><td align="right">Committed Memory</td><td align="right">Committed Memory</td><td align="right">%</th></tr><tr><td>🟠 <b>clap</b>:debug</td><td align="right">1.6371s</td><td align="right">1.6529s</td><td align="right"> 0.96%</td><td align="right">395.58 MiB</td><td align="right">396.21 MiB</td><td align="right"> 0.16%</td><td align="right">460.98 MiB</td><td align="right">461.52 MiB</td><td align="right"> 0.12%</td></tr><tr><td>🟠 <b>hyper</b>:debug</td><td align="right">0.3248s</td><td align="right">0.3210s</td><td align="right">💚 -1.16%</td><td align="right">155.16 MiB</td><td align="right">155.19 MiB</td><td align="right"> 0.02%</td><td align="right">219.21 MiB</td><td align="right">219.30 MiB</td><td align="right"> 0.04%</td></tr><tr><td>🟠 <b>regex</b>:debug</td><td align="right">1.0148s</td><td align="right">0.9929s</td><td align="right">💚 -2.16%</td><td align="right">297.96 MiB</td><td align="right">295.07 MiB</td><td align="right"> -0.97%</td><td align="right">354.53 MiB</td><td align="right">351.58 MiB</td><td align="right"> -0.83%</td></tr><tr><td>🟠 <b>syn</b>:debug</td><td align="right">1.3614s</td><td align="right">1.3717s</td><td align="right"> 0.76%</td><td align="right">319.10 MiB</td><td align="right">321.19 MiB</td><td align="right"> 0.65%</td><td align="right">378.90 MiB</td><td align="right">381.27 MiB</td><td align="right"> 0.62%</td></tr><tr><td>Total</td><td align="right">4.3381s</td><td align="right">4.3386s</td><td align="right"> 0.01%</td><td align="right">1.14 GiB</td><td align="right">1.14 GiB</td><td align="right"> -0.01%</td><td align="right">1.38 GiB</td><td align="right">1.38 GiB</td><td align="right"> 0.00%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9960s</td><td align="right"> -0.40%</td><td align="right">1 byte</td><td align="right">1.00 bytes</td><td align="right"> -0.03%</td><td align="right">1 byte</td><td align="right">1.00 bytes</td><td align="right"> -0.01%</td></tr></table>
2025-04-10Remove the use of Rayon iteratorsJohn Kåre Alsaker-5/+5
2025-04-10Rename some `name` variables as `ident`.Nicholas Nethercote-3/+3
It bugs me when variables of type `Ident` are called `name`. It leads to silly things like `name.name`. `Ident` variables should be called `ident`, and `name` should be used for variables of type `Symbol`. This commit improves things by by doing `s/name/ident/` on a bunch of `Ident` variables. Not all of them, but a decent chunk.
2025-04-02Rollup merge of #139232 - nnethercote:remove-Map-5, r=ZalatharTakayuki Maeda-3/+2
Move methods from `Map` to `TyCtxt`, part 5. This eliminates all methods on `Map`. Actually removing `Map` will occur in a follow-up PR. A follow-up to #137504. r? `@Zalathar`
2025-04-02Move methods from `Map` to `TyCtxt`, part 5.Nicholas Nethercote-3/+2
This eliminates all methods on `Map`. Actually removing `Map` will occur in a follow-up PR.
2025-04-01Decouple trait impls of different traits wrt incrementalOli Scherer-0/+2
2025-03-26Ensure define_opaque is accounted for in HIR hashMichael Goulet-1/+6
2025-03-12Move methods from `Map` to `TyCtxt`, part 4.Nicholas Nethercote-1/+1
Continuing the work from #137350. Removes the unused methods: `expect_variant`, `expect_field`, `expect_foreign_item`. Every method gains a `hir_` prefix.
2025-03-12Rename `hir_attrs` query as `hir_attr_map`.Nicholas Nethercote-1/+1
To make room for the moving of `Map::attrs` to `TyCtxt::hir_attrs` in the next commit. (It makes sense to rename the query, because it has many fewer uses than the method.)
2025-02-22Greatly simplify lifetime captures in edition 2024Michael Goulet-8/+8
2025-02-18Move methods from `Map` to `TyCtxt`, part 2.Nicholas Nethercote-1/+1
Continuing the work started in #136466. Every method gains a `hir_` prefix, though for the ones that already have a `par_` or `try_par_` prefix I added the `hir_` after that.
2025-01-10Eagerly collect mono items for non-generic closuresMichael Goulet-0/+5
2024-12-15Add hir::AttributeJonathan Dönszelmann-1/+1
2024-10-04rm `ItemKind::OpaqueTy`Noah Lev-0/+12
This introduce an additional collection of opaques on HIR, as they can no longer be listed using the free item list.
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-08-16Use FnSig instead of raw FnDecl for ForeignItemKind::FnMichael Goulet-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-2/+3
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-04Handle safety keyword for extern block inner itemsSantiago Pastorino-1/+1
2024-05-29Make `body_owned_by` return the body directly.Oli Scherer-4/+7
Almost all callers want this anyway, and now we can use it to also return fed bodies
2024-05-26Give EarlyBinder a tcx parameterMichael Goulet-1/+1
We are gonna need it to uplift EarlyBinder
2024-04-29Remove `extern crate rustc_macros` from `rustc_middle`.Nicholas Nethercote-0/+1
2024-04-04hir: Use `ItemLocalId` in a couple more placesVadim Petrochenkov-1/+1
2024-04-03hir: Drop owner's own item-local id (zero) from parenting tablesVadim Petrochenkov-2/+6
2024-03-21rename items -> free_itemsRalf Jung-5/+7
2024-03-21add some comments to hir::ModuleItemsRalf Jung-0/+6
2024-03-14Fill in HIR hash for associated opaque typesVadim Petrochenkov-0/+27
2024-03-13Create some minimal HIR for associated opaque typesVadim Petrochenkov-6/+4
2024-02-10hir: Introduce `TyCtxt::parent_hir_{id,node}`Vadim Petrochenkov-7/+8
Remove the FIXME and keep `CRATE_HIR_ID` being its own parent. This scheme turned out to be more practical than having an `Option` on closer inspection. Also make `hir_owner_parent` more readable.
2024-02-07hir: Remove `fn opt_hir_id` and `fn opt_span`Vadim Petrochenkov-5/+2
2024-02-03hir: Remove the generic type parameter from `MaybeOwned`Vadim Petrochenkov-5/+4
It's only ever used with a reference to `OwnerInfo` as an argument.
2024-01-30hir: Simplify `hir_owner_nodes` queryVadim Petrochenkov-7/+2
The query accept arbitrary DefIds, not just owner DefIds. The return can be an `Option` because if there are no nodes, then it doesn't matter whether it's due to NonOwner or Phantom. Also rename the query to `opt_hir_owner_nodes`.
2024-01-16Get rid of the hir_owner query.Camille GILLOT-28/+7
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