summary refs log tree commit diff
path: root/compiler/rustc_metadata/src
AgeCommit message (Collapse)AuthorLines
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-5/+5
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-5/+5
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
2023-01-09Use newtype for unused generic parametersNilstrieb-4/+4
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-20/+14
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).
2023-01-03Auto merge of #105609 - bjorn3:shrink_rustc_dev, r=jyn514bors-2/+15
Only include metadata for non-dynamic libraries in rustc-dev The actual object code should be linked from librustc_driver.so, which is still included in rustc-dev. This saves on download time and disk usage. Fixes https://github.com/rust-lang/rust/issues/103538
2022-12-31Add help for the error message when missing rustc_driverbjorn3-2/+15
2022-12-31refactor: merge `E0465` into `E0464`Ezra Shaw-54/+31
2022-12-28Auto merge of #106129 - compiler-errors:compare_method-tweaks, r=BoxyUwUbors-2/+2
Some `compare_method` tweaks 1. Make some of the comparison functions' names more regular 2. Reduce pub scope of some of the things in `compare_method` ~3. Remove some unnecessary opaque type handling code -- `InferCtxt` already is in a mode that doesn't define opaque types~ * moved to a different PR 4. Bubble up `ErrorGuaranteed` for region constraint errors in `compare_method` - Improves a redundant error message in one unit test. 5. Move the `compare_method` module to have a more general name, since it's more like `compare_impl_item` :) 6. Rename `collect_trait_impl_trait_tys`
2022-12-28better names and a commentMichael Goulet-2/+2
2022-12-25Rollup merge of #106137 - matthiaskrgr:clippy_style, r=jyn514Matthias Krüger-1/+1
fix more clippy::style findings match_result_ok obfuscated_if_else single_char_add writeln_empty_string collapsible_match iter_cloned_collect unnecessary_mut_passed r? `@compiler-errors`
2022-12-25Rollup merge of #105955 - ↵Matthias Krüger-1/+1
Nilstrieb:no-trivial-opt-wrappers-we-have-field-accesses-for-that, r=cjgillot Remove wrapper functions for some unstable options They are trivial and just forward to the option. Like most other options, we can just access it directly.
2022-12-25fix more clippy::style findingsMatthias Krüger-1/+1
match_result_ok obfuscated_if_else single_char_add writeln_empty_string collapsible_match iter_cloned_collect unnecessary_mut_passed
2022-12-25fix some typosKaDiWa-1/+1
2022-12-24Rollup merge of #105975 - jeremystucki:rustc-remove-needless-lifetimes, r=eholkMatthias Krüger-3/+3
rustc: Remove needless lifetimes
2022-12-22A few metadata nitsNilstrieb-26/+11
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-3/+3
2022-12-20Remove wrapper functions for some unstable optionsNilstrieb-1/+1
They are trivial and just forward to the option. Like most other options, we can just access it directly.
2022-12-18Rollup merge of #105869 - matthiaskrgr:clone_on_copy, r=compiler-errorsMatthias Krüger-1/+1
don't clone Copy types
2022-12-18don't restuct references just to reborrowMatthias Krüger-2/+2
2022-12-18don't clone Copy typesMatthias Krüger-1/+1
2022-12-16Auto merge of #102318 - Amanieu:default_alloc_error_handler, r=oli-obkbors-16/+3
Stabilize default_alloc_error_handler Tracking issue: #66741 This turns `feature(default_alloc_error_handler)` on by default, which causes the compiler to automatically generate a default OOM handler which panics if `#[alloc_error_handler]` is not provided. The FCP completed over 2 years ago but the stabilization was blocked due to an issue with unwinding. This was fixed by #88098 so stabilization can be unblocked. Closes #66741
2022-12-14Auto merge of #104986 - compiler-errors:opaques, r=oli-obkbors-2/+2
Combine `ty::Projection` and `ty::Opaque` into `ty::Alias` Implements https://github.com/rust-lang/types-team/issues/79. This PR consolidates `ty::Projection` and `ty::Opaque` into a single `ty::Alias`, with an `AliasKind` and `AliasTy` type (renamed from `ty::ProjectionTy`, which is the inner data of `ty::Projection`) defined as so: ``` enum AliasKind { Projection, Opaque, } struct AliasTy<'tcx> { def_id: DefId, substs: SubstsRef<'tcx>, } ``` Since we don't have access to `TyCtxt` in type flags computation, and because repeatedly calling `DefKind` on the def-id is expensive, these two types are distinguished with `ty::AliasKind`, conveniently glob-imported into `ty::{Projection, Opaque}`. For example: ```diff match ty.kind() { - ty::Opaque(..) => + ty::Alias(ty::Opaque, ..) => {} _ => {} } ``` This PR also consolidates match arms that treated `ty::Opaque` and `ty::Projection` identically. r? `@ghost`
2022-12-13Combine projection and opaque into aliasMichael Goulet-1/+1
2022-12-13ProjectionTy.item_def_id -> ProjectionTy.def_idMichael Goulet-1/+1
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-7/+9
available
2022-12-11Rollup merge of #105472 - spastorino:make-encoder-use-queries, r=oli-obkMatthias Krüger-12/+4
Make encode_info_for_trait_item use queries instead of accessing the HIR This change avoids accessing the HIR on `encode_info_for_trait_item` and uses queries. We will need to execute this function for elements that have no HIR and by using queries we will be able to feed for definitions that have no HIR. r? ``@oli-obk``
2022-12-10compiler: remove unnecessary imports and qualified pathsKaDiWa-1/+0
2022-12-09Fold `Definitions` into the untracked dataOli Scherer-3/+3
2022-12-09Move the untracked cstore and source_span into a structOli Scherer-0/+3
2022-12-09Generate crate loaders on the flyOli Scherer-29/+31
2022-12-08Make encode_info_for_trait_item use queries instead of accessing the HIRSantiago Pastorino-12/+4
2022-12-07Use `Symbol` for the crate name instead of `String`/`str`Oli Scherer-5/+4
2022-12-03Remove all but one call site of `prepare_outputs` and fetch the value from ↵Oli Scherer-6/+4
the TyCtxt instead
2022-11-29Make inferred_outlives_crate return ClauseSantiago Pastorino-1/+1
2022-11-28Rollup merge of #104360 - petrochenkov:stabverb, r=TaKO8KiDylan DPC-8/+5
Stabilize native library modifier `verbatim` Stabilization report - https://github.com/rust-lang/rust/pull/104360#issuecomment-1312724787. cc https://github.com/rust-lang/rust/issues/81490 Closes https://github.com/rust-lang/rust/issues/99425
2022-11-27Stabilize native library modifier `verbatim`Vadim Petrochenkov-8/+5
2022-11-27Prefer doc comments over `//`-comments in compilerMaybe Waffle-4/+4