summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/rmeta/decoder.rs
AgeCommit message (Collapse)AuthorLines
2023-05-19Encode VariantIdx so we can decode variants in the right orderMichael Goulet-26/+41
(cherry picked from commit ff54c801f0c1552941bda472df992e9f9be25f33)
2023-04-12resolve: Pre-compute non-reexport module childrenVadim Petrochenkov-9/+6
Instead of repeating the same logic by walking HIR during metadata encoding. The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list. They can be encoded separately if this need ever arises. `module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead.
2023-04-10rustc_metadata: Filter encoded data more aggressively using `DefKind`Vadim Petrochenkov-5/+19
2023-04-08resolve: Preserve reexport chains in `ModChild`renVadim Petrochenkov-1/+1
This may be potentially useful for - avoiding uses of `hir::ItemKind::Use` - preserving documentation comments on all reexports - preserving and checking stability/deprecation info on reexports - all kinds of diagnostics
2023-04-08Auto merge of #109971 - WaffleLapkin:yeet_ownership, r=Nilstriebbors-6/+0
Yeet `owning_ref` Based on the discussions from https://github.com/rust-lang/rust/pull/109948 This replaces `owning_ref` with a far simpler & safer abstraction. Fixes #109974
2023-04-05Use `OwnedSlice` instead of `owning_ref`Maybe Waffle-6/+0
2023-04-04Another AppendOnlyVecOli Scherer-6/+6
2023-03-29Properly skip RPITITs from ModChild and give a name in AssocItemSantiago Pastorino-3/+8
2023-03-23resolve: Rename some cstore methods to match queries and add commentsVadim Petrochenkov-7/+0
about costs associated with replacing them with query calls.
2023-03-23Auto merge of #109517 - matthiaskrgr:rollup-m3orqzd, r=matthiaskrgrbors-4/+0
Rollup of 7 pull requests Successful merges: - #108541 (Suppress `opaque_hidden_inferred_bound` for nested RPITs) - #109137 (resolve: Querify most cstore access methods (subset 2)) - #109380 (add `known-bug` test for unsoundness issue) - #109462 (Make alias-eq have a relation direction (and rename it to alias-relate)) - #109475 (Simpler checked shifts in MIR building) - #109504 (Stabilize `arc_into_inner` and `rc_into_inner`.) - #109506 (make param bound vars visibly bound vars with -Zverbose) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-21Eagerly intern and check CrateNum/StableCrateId collisionsOli Scherer-4/+0
2023-03-16resolve: Remove `item_generics_num_lifetimes`Vadim Petrochenkov-4/+0
2023-03-14Encode opt_rpitit_info for associated typesMichael Goulet-2/+3
2023-03-14Auto merge of #109057 - compiler-errors:rpitit-info-again, r=spastorinobors-0/+2
Don't `opt_rpitit_info` as a separate query ... another attempt to undo regressions r? `@ghost`
2023-03-13Don't opt_rpitit_info as a separate queryMichael Goulet-0/+2
2023-03-13resolve: Remove `struct_field_names_untracked`Vadim Petrochenkov-15/+0
2023-03-13resolve: Remove `struct_field_visibilities_untracked`Vadim Petrochenkov-14/+1
2023-03-11Give proper error message when tcx wasn't passed to decoderNilstrieb-5/+18
2023-02-24Rename many interner functions.Nicholas Nethercote-1/+1
(This is a large commit. The changes to `compiler/rustc_middle/src/ty/context.rs` are the most important ones.) The current naming scheme is a mess, with a mix of `_intern_`, `intern_` and `mk_` prefixes, with little consistency. In particular, in many cases it's easy to use an iterator interner when a (preferable) slice interner is available. The guiding principles of the new naming system: - No `_intern_` prefixes. - The `intern_` prefix is for internal operations. - The `mk_` prefix is for external operations. - For cases where there is a slice interner and an iterator interner, the former is `mk_foo` and the latter is `mk_foo_from_iter`. Also, `slice_interners!` and `direct_interners!` can now be `pub` or non-`pub`, which helps enforce the internal/external operations division. It's not perfect, but I think it's a clear improvement. The following lists show everything that was renamed. slice_interners - const_list - mk_const_list -> mk_const_list_from_iter - intern_const_list -> mk_const_list - substs - mk_substs -> mk_substs_from_iter - intern_substs -> mk_substs - check_substs -> check_and_mk_substs (this is a weird one) - canonical_var_infos - intern_canonical_var_infos -> mk_canonical_var_infos - poly_existential_predicates - mk_poly_existential_predicates -> mk_poly_existential_predicates_from_iter - intern_poly_existential_predicates -> mk_poly_existential_predicates - _intern_poly_existential_predicates -> intern_poly_existential_predicates - predicates - mk_predicates -> mk_predicates_from_iter - intern_predicates -> mk_predicates - _intern_predicates -> intern_predicates - projs - intern_projs -> mk_projs - place_elems - mk_place_elems -> mk_place_elems_from_iter - intern_place_elems -> mk_place_elems - bound_variable_kinds - mk_bound_variable_kinds -> mk_bound_variable_kinds_from_iter - intern_bound_variable_kinds -> mk_bound_variable_kinds direct_interners - region - intern_region (unchanged) - const - mk_const_internal -> intern_const - const_allocation - intern_const_alloc -> mk_const_alloc - layout - intern_layout -> mk_layout - adt_def - intern_adt_def -> mk_adt_def_from_data (unusual case, hard to avoid) - alloc_adt_def(!) -> mk_adt_def - external_constraints - intern_external_constraints -> mk_external_constraints Other - type_list - mk_type_list -> mk_type_list_from_iter - intern_type_list -> mk_type_list - tup - mk_tup -> mk_tup_from_iter - intern_tup -> mk_tup
2023-02-13rustdoc: Eliminate remaining uses of resolverVadim Petrochenkov-9/+3
2023-02-10Resolve documentation links in rustc and store the results in metadataVadim Petrochenkov-22/+19
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-1/+1
2023-02-05rustc_metadata: Encode/decode some `LazyArray`s without an `Option`Vadim Petrochenkov-13/+10
Also add asserts to decoding `LazyArray`s with `Option`
2023-02-05rustc_metadata: Support encoding/decoding `LazyArray` without an `Option`Vadim Petrochenkov-9/+9
2023-01-23rustc_metadata: Support non-`Option` nullable values in metadata tablesVadim Petrochenkov-4/+4
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-21rustc_metadata: Encode `doc(hidden)` flag to metadataVadim Petrochenkov-2/+2
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-05Fix `uninlined_format_args` for some compiler cratesnils-3/+3
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2022-12-22A few metadata nitsNilstrieb-15/+9
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-7/+9
available
2022-11-27Prefer doc comments over `//`-comments in compilerMaybe Waffle-4/+4
2022-11-26Auto merge of #104730 - petrochenkov:modchild5, r=cjgillotbors-61/+38
rustc_metadata: Switch module children decoding to an iterator Previously https://github.com/rust-lang/rust/pull/103578, https://github.com/rust-lang/rust/pull/103524 and previous PRs simplified it as much as possible. A couple of cleanup commits is also added. r? `@cjgillot`
2022-11-25Add empty ConstKind::Abstractkadmin-6/+0
Initial pass at expr/abstract const/s Address comments Switch to using a list instead of &[ty::Const], rm `AbstractConst` Remove try_unify_abstract_consts Update comments Add edits Recurse more More edits Prevent equating associated consts Move failing test to ui Changes this test from incremental to ui, and mark it as failing and a known bug. Does not cause the compiler to ICE, so should be ok.
2022-11-22rustc_metadata: Cleanup to `get_module_children`Vadim Petrochenkov-49/+26
to unify proc-macro and non-proc-macro cases in particular.
2022-11-22rustc_metadata: Switch module children decoding to an iteratorVadim Petrochenkov-47/+47
2022-11-21Unreserve braced enum variants in value namespaceVadim Petrochenkov-30/+6
2022-10-31Rewrite implementation of `#[alloc_error_handler]`Amanieu d'Antras-0/+4
The new implementation doesn't use weak lang items and instead changes `#[alloc_error_handler]` to an attribute macro just like `#[global_allocator]`. The attribute will generate the `__rg_oom` function which is called by the compiler-generated `__rust_alloc_error_handler`. If no `__rg_oom` function is defined in any crate then the compiler shim will call `__rdl_oom` in the alloc crate which will simply panic. This also fixes link errors with `-C link-dead-code` with `default_alloc_error_handler`: `__rg_oom` was previously defined in the alloc crate and would attempt to reference the `oom` lang item, even if it didn't exist. This worked as long as `__rg_oom` was excluded from linking since it was not called. This is a prerequisite for the stabilization of `default_alloc_error_handler` (#102318).
2022-10-29Encode LangItem directlyCameron Steffen-3/+2
2022-10-25rustc_metadata: Add constructors to module children at encoding timeVadim Petrochenkov-44/+35
instead of decoding time.
2022-09-14make `mk_attr_id` part of `ParseSess`SparrowLii-0/+7
2022-09-07rustc: Parameterize `ty::Visibility` over used IDVadim Petrochenkov-3/+12
It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
2022-09-01Auto merge of #98960 - cjgillot:entry-kind, r=estebankbors-68/+50
Remove EntryKind from metadata. This PR continues the refactor of metadata emission to be more systematic, iterating on definitions and filtering based on each definition's `DefKind`. This allows to remove the large `EntryKind` enum, replaced by linear tables in metadata.
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-1/+0
by module
2022-08-30Remove fn_has_self_parameter table.Camille GILLOT-5/+12
2022-08-30Separate macro_rules and macro_definition.Camille GILLOT-8/+5
2022-08-30Remove EntryKind.Camille GILLOT-35/+21
2022-08-30Create a module-reexports table.Camille GILLOT-11/+5
2022-08-30Create a table for fn_has_self_parameter.Camille GILLOT-8/+6
2022-08-30Use tables for macros.Camille GILLOT-7/+11
2022-08-30Move AssocContainer to a metadata table.Camille GILLOT-6/+7
2022-08-30Move VariantData to a metadata table.Camille GILLOT-14/+9