about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/hir/map
AgeCommit message (Collapse)AuthorLines
2022-12-20Some hir cleanupsOli Scherer-2/+2
2022-12-09Move the untracked cstore and source_span into a structOli Scherer-2/+2
2022-12-03Rollup merge of #104199 - SarthakSingh31:issue-97417-1, r=cjgillotMatthias Krüger-1/+1
Keep track of the start of the argument block of a closure This removes a call to `tcx.sess.source_map()` from [compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs](https://github.com/rust-lang/rust/compare/master...SarthakSingh31:issue-97417-1?expand=1#diff-8406bbc0d0b43d84c91b1933305df896ecdba0d1f9269e6744f13d87a2ab268a) as required by #97417. VsCode automatically applied `rustfmt` to the files I edited under `src/tools`. I can undo that if its a problem. r? `@cjgillot`
2022-11-28Keep track of the start of the argument block of a closureSarthak Singh-1/+1
2022-11-23Separate lifetime ident from resolution in HIR.Camille GILLOT-1/+1
2022-11-21Unreserve braced enum variants in value namespaceVadim Petrochenkov-4/+4
2022-11-13Do not use `local_def_id` in `node_to_string`.Camille GILLOT-30/+24
2022-11-13Store a LocalDefId in hir::AnonConst.Camille GILLOT-1/+1
2022-11-13Store a LocalDefId in hir::GenericParam.Camille GILLOT-2/+2
2022-11-13Store LocalDefId in hir::Closure.Camille GILLOT-2/+2
2022-11-11Tweak signatures in rustc_middle::hir::map.Camille GILLOT-2/+9
2022-10-29Rename some `OwnerId` fields.Nicholas Nethercote-8/+8
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-10-09ImplItemKind::TyAlias => ImplItemKind::TypeMichael Goulet-2/+2
2022-10-02Rollup merge of #102538 - cjgillot:def-span-ctxt, r=fee1-deadDylan DPC-6/+26
Give `def_span` the same SyntaxContext as `span_with_body`. https://github.com/rust-lang/rust/issues/102217 I'm not sure how to add a test, since the erroneous span was crafted using a proc macro. The debug assertion in `def_span` will ensure we have the correct behaviour.
2022-10-01Do not fetch HIR node when iterating to find lint.Camille GILLOT-8/+12
2022-10-01Give `def_span` the same SyntaxContext as `span_with_body`.Camille GILLOT-6/+26
2022-09-30create def ids for impl traits during ast loweringSantiago Pastorino-2/+2
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-28/+31
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-09-22Revert "Auto merge of #101862 - cjgillot:lint-regression, r=oli-obk"Camille GILLOT-12/+8
This reverts commit bc7b17cfe3bf08b618d1c7b64838053faeb1f590, reversing changes made to 5253b0a0a1f366fad0ebed57597fcf2703b9e893.
2022-09-15Do not fetch HIR node when iterating to find lint.Camille GILLOT-8/+12
2022-09-12Auto merge of #101688 - cjgillot:verify-hir-parent, r=petrochenkovbors-0/+2
Assert that HIR nodes are not their own parent. Fixes https://github.com/rust-lang/rust/issues/101505. Replaces #101513 r? `@petrochenkov` `@nnethercote`
2022-09-11Assert that HIR nodes are not their own parent.Camille GILLOT-0/+2
2022-09-09Handle generic parameters.Camille GILLOT-4/+14
2022-09-09RPITIT placeholder itemsMichael Goulet-0/+2
2022-08-31Use parent_iter instead of a find_parent_node loopEric Holk-0/+3
2022-08-29Rollup merge of #99821 - cjgillot:ast-lifetimes-2, r=compiler-errorsDylan DPC-2/+6
Remove separate indexing of early-bound regions ~Based on https://github.com/rust-lang/rust/pull/99728.~ This PR copies some modifications from https://github.com/rust-lang/rust/pull/97839 around object lifetime defaults. These modifications allow to stop counting generic parameters during lifetime resolution, and rely on the indexing given by `rustc_typeck::collect`.
2022-08-27Rollup merge of #101057 - cjgillot:one-fn-sig, r=compiler-errorsYuki Okushi-24/+2
Merge implementations of HIR fn_decl and fn_sig.
2022-08-26Merge implementations of HIR fn_decl and fn_sig.Camille GILLOT-24/+2
2022-08-22Auto merge of #99963 - cjgillot:iter-submodule, r=compiler-errorsbors-19/+13
Simplify implementation for par_for_each_module
2022-08-11Check attributes on struct expression fields.Eric Huss-0/+3
Attributes on struct expression fields were not being checked for validity. This adds the fields as HIR nodes so that `CheckAttrVisitor` can visit those nodes to check their attributes.
2022-08-11Check attributes on pattern fields.Eric Huss-0/+3
Attributes on pattern struct fields were not being checked for validity. This adds the fields as HIR nodes so that the `CheckAttrVisitor` can visit those nodes to check their attributes.
2022-08-03Create a specific `ObjectLifetimeDefault` enum.Camille GILLOT-2/+6
2022-07-30Inline a few short methods.Camille GILLOT-0/+9
2022-07-30Simplify implementation for par_for_each_module.Camille GILLOT-19/+4
2022-07-29Change enclosing_body_owner to return LocalDefIdMiguel Guarniz-4/+4
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29Change maybe_body_owned_by to take local def idMiguel Guarniz-7/+8
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-19use `par_for_each_in` in `par_body_owners` and `collect_crate_mono_items`SparrowLii-3/+1
2022-07-15Auto merge of #98203 - kckeiks:gather-body-owners-in-hir-item-queries, ↵bors-113/+104
r=cjgillot gather body owners Issue #96341
2022-07-14Auto merge of #99231 - Dylan-DPC:rollup-0tl8c0o, r=Dylan-DPCbors-5/+7
Rollup of 5 pull requests Successful merges: - #97720 (Always create elided lifetime parameters for functions) - #98315 (Stabilize `core::ffi:c_*` and rexport in `std::ffi`) - #98705 (Implement `for<>` lifetime binder for closures) - #99126 (remove allow(rustc::potential_query_instability) in rustc_span) - #99139 (Give a better error when `x dist` fails for an optional tool) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-1/+1
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-13collect module item-likes in visit_itemsMiguel Guarniz-7/+10
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-13merge visitors in queriesMiguel Guarniz-135/+75
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-13inline associated_bodyMiguel Guarniz-20/+5
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-13use gathered body_owners in par_body_ownersMiguel Guarniz-13/+2
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-12Add an indirection for closures in `hir::ExprKind`Maybe Waffle-5/+7
This helps bring `hir::Expr` size down, `Closure` was the biggest variant, especially after `for<>` additions.
2022-07-08Auto merge of #98482 - cjgillot:short-struct-span-closure, r=estebankbors-0/+1
Shorten def_span of closures to just their header Continuation of https://github.com/rust-lang/rust/pull/93967.
2022-07-07Auto merge of #99024 - matthiaskrgr:rollup-8ygpcpg, r=matthiaskrgrbors-29/+37
Rollup of 9 pull requests Successful merges: - #97917 (Implement ExitCodeExt for Windows) - #98844 (Reword comments and rename HIR visiting methods.) - #98979 (interpret: use AllocRange in UninitByteAccess) - #98986 (Fix missing word in comment) - #98994 (replace process exit with more detailed exit in src/bootstrap/*.rs) - #98995 (Add a test for #80471) - #99002 (suggest adding a derive for #[default] applied to variants) - #99004 (Add a test for #70408) - #99017 (Replace boolean argument for print_where_clause with an enum to make code more clear) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-07Auto merge of #95573 - cjgillot:lower-query, r=michaelwoeristerbors-34/+28
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-07Reword comments and rename HIR visiting methods.Camille GILLOT-29/+37
2022-07-07Shorten span for closures.Camille GILLOT-0/+1