about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/hir/map
AgeCommit message (Collapse)AuthorLines
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>
2022-05-13add module_itemsMiguel Guarniz-0/+4
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-07Auto merge of #96094 - Elliot-Roberts:fix_doctests, r=compiler-errorsbors-1/+1
Begin fixing all the broken doctests in `compiler/` Begins to fix #95994. All of them pass now but 24 of them I've marked with `ignore HELP (<explanation>)` (asking for help) as I'm unsure how to get them to work / if we should leave them as they are. There are also a few that I marked `ignore` that could maybe be made to work but seem less important. Each `ignore` has a rough "reason" for ignoring after it parentheses, with - `(pseudo-rust)` meaning "mostly rust-like but contains foreign syntax" - `(illustrative)` a somewhat catchall for either a fragment of rust that doesn't stand on its own (like a lone type), or abbreviated rust with ellipses and undeclared types that would get too cluttered if made compile-worthy. - `(not-rust)` stuff that isn't rust but benefits from the syntax highlighting, like MIR. - `(internal)` uses `rustc_*` code which would be difficult to make work with the testing setup. Those reason notes are a bit inconsistently applied and messy though. If that's important I can go through them again and try a more principled approach. When I run `rg '```ignore \(' .` on the repo, there look to be lots of different conventions other people have used for this sort of thing. I could try unifying them all if that would be helpful. I'm not sure if there was a better existing way to do this but I wrote my own script to help me run all the doctests and wade through the output. If that would be useful to anyone else, I put it here: https://github.com/Elliot-Roberts/rust_doctest_fixing_tool
2022-05-06remove all usages of hir().def_kindMiguel Guarniz-5/+0
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-02fix most compiler/ doctestsElliot Roberts-1/+1
2022-05-02rustc: Panic by default in `DefIdTree::parent`Vadim Petrochenkov-1/+1
Only crate root def-ids don't have a parent, and in majority of cases the argument of `DefIdTree::parent` cannot be a crate root. So we now panic by default in `parent` and introduce a new non-panicing function `opt_parent` for cases where the argument can be a crate root. Same applies to `local_parent`/`opt_local_parent`.
2022-04-23Hash visibilities in crate_hash.Camille GILLOT-0/+4
2022-04-23Stop visiting visibility.Camille GILLOT-8/+0
2022-04-17Auto merge of #95655 - kckeiks:create-hir-crate-items-query, r=cjgillotbors-14/+75
Refactor HIR item-like traversal (part 1) Issue #95004 - 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 - use tcx.hir_crate_items to introduce a tcx.hir().par_items(impl Fn(hir::ItemId)) to traverse all items in parallel; Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com> cc `@cjgillot`
2022-04-15Rollup merge of #95194 - kckeiks:update-algo-in-find-use-placement, r=pnkfelixDylan DPC-2/+2
remove find_use_placement A more robust solution to finding where to place use suggestions was added in #94584. The algorithm uses the AST to find the span for the suggestion so we pass this span down to the HIR during lowering and use it instead of calling `find_use_placement` Fixes #94941
2022-04-09rename to par_for_each_itemMiguel Guarniz-1/+1
2022-04-09avoid creating vec in methods in ModuleItemsMiguel Guarniz-2/+2
2022-04-09Use def_key in `tcx.item_name` when possible.Camille GILLOT-7/+6
2022-04-08Refactor HIR item-like traversal (part 1)Miguel Guarniz-14/+75
- 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-04-07Compute `ty_param_owner` using DefIdTree.Camille GILLOT-8/+7
2022-03-31remove find_use_placementFausto-2/+2
A more robust solution to finding where to place use suggestions was added. The algorithm uses the AST to find the span for the suggestion so we pass this span down to the HIR during lowering and use it. Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-03-31Rollup merge of #95497 - nyurik:compiler-spell-comments, r=compiler-errorsDylan DPC-1/+1
Spellchecking compiler comments This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.