summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/rmeta/decoder
AgeCommit message (Collapse)AuthorLines
2023-11-25rustc: Make `def_kind` mandatory for all `DefId`sVadim Petrochenkov-1/+1
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-1/+1
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-11-20Store feature stability un-splitMichael Goulet-1/+1
2023-11-20Unify defined_lib_features and lib_features queriesMichael Goulet-1/+1
2023-10-20s/generator/coroutine/Oli Scherer-2/+2
2023-10-17Automatically enable cross-crate inlining for small functionsBen Kimock-0/+1
2023-09-26Don't store lazyness in DefKindMichael Goulet-0/+1
2023-09-23Enable drop_tracking_mir by default.Camille GILLOT-1/+0
2023-09-22Merge `ExternProviders` into the general `Providers` structOli Scherer-4/+6
2023-09-21Move `DepKind` to `rustc_query_system` and define it as `u16`John Kåre Alsaker-2/+2
2023-09-09Use `FreezeLock` for `CStore`John Kåre Alsaker-2/+2
2023-08-11rustc: Move `features` from `Session` to `GlobalCtxt`Vadim Petrochenkov-3/+4
Removes two pieces of mutable state. Follow up to #114622.
2023-07-29Implement assumed_wf_types for RPITITs' implementationsMichael Goulet-0/+1
2023-07-21Revert "Auto merge of #113166 - moulins:ref-niches-initial, r=oli-obk"David Tolnay-1/+0
This reverts commit 557359f92512ca88b62a602ebda291f17a953002, reversing changes made to 1e6c09a803fd543a98bfbe1624d697a55300a786.
2023-07-21add crate-local `-Z reference_niches` unstable flag (does nothing for now)Moulins-0/+1
2023-07-17Do not fetch HIR in native_libs.Camille GILLOT-1/+1
2023-07-17Simplify foreign_modules.Camille GILLOT-3/+1
2023-06-19Make closure_saved_names_of_captured_variables a query.Camille GILLOT-0/+1
2023-06-07Auto merge of #109005 - Nilstrieb:dont-forgor-too-much-from-cfg, r=petrochenkovbors-0/+1
Remember names of `cfg`-ed out items to mention them in diagnostics # Examples ## `serde::Deserialize` without the `derive` feature (a classic beginner mistake) I had to slightly modify serde so that it uses explicit re-exports instead of a glob re-export. (Update: a serde PR was merged that adds the manual re-exports) ``` error[E0433]: failed to resolve: could not find `Serialize` in `serde` --> src/main.rs:1:17 | 1 | #[derive(serde::Serialize)] | ^^^^^^^^^ could not find `Serialize` in `serde` | note: crate `serde` has an item named `Serialize` but it is inactive because its cfg predicate evaluated to false --> /home/gh-Nilstrieb/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.160/src/lib.rs:343:1 | 343 | #[cfg(feature = "serde_derive")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 344 | pub use serde_derive::{Deserialize, Serialize}; | ^^^^^^^^^ = note: the item is gated behind the `serde_derive` feature = note: see https://doc.rust-lang.org/cargo/reference/features.html for how to activate a crate's feature ``` (the suggestion is not ideal but that's serde's fault) I already tested the metadata size impact locally by compiling the `windows` crate without any features. `800k` -> `809k` r? `@ghost`
2023-06-01Remember names of `cfg`-ed out items to mention them in diagnosticsNilstrieb-0/+1
`#[cfg]`s are frequently used to gate crate content behind cargo features. This can lead to very confusing errors when features are missing. For example, `serde` doesn't have the `derive` feature by default. Therefore, `serde::Serialize` fails to resolve with a generic error, even though the macro is present in the docs. This commit adds a list of all stripped item names to metadata. This is filled during macro expansion and then, through a fed query, persisted in metadata. The downstream resolver can then access the metadata to look at possible candidates for mentioning in the errors. This slightly increases metadata (800k->809k for the feature-heavy windows crate), but not enough to really matter.
2023-06-01Rename `impl_defaultness` to `defaultness`Deadbeef-1/+1
2023-05-31Auto merge of #111076 - ↵bors-1/+7
notriddle:notriddle/silence-private-dep-trait-impl-suggestions, r=cjgillot diagnostics: exclude indirect private deps from trait impl suggest Fixes #88696
2023-05-26Load only the header for crate_matchesjyn-3/+3
Previously, we used the following info to determine whether to load the crate: 1. The METADATA_HEADER, which includes a METADATA_VERSION constant 2. The embedded rustc version 3. Various metadata in the `CrateRoot`, including the SVH This worked ok most of the time. Unfortunately, when building locally the rustc version is always the same because `omit-git-hash` is on by default. That meant that we depended only on 1 and 3, and we are not very good about bumping METADATA_VERSION (it's currently at 7) so in practice we were only depending on 3. `CrateRoot` is a very large struct and changes somewhat regularly, so this led to a steady stream of crashes from trying to load it. Change the logic to add an intermediate step between 2 and 3: introduce a new `CrateHeader` struct that contains only the minimum info needed to decide whether the crate should be loaded or not. That avoids having to load all of `CrateRoot`, which in practice means we should crash much less often. Note that this works because the SVH should be different between any two dependencies, even if the compiler has changed, because we use `-Zbinary-dep-depinfo` in bootstrap. See https://github.com/rust-lang/rust/pull/111329#issuecomment-1538303474 for more details about how the original crash happened.
2023-05-25rustc_metadata: use AtomicBool for privateness instead of LockMichael Howell-2/+5
2023-05-25rustc_metadata: inherit dependency privacy flagMichael Howell-1/+4
2023-05-24Rollup merge of #111870 - WaffleLapkin:just_🌟traits🌟_query, ↵Matthias Krüger-1/+1
r=compiler-errors Rename `traits_in_crate` query to `traits` > NOTE: Not named just `traits` due to a naming conflict. This can, in fact, be easily avoided.
2023-05-23Rename `traits_in_crate` query to `traits`Maybe Waffle-1/+1
2023-05-18Rollup merge of #111703 - Zoxc:queries-mod, r=cjgillotDylan DPC-2/+2
Merge query property modules into one This merges all the query modules that defines types into a single module per query with a normal naming convention for type aliases. r? ``@cjgillot``
2023-05-18Merge query property modules into oneJohn Kåre Alsaker-2/+2
2023-05-17Retire is_foreign_item query.Camille GILLOT-1/+0
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-3/+3
2023-04-25Rollup merge of #110556 - kylematsuda:earlybinder-explicit-item-bounds, ↵Matthias Krüger-1/+1
r=compiler-errors Switch to `EarlyBinder` for `explicit_item_bounds` Part of the work to finish https://github.com/rust-lang/rust/issues/105779. This PR adds `EarlyBinder` to the return type of the `explicit_item_bounds` query and removes `bound_explicit_item_bounds`. r? `@compiler-errors` (hope it's okay to request you, since you reviewed #110299 and #110498 :smiley:)
2023-04-25Revert "Remove #[alloc_error_handler] from the compiler and library"Matthias Krüger-0/+3
This reverts commit abc0660118cc95f47445fd33502a11dd448f5968.
2023-04-22Auto merge of #109507 - Amanieu:panic-oom-payload, r=davidtwcobors-3/+0
Report allocation errors as panics OOM is now reported as a panic but with a custom payload type (`AllocErrorPanicPayload`) which holds the layout that was passed to `handle_alloc_error`. This should be review one commit at a time: - The first commit adds `AllocErrorPanicPayload` and changes allocation errors to always be reported as panics. - The second commit removes `#[alloc_error_handler]` and the `alloc_error_hook` API. ACP: https://github.com/rust-lang/libs-team/issues/192 Closes #51540 Closes #51245
2023-04-21Auto merge of #110648 - Dylan-DPC:rollup-em3ovcq, r=Dylan-DPCbors-1/+1
Rollup of 5 pull requests Successful merges: - #110333 (rustc_metadata: Split `children` into multiple tables) - #110501 (rustdoc: fix ICE from rustc_resolve and librustdoc parse divergence) - #110608 (Specialize some `io::Read` and `io::Write` methods for `VecDeque<u8>` and `&[u8]`) - #110632 (Panic instead of truncating if the incremental on-disk cache is too big) - #110633 (More `mem::take` in `library`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-21Changes from reviewKyle Matsuda-5/+1
2023-04-21rustc_metadata: Split `children` into multiple tablesVadim Petrochenkov-1/+1
instead of merging everything into a single bag. If it's acceptable from performance point of view, then it's more clear to keep this stuff organized more in accordance with its use.
2023-04-20add EarlyBinder to output of explicit_item_bounds; replace ↵Kyle Matsuda-1/+5
bound_explicit_item_bounds usages; remove bound_explicit_item_bounds query
2023-04-19resolve: Remove `module_children_untracked`Vadim Petrochenkov-8/+0
2023-04-16Remove #[alloc_error_handler] from the compiler and libraryAmanieu d'Antras-3/+0
2023-04-11Split implied and super predicate queriesMichael Goulet-1/+13
2023-03-23rustc_metadata: Freeze cstore after the full crate list is queriedVadim Petrochenkov-0/+3
2023-03-23resolve: Rename some cstore methods to match queries and add commentsVadim Petrochenkov-4/+4
about costs associated with replacing them with query calls.
2023-03-23Auto merge of #109517 - matthiaskrgr:rollup-m3orqzd, r=matthiaskrgrbors-12/+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-23Rollup merge of #109137 - petrochenkov:qcstore2, r=cjgillotMatthias Krüger-12/+0
resolve: Querify most cstore access methods (subset 2) These changes are less likely to cause perf regressions than the rest of https://github.com/rust-lang/rust/pull/108346.
2023-03-22Rollup merge of #109213 - oli-obk:cstore, r=cjgillotMatthias Krüger-1/+4
Eagerly intern and check CrateNum/StableCrateId collisions r? ``@cjgillot`` It seems better to check things ahead of time than checking them afterwards. The [previous version](https://github.com/rust-lang/rust/pull/108390) was a bit nonsensical, so this addresses the feedback
2023-03-21LocalCrate keyMichael Goulet-5/+6
2023-03-21Use local key in providersMichael Goulet-18/+5
2023-03-21Eagerly intern and check CrateNum/StableCrateId collisionsOli Scherer-1/+4
2023-03-20Update some names and commentsMichael Goulet-1/+1