about summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/rmeta
AgeCommit message (Collapse)AuthorLines
2023-02-20Make untracked.cstore lockable so that resolution can still write to it when ↵Oli Scherer-1/+7
using TyCtxt
2023-02-19Add associated_items_for_impl_trait_in_trait querySantiago Pastorino-0/+12
2023-02-17Make encode_attrs use opt_local_def_id_to_hir_id so we can feed it with None ↵Santiago Pastorino-2/+2
for definitions that have no HIR
2023-02-17Auto merge of #107753 - kylematsuda:type-of, r=BoxyUwUbors-1/+1
Switch to `EarlyBinder` for `type_of` query Part of the work to finish #105779 and implement https://github.com/rust-lang/types-team/issues/78. Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `type_of` query and removes `bound_type_of`. r? `@lcnr`
2023-02-17Auto merge of #108145 - matthiaskrgr:rollup-bgadak1, r=matthiaskrgrbors-2/+3
Rollup of 8 pull requests Successful merges: - #104068 (rustdoc: Add PartialOrd trait to doc comment explanation) - #107489 (Implement partial support for non-lifetime binders) - #107905 (Pass arguments to `x` subcommands with `--`) - #108009 (Move some tests) - #108086 (wasm: Register the `relaxed-simd` target feature) - #108104 (don't into self) - #108133 (Small cleanups around `EarlyBinder`) - #108136 (Do not ICE on unmet trait alias impl bounds) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-1/+1
in metadata
2023-02-17Rollup merge of #108133 - kylematsuda:earlybinder-cleanups, r=compiler-errorsMatthias Krüger-1/+2
Small cleanups around `EarlyBinder` Cleaning up a few things that were brought up by `@lcnr` in reviewing #106696: - [make `issue33140_self_ty` query return `Option<EarlyBinder<Ty>>`](https://github.com/rust-lang/rust/pull/106696#discussion_r1067821423) - [small style improvement](https://github.com/rust-lang/rust/pull/106696#discussion_r1067816772)
2023-02-16fix ugly skip_binderKyle Matsuda-1/+2
2023-02-16Factor query arena allocation out from query cachesJohn Kåre Alsaker-1/+1
2023-02-16Rename some region-specific stuffMichael Goulet-1/+1
2023-02-14Add `of_trait` to DefKind::Impl.Camille GILLOT-9/+10
2023-02-13rustdoc: Eliminate remaining uses of resolverVadim Petrochenkov-23/+20
2023-02-10Resolve documentation links in rustc and store the results in metadataVadim Petrochenkov-65/+54
This commit implements MCP https://github.com/rust-lang/compiler-team/issues/584 It also removes code that is no longer used, and that includes code cloning resolver, so issue #83761 is fixed.
2023-02-05rustc_metadata: Encode/decode `DefPathHash`es without an `Option`Vadim Petrochenkov-11/+14
2023-02-05rustc_metadata: Encode/decode some `LazyArray`s without an `Option`Vadim Petrochenkov-32/+39
Also add asserts to decoding `LazyArray`s with `Option`
2023-02-05rustc_metadata: Support encoding/decoding `LazyArray` without an `Option`Vadim Petrochenkov-30/+66
2023-02-05rustc_metadata: Refactor lazy table reading/writingVadim Petrochenkov-90/+127
Change wording from "nullable" to "default". Introduce a trait `IsDefault` for detecting values that are encoded as zeros or not encoded at all. Add panics to impossible cases. Some other minor cleanups.
2023-01-29Test drop_tracking_mir before querying generator.Camille GILLOT-1/+1
2023-01-29Auto merge of #107406 - cjgillot:eliminate-witnesses, r=compiler-errorsbors-1/+1
Only compute mir_generator_witnesses query in drop_tracking_mir mode. Attempt to fix the perf regression in https://github.com/rust-lang/rust/pull/101692 r? `@ghost`
2023-01-28Remove `HirId -> LocalDefId` map from HIR.Camille GILLOT-2/+2
2023-01-28Only compute mir_generator_witnesses query in drop_tracking_mir mode.Camille GILLOT-1/+1
2023-01-27Separate witness type computation from the generator transform.Camille GILLOT-0/+6
2023-01-27Auto merge of #107055 - kylematsuda:eb-fn-sig, r=lcnrbors-3/+3
Switch to `EarlyBinder` for `fn_sig` query Part of the work to finish #105779 (also see https://github.com/rust-lang/types-team/issues/78). Several queries `X` have a `bound_X` variant that wraps the output in [`EarlyBinder`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/struct.EarlyBinder.html). This adds `EarlyBinder` to the return type of the `fn_sig` query and removes `bound_fn_sig`. r? `@lcnr`
2023-01-27Auto merge of #107054 - petrochenkov:effvisdoc3, r=GuillaumeGomezbors-0/+6
rustdoc: Collect "rustdoc-reachable" items during early doc link resolution This pass only needs to know about visibilities, attributes and reexports, so it can be run early, similarly to `compute_effective_visibilities` in rustc. Results of this pass can be used to prune the list of extern impls early thus improving performance of https://github.com/rust-lang/rust/pull/94857.
2023-01-27Rollup merge of #107171 - petrochenkov:encattrs, r=cjgillotYuki Okushi-29/+48
rustc_metadata: Fix `encode_attrs` This function didn't do what the authors intended it to do. - Due to `move` in the closure `is_public` wasn't captured by mutalbe reference and wasn't used as a cache. - Due to iterator cloning all the `should_encode_attr` logic run for the second time to calculate `may_have_doc_links` This PR fixes these issues, and calculates all the needed attribute flags in one go. (Noticed while implementing https://github.com/rust-lang/rust/pull/107136.)
2023-01-26change fn_sig query to use EarlyBinder; remove bound_fn_sig query; add ↵Kyle Matsuda-3/+3
EarlyBinder to fn_sig in metadata
2023-01-26replace usages of fn_sig query with bound_fn_sigKyle Matsuda-1/+1
2023-01-26Rollup merge of #107189 - cjgillot:meta-adt, r=compiler-errorsMatthias Krüger-113/+45
Encode info for Adt in a single place. Split from https://github.com/rust-lang/rust/pull/98867
2023-01-25rustdoc: Collect rustdoc-reachable items during early doc link resolutionVadim Petrochenkov-0/+6
2023-01-25rustc_metadata: Fix `encode_attrs`Vadim Petrochenkov-29/+48
This function didn't do what the authors intended it to do. - Due to `move` in the closure `is_public` wasn't captured by mutalbe reference and wasn't used as a cache. - Due to iterator cloning all the `should_encode_attr` logic run for the second time to calculate `may_have_doc_links` This PR fixes these issues, and calculates all the needed attribute flags in one go.
2023-01-23rustc_metadata: Support non-`Option` nullable values in metadata tablesVadim Petrochenkov-76/+64
This is a convenience feature for cases in which "no value in the table" and "default value in the table" are equivalent. Tables using `Table<DefIndex, ()>` are migrated in this PR, some other cases can be migrated later. This helps `DocFlags` in https://github.com/rust-lang/rust/pull/107136 in particular.
2023-01-22Tweak comments.Camille GILLOT-4/+5
2023-01-22Inline encode_enum_variant_info.Camille GILLOT-28/+18
2023-01-22Encode AdtDef in the def-id loop.Camille GILLOT-100/+41
2023-01-21rustc_metadata: Encode `doc(hidden)` flag to metadataVadim Petrochenkov-9/+46
To retrieve these flags rustdoc currently has to mass decode full attributes for items in the whole crate tree, so it's better to pre-compute it in advance. This is especially for short-term performance of https://github.com/rust-lang/rust/pull/107054 because resolver cannot use memoization of query results yet.
2023-01-21Auto merge of #106977 - michaelwoerister:unord_id_collections, r=oli-obkbors-5/+9
Use UnordMap and UnordSet for id collections (DefIdMap, LocalDefIdMap, etc) This PR changes the `rustc_data_structures::define_id_collections!` macro to use `UnordMap` and `UnordSet` instead of `FxHashMap` and `FxHashSet`. This should account for a large portion of hash-maps being used in places where they can cause trouble. The changes required are moderate but non-zero: - In some places the collections are extracted into sorted vecs. - There are a few instances where for-loops have been changed to extends. ~~Let's see what the performance impact is. With a bit more refactoring, we might be able to get rid of some of the additional sorting -- but the change set is already big enough. Unless there's a performance impact, I'd like to do further changes in subsequent PRs.~~ Performance does not seem to be negatively affected ([perf-run here](https://github.com/rust-lang/rust/pull/106977#issuecomment-1396776699)). Part of [MCP 533](https://github.com/rust-lang/compiler-team/issues/533). r? `@ghost`
2023-01-19Conditionally encode booleanMichael Goulet-4/+15
2023-01-19Encode whether foreign opaques are TAITs or notMichael Goulet-0/+3
2023-01-19Allow for more efficient sorting when exporting Unord collections.Michael Woerister-1/+1
2023-01-19Use UnordMap instead of FxHashMap in define_id_collections!().Michael Woerister-5/+9
2023-01-18Rollup merge of #106917 - compiler-errors:const-closure-foreign, r=tmiaskoMichael Goulet-11/+2
Encode const mir for closures if they're const Fixes #106913
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-16Encode const mir for closures if they're constMichael Goulet-11/+2
2023-01-14fix various subst_identity vs skip_binderKyle Matsuda-3/+3
2023-01-14change impl_trait_ref query to return EarlyBinder; remove ↵Kyle Matsuda-9/+5
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-3/+9
2023-01-14change const_param_default query to return EarlyBinder; remove ↵Kyle Matsuda-2/+2
bound_const_param_default query; add EarlyBinder to const_param_default in metadata
2023-01-14change usages of const_param_default query to bound_const_param_defaultKyle Matsuda-1/+1
2023-01-12attempt to make a minimal example workDeadbeef-0/+2