summary refs log tree commit diff
path: root/compiler/rustc_middle/src/hir/map
AgeCommit message (Collapse)AuthorLines
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
2022-07-06record LocalDefId of closureMiguel Guarniz-8/+4
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-06gather body ownersMiguel Guarniz-16/+94
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-06Allow to create definitions inside the query system.Camille GILLOT-34/+28
2022-07-06Rollup merge of #98519 - TaKO8Ki:add-head-span-field-to-item-and-impl-item, ↵Guillaume Gomez-1/+2
r=cjgillot Replace some `guess_head_span` with `def_span` This patch fixes a part of #97417. r? `@cjgillot`
2022-07-06use `named_span` in case of tuple variantTakayuki Maeda-6/+1
2022-07-06add `Node::Variant` to `Map::opt_span`Takayuki Maeda-1/+7
2022-07-06Rollup merge of #98881 - cjgillot:q-def-kind, r=fee1-deadDylan DPC-1/+2
Only compute DefKind through the query.
2022-07-06Fix double spacefee1-dead-1/+1
2022-07-04Only compute DefKind through the query.Camille GILLOT-1/+2
2022-07-02Rollup merge of #98639 - camsteffen:no-node-binding, r=compiler-errorsDylan DPC-4/+1
Factor out `hir::Node::Binding`
2022-07-01Shorten def_span for more items.Camille GILLOT-30/+90
2022-07-01Factor out hir::Node::BindingCameron Steffen-4/+1
2022-06-21Only keep a single well-formed query.Camille GILLOT-17/+4
2022-06-18Auto merge of #98153 - nnethercote:fix-MissingDoc-quadratic-behaviour, ↵bors-4/+3
r=cjgillot Fix `MissingDoc` quadratic behaviour Best reviewed one commit at a time. r? `@cjgillot`
2022-06-17Auto merge of #98106 - cjgillot:split-definitions, r=michaelwoeristerbors-8/+9
Split up `Definitions` and `ResolverAstLowering`. Split off https://github.com/rust-lang/rust/pull/95573 r? `@michaelwoerister`
2022-06-16Remove unused `hir_id` arg from `visit_attribute`.Nicholas Nethercote-4/+3
2022-06-15Rollup merge of #98110 - cjgillot:closure-brace, r=Aaron1011Yuki Okushi-5/+5
Make `ExprKind::Closure` a struct variant. Simple refactor since we both need it to introduce additional fields in `ExprKind::Closure`. r? ``@Aaron1011``
2022-06-14Separate `source_span` and `expn_that_defined` from `Definitions`.Camille GILLOT-2/+3
2022-06-14Separate Definitions and CrateStore from ResolverOutputs.Camille GILLOT-6/+6
2022-06-12Make `ExprKind::Closure` a struct variant.Camille GILLOT-5/+5
2022-06-11Auto merge of #95880 - cjgillot:def-ident-span, r=petrochenkovbors-18/+24
Handle `def_ident_span` like `def_span`. `def_ident_span` had an ad-hoc status in the compiler. This PR refactors it to be a first-class citizen like `def_span`: - it gets encoded in the main metadata loop, instead of the visitor; - its implementation is updated to mirror the one of `def_span`. We do not remove the `Option` in the return type, since some items do not have an ident, AnonConsts for instance.
2022-06-10Introduce opt_ident.Camille GILLOT-13/+12
2022-06-10Call def_span inside span_if_local.Camille GILLOT-1/+1
2022-06-10Implement def_ident_span in rustc_middle.Camille GILLOT-17/+24
2022-06-04Compute lifetimes in scope at diagnostic time.Camille GILLOT-1/+5
2022-06-03Make hir().get_generics and generics_of consistent.Camille GILLOT-21/+1
2022-06-03Auto merge of #97694 - Dylan-DPC:rollup-2yxo7ce, r=Dylan-DPCbors-1/+5
Rollup of 3 pull requests Successful merges: - #97415 (Compute `is_late_bound_map` query separately from lifetime resolution) - #97471 (Provide more context when denying invalid type params ) - #97681 (Add more eslint checks) Failed merges: - #97446 (Make hir().get_generics and generics_of consistent.) r? `@ghost` `@rustbot` modify labels: rollup
2022-06-03Compute `is_late_bound` in a separate query.Camille GILLOT-1/+5
The computation is actually much simpler, and can be done by directly fetching the HIR for the `FnDecl` and its generics.
2022-06-02add new `emit_inference_failure_err`lcnr-1/+5
2022-05-30Add a helper function for checking whether a default function in a trait can ↵Oli Scherer-1/+1
be treated as `const`
2022-05-30Remove `#[default..]` and add `#[const_trait]`Deadbeef-3/+1
2022-05-13change for_each_module's parameter to FnMutMiguel Guarniz-1/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13rename visit item-like methodsMiguel Guarniz-8/+11
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13remove ItemLikeVisitor and DeepVisitorMiguel Guarniz-3/+2
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>