about summary refs log tree commit diff
path: root/compiler/rustc_metadata/src
AgeCommit message (Collapse)AuthorLines
2021-07-13Cache expansion hash.Camille GILLOT-9/+25
2021-07-13Auto merge of #86857 - fee1-dead:add-attr, r=oli-obkbors-3/+14
Add #[default_method_body_is_const] `@rustbot` label F-const_trait_impl
2021-07-11Auto merge of #85941 - cjgillot:qresolve, r=Aaron1011bors-3/+9
Reduce the amount of untracked state in TyCtxt -- Take 2 Main part of #85153 The offending line (https://github.com/rust-lang/rust/pull/85153#discussion_r642866298) is replaced by a FIXME until the possible bug and the perf concern are both resolved. r? `@Aaron1011`
2021-07-10rustc_expand: Remove redundant field from proc macro expander structuresVadim Petrochenkov-19/+12
This information is already available from `ExpnData`
2021-07-10Add impl_constness queryDeadbeef-3/+14
2021-07-09Add support for raw-dylib with stdcall, fastcall functions on ↵Richard Cobbe-15/+57
i686-pc-windows-msvc.
2021-07-06Correct comments about untracked accesses.Camille GILLOT-3/+3
2021-07-06Make resolutions a query.Camille GILLOT-0/+6
2021-07-06Revert "Revert "Merge CrateDisambiguator into StableCrateId""bjorn3-29/+16
This reverts commit 8176ab8bc18fdd7d3c2cf7f720c51166364c33a3.
2021-07-05Remove LibSourcebjorn3-3/+13
The information is stored in used_crate_source too anyway
2021-07-01Auto merge of #86749 - bjorn3:link_info_refactor_part1, r=petrochenkovbors-7/+7
Rename all_crate_nums query to crates and remove useless wrapper Split out of https://github.com/rust-lang/rust/pull/86105 r? `@petrochenkov`
2021-07-01Rename all_crate_nums query to crates and remove useless wrapperbjorn3-7/+7
2021-06-30use is_const_fn_raw when encoding constnessDeadbeef-1/+6
this properly encodes cross-crate constness data.
2021-06-28Auto merge of #85909 - cjgillot:alloc-kind-query, r=Aaron1011bors-5/+1
Make allocator_kind a query. Part of #85153 r? `@Aaron1011`
2021-06-24Use `#[non_exhaustive]` where appropriateJacob Pratt-4/+3
Due to the std/alloc split, it is not possible to make `alloc::collections::TryReserveError::AllocError` non-exhaustive without having an unstable, doc-hidden method to construct (which negates the benefits from `#[non_exhaustive]`.
2021-06-21Print more crate details in -ZlsJeremy Fitzhardinge-2/+15
Useful for debugging crate hash and resolution issues.
2021-06-20Implement the query in cstore_impl.Camille GILLOT-5/+1
2021-06-18Auto merge of #85284 - eggyal:custom-profiler-runtime, r=jackh726bors-19/+25
Provide option for specifying the profiler runtime Currently, if `-Zinstrument-coverage` is enabled, the target is linked against the `library/profiler_builtins` crate (which pulls in LLVM's compiler-rt runtime). This option enables backends to specify an alternative runtime crate for handling injected instrumentation calls.
2021-06-17Early return from `inject_profiler_runtime`Alan Egerton-23/+23
2021-06-17Auto merge of #85834 - cjgillot:save-sbi, r=michaelwoeristerbors-4/+4
Encode CrateNum using the StableCrateId for incr. comp.
2021-06-11Auto merge of #85885 - bjorn3:remove_box_region, r=cjgillotbors-3/+3
Don't use a generator for BoxedResolver The generator is non-trivial and requires unsafe code anyway. Using regular unsafe code without a generator is much easier to follow. Based on #85810 as it touches rustc_interface too.
2021-06-10Auto merge of #85910 - cjgillot:no-meta-version, r=Aaron1011bors-6/+4
Drop metadata_encoding_version. Part of #85153 r? `@Aaron1011`
2021-06-09Encode CrateNum using the StableCrateId for incr. comp.Camille GILLOT-4/+4
2021-06-08Store boxed metadata loader in CrateLoaderbjorn3-3/+3
2021-06-07Revert "Merge CrateDisambiguator into StableCrateId"bjorn3-16/+29
This reverts commit d0ec85d3fb6d322496cb8f4bc1c21e19f23284ad.
2021-06-06Auto merge of #84171 - ricobbe:raw-dylib-via-llvm, r=petrochenkovbors-11/+61
Partial support for raw-dylib linkage First cut of functionality for issue #58713: add support for `#[link(kind = "raw-dylib")]` on `extern` blocks in lib crates compiled to .rlib files. Does not yet support `#[link_name]` attributes on functions, or the `#[link_ordinal]` attribute, or `#[link(kind = "raw-dylib")]` on `extern` blocks in bin crates; I intend to publish subsequent PRs to fill those gaps. It's also not yet clear whether this works for functions in `extern "stdcall"` blocks; I also intend to investigate that shortly and make any necessary changes as a follow-on PR. This implementation calls out to an LLVM function to construct the actual `.idata` sections as temporary `.lib` files on disk and then links those into the generated .rlib.
2021-06-05Auto merge of #86002 - cjgillot:expn_that_defined, r=petrochenkovbors-1/+1
Always go through the expn_that_defined query.
2021-06-04Add first cut of functionality for #58713: support for #[link(kind = ↵Richard Cobbe-11/+61
"raw-dylib")]. This does not yet support #[link_name] attributes on functions, the #[link_ordinal] attribute, #[link(kind = "raw-dylib")] on extern blocks in bin crates, or stdcall functions on 32-bit x86.
2021-06-04Always go through the expn_that_defined query.Camille GILLOT-1/+1
2021-06-04Rollup merge of #85889 - denismerigoux:master, r=petrochenkovYuki Okushi-0/+11
Restoring the `num_def_ids` function in the CStore API ## The context I am the maintainer of https://github.com/hacspec/hacspec, an embedded Rust DSL aimed at cryptographic specifications. As it is normal for an embedded DSL, Hacspec's compiler relies on being plugged to the internal API of the Rust compiler, which is unstable and subject to changes. ## The problem The Hacspec compiler features its own typechecker, that performs an additional, more restrictive typechecking pass over the Rust code of a crate. To complete this typechecking, the Hacspec compiler needs to retrieve the signature of functions defined in non-local imported crates. Rather than retrieving these signatures on-demand, the Hacspec compiler pre-populates its typechecking context with all the Hacspec-compatible symbols defined in non-local crates first. This requires having a way to iterate over all the definitions in a non-local crate. I used to do this with `CrateMetadata::all_def_path_hashes_and_def_ids`, but this function was deleted in 908bf5a310b7265a3e. Then, I fellback on `CStore::num_def_ids`, exploiting the fact that all the `DefIds` for a crate have the same `krate_num` and range from `0` to `num_def_ids(krate_num)`. But `num_def_ids` was deleted in b6120bfb354c1c1c9fdf. I looked to the `Cstore::item_children_untracked` function to replicate the feature of traversing through all the `DefId` for a crate, using `CRATE_DEF_INDEX` as the root, but this does not work as recursive `Cstore::item_children_untracked` calls do not reach all the symbols I was able to reach using the two previous methods. ## Description of this PR This PR simply restores in the public API of `CStore` the `num_def_ids` function, giving the size of the definition table for a given crate.
2021-06-04Rollup merge of #85850 - bjorn3:less_feature_gates, r=jyn514Yuki Okushi-2/+0
Remove unused feature gates The first commit removes a usage of a feature gate, but I don't expect it to be controversial as the feature gate was only used to workaround a limitation of rust in the past. (closures never being `Clone`) The second commit uses `#[allow_internal_unstable]` to avoid leaking the `trusted_step` feature gate usage from inside the index newtype macro. It didn't work for the `min_specialization` feature gate though. The third commit removes (almost) all feature gates from the compiler that weren't used anyway.
2021-06-03Restore the num_def_ids_untracked public function giving the total number of ↵Denis Merigoux-0/+11
exported symbols for each crate Restored underlying num_def_ids_method Update compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs Changed name to fit with naming convention Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com> Update compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs Replace regular doc with Rustdoc comment Co-authored-by: Joshua Nelson <jyn514@gmail.com> Clarifies third-party use of num_def_ids_untracked
2021-06-02Restrict access to crate_name.Camille GILLOT-3/+2
Also remove original_crate_name, which had the exact same implementation
2021-06-02Update compiler/rustc_metadata/src/rmeta/mod.rsCamille Gillot-1/+1
Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2021-06-02Auto merge of #85908 - cjgillot:private-dep-query, r=Aaron1011bors-4/+5
Make is_private_dep a query. Part of #85153 r? `@Aaron1011`
2021-06-01Auto merge of #85829 - bjorn3:simplify_crate_num, r=jackh726bors-1/+1
Remove CrateNum::ReservedForIncrCompCache It's only use is easily replaceable with `Option<CrateNum>`.
2021-06-01Drop metadata_encoding_version.Camille GILLOT-6/+4
2021-06-01Make is_private_dep a query.Camille GILLOT-4/+5
2021-06-01Revert "Reduce the amount of untracked state in TyCtxt"Camille Gillot-16/+16
2021-05-31Remove unused feature gatesbjorn3-2/+0
2021-05-30Drop metadata_encoding_version.Camille GILLOT-6/+4
2021-05-30Correct comments about untracked accesses.Camille GILLOT-3/+3
2021-05-30Make is_private_dep a query.Camille GILLOT-4/+1
2021-05-30Restrict access to crate_name.Camille GILLOT-3/+2
Also remove original_crate_name, which had the exact same implementation
2021-05-30Make resolutions a query.Camille GILLOT-0/+6
2021-05-30Remove CrateNum::ReservedForIncrCompCachebjorn3-1/+1
2021-05-30Merge CrateDisambiguator into StableCrateIdbjorn3-29/+16
2021-05-24remove cfg(bootstrap)Pietro Albini-1/+0
2021-05-17Provide option for specifying the profiler runtimeAlan Egerton-18/+24
Currently, if `-Zinstrument-coverage` is enabled, the target is linked against the `library/profiler_builtins` crate (which pulls in LLVM's compiler-rt runtime). This option enables backends to specify an alternative runtime crate for handling injected instrumentation calls.
2021-05-17Auto merge of #85178 - cjgillot:local-crate, r=oli-obkbors-32/+12
Remove CrateNum parameter for queries that only work on local crate The pervasive `CrateNum` parameter is a remnant of the multi-crate rustc idea. Using `()` as query key in those cases avoids having to worry about the validity of the query key.