summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/rmeta/decoder
AgeCommit message (Collapse)AuthorLines
2022-06-15Rename `impl_constness` to `constness`Deadbeef-1/+1
The current code is a basis for `is_const_fn_raw`, and `impl_constness` is no longer a valid name, which is previously used for determining the constness of impls, and not items in general.
2022-05-23Fix iterator implementation, add some inlinesMichael Goulet-0/+6
2022-05-23split out the various responsibilities of LazyMichael Goulet-11/+72
2022-05-16Add a query for checking whether a function is an intrinsic.Oli Scherer-0/+1
2022-05-09store `codegen_fn_attrs` in crate metadatalcnr-0/+1
2022-05-03Add support for a new attribute `#[debugger_visualizer]` to support ↵ridwanabdillahi-0/+1
embedding debugger visualizers into a generated PDB. Cleanup `DebuggerVisualizerFile` type and other minor cleanup of queries. Merge the queries for debugger visualizers into a single query. Revert move of `resolve_path` to `rustc_builtin_macros`. Update dependencies in Cargo.toml for `rustc_passes`. Respond to PR comments. Load visualizer files into opaque bytes `Vec<u8>`. Debugger visualizers for dynamically linked crates should not be embedded in the current crate. Update the unstable book with the new feature. Add the tracking issue for the debugger_visualizer feature. Respond to PR comments and minor cleanups.
2022-04-25Auto merge of #95604 - nbdd0121:used2, r=petrochenkovbors-2/+2
Generate synthetic object file to ensure all exported and used symbols participate in the linking Fix #50007 and #47384 This is the synthetic object file approach that I described in https://github.com/rust-lang/rust/pull/95363#issuecomment-1079932354, allowing all exported and used symbols to be linked while still allowing them to be GCed. Related #93791, #95363 r? `@petrochenkov` cc `@carbotaniuman`
2022-04-21[WIP] rustdoc: Resolve some more doc links earlyVadim Petrochenkov-0/+8
2022-04-19rustc_metadata: Store a flag telling whether an item may have doc links in ↵Vadim Petrochenkov-0/+4
its attributes This should be cheap on rustc side, but it's significant optimization for rustdoc that won't need to decode and process attributes unnecessarily
2022-04-19Rollup merge of #96142 - cjgillot:no-crate-def-index, r=petrochenkovDylan DPC-2/+2
Stop using CRATE_DEF_INDEX outside of metadata encoding. `CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want. We should not manipulate raw `DefIndex` outside of metadata encoding.
2022-04-18Add `SymbolExportInfo`Gary Guo-2/+2
This is currently a wrapper to `SymbolExportLevel` but it allows later addition of extra information.
2022-04-17Stop using CRATE_DEF_INDEX.Camille GILLOT-2/+2
`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.
2022-04-16Provide a better diagnostic on failure to meet send bound on futures in a ↵oribenshir-0/+1
foreign crate Adding diagnostic data on generators to the crate metadata and using it to provide a better diagnostic on failure to meet send bound on futures originated from a foreign crate
2022-04-07rustdoc: Early doc link resolution fixes and refactoringsVadim Petrochenkov-1/+3
2022-03-31Merge impl_constness and is_const_fn_raw.Camille GILLOT-1/+0
2022-03-31Create trait_def table.Camille GILLOT-1/+1
2022-03-30Auto merge of #95436 - cjgillot:static-mut, r=oli-obkbors-1/+0
Remember mutability in `DefKind::Static`. This allows to compute the `BodyOwnerKind` from `DefKind` only, and removes a direct dependency of some MIR queries onto HIR. As a side effect, it also simplifies metadata, since we don't need 4 flavours of `EntryKind::*Static` any more.
2022-03-30fix rustdoc wrt builtin impls switchlcnr-4/+7
2022-03-30rework implementation for inherent impls for builtin typeslcnr-8/+20
2022-03-29Remember mutability in `DefKind::Static`.Camille GILLOT-1/+0
This allows to compute the `BodyOwnerKind` from `DefKind` only, and removes a direct dependency of some MIR queries onto HIR. As a side effect, it also simplifies metadata, since we don't need 4 flavours of `EntryKind::*Static` any more.
2022-02-24Auto merge of #94129 - cjgillot:rmeta-table, r=petrochenkovbors-67/+77
Back more metadata using per-query tables r? `@ghost`
2022-02-19Adopt let else in more placesest31-3/+2
2022-02-19Add generator_kind table.Camille GILLOT-1/+1
2022-02-19Add fn_arg_names table.Camille GILLOT-1/+1
2022-02-19Add asyncness table.Camille GILLOT-1/+1
2022-02-19Add rendered_const table.Camille GILLOT-1/+1
2022-02-19Add mir_const_qualifs table.Camille GILLOT-1/+1
2022-02-19Drop ImplData.Camille GILLOT-9/+5
2022-02-19Do not decode span when we only need the name.Camille GILLOT-1/+1
2022-02-19Encode metadata using queries.Camille GILLOT-48/+66
2022-02-19Stop interning stability.Camille GILLOT-6/+2
2022-02-18rustdoc: Collect traits in scope for lang itemsVadim Petrochenkov-1/+6
2022-02-15Overhaul `Const`.Nicholas Nethercote-1/+1
Specifically, rename the `Const` struct as `ConstS` and re-introduce `Const` as this: ``` pub struct Const<'tcx>(&'tcx Interned<ConstS>); ``` This now matches `Ty` and `Predicate` more closely, including using pointer-based `eq` and `hash`. Notable changes: - `mk_const` now takes a `ConstS`. - `Const` was copy, despite being 48 bytes. Now `ConstS` is not, so need a we need separate arena for it, because we can't use the `Dropless` one any more. - Many `&'tcx Const<'tcx>`/`&Const<'tcx>` to `Const<'tcx>` changes - Many `ct.ty` to `ct.ty()` and `ct.val` to `ct.val()` changes. - Lots of tedious sigil fiddling.
2022-02-09Ensure that queries only return Copy types.Camille GILLOT-13/+8
2022-02-04rustdoc: Collect traits in scope for foreign inherent implsVadim Petrochenkov-0/+10
2022-01-25rustdoc: Pre-calculate traits that are in scope for doc linksVadim Petrochenkov-1/+1
This eliminates one more late use of resolver
2022-01-16rustc_metadata: Switch all decoder methods from vectors to iteratorsVadim Petrochenkov-10/+23
Also remove unnecessary `is_proc_macro_crate` checks from decoder
2022-01-12Auto merge of #92169 - In-line:no-cache-selector-lrc, r=Mark-Simulacrumbors-1/+1
Remove ArenaCacheSelector for visible_parent_map query ( + LRC)
2022-01-09Auto merge of #92690 - matthiaskrgr:rollup-rw0oz05, r=matthiaskrgrbors-2/+12
Rollup of 8 pull requests Successful merges: - #92055 (Add release notes for 1.58) - #92490 (Move crate drop-down to search results page) - #92510 (Don't resolve blocks in foreign functions) - #92573 (expand: Refactor InvocationCollector visitor for better code reuse) - #92608 (rustdoc: Introduce a resolver cache for sharing data between early doc link resolution and later passes) - #92657 (Implemented const casts of raw pointers) - #92671 (Make `Atomic*::from_mut` return `&mut Atomic*`) - #92673 (Remove useless collapse toggle on "all items" page) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-01-09Rollup merge of #92608 - petrochenkov:doctrscope3, r=CraftSpiderMatthias Krüger-2/+12
rustdoc: Introduce a resolver cache for sharing data between early doc link resolution and later passes The refactoring parts of https://github.com/rust-lang/rust/pull/88679, shouldn't cause any slowdowns. r? `@jyn514`
2022-01-09rustc_middle: Rename `Export` to `ModChild` and add some commentsVadim Petrochenkov-3/+3
Also rename `module_exports`/`export_map` to `module_reexports`/`reexport_map` for clarity.
2022-01-09rustc_metadata: Rename `item_children(_untracked)` to ↵Vadim Petrochenkov-5/+5
`module_children(_untracked)` And `each_child_of_item` to `for_each_module_child`
2022-01-09rustc_metadata: Optimize and document module children decodingVadim Petrochenkov-9/+14
2022-01-07Deserialization less in associated_item_def_idsMatthew Jasper-6/+1
2022-01-07rustdoc: Introduce a resolver cache for sharing data between early doc link ↵Vadim Petrochenkov-2/+12
resolution and later passes
2022-01-06rustc_metadata: Split `fn get_implementations_for_trait` into two functionsVadim Petrochenkov-7/+2
2022-01-06rustc_metadata: Make `opt_item_ident` in decoder faster and stricterVadim Petrochenkov-3/+1
By avoiding formatting and allocations in the no-ident case, and by making the span mandatory if the ident exists. Use the optimized `opt_item_ident` to cleanup `fn each_child_of_item`
2022-01-06rustc_metadata: Make attribute decoding slightly faster and stricterVadim Petrochenkov-4/+2
Rename `CStore::item_attrs` -> `CStore::item_attrs_untracked` top follow conventions
2022-01-01rustc_metadata: Use a query for collecting all traits in encoderVadim Petrochenkov-25/+1
2021-12-31Auto merge of #92175 - Aaron1011:fix-missing-source-file, r=cjgillotbors-0/+4
Import `SourceFile`s from crate before decoding foreign `Span` Fixes #92163 Fixes #92014 When writing to the incremental cache, we encode all `Span`s we encounter, regardless of whether or not their `SourceFile` comes from the local crate, or from a foreign crate. When we decode a `Span`, we use the `StableSourceFileId` we encoded to locate the matching `SourceFile` in the current session. If this id corresponds to a `SourceFile` from another crate, then we need to have already imported that `SourceFile` into our current session. This usually happens automatically during resolution / macro expansion, when we try to resolve definitions from other crates. In certain cases, however, we may try to load a `Span` from a transitive dependency without having ever imported the `SourceFile`s from that crate, leading to an ICE. This PR fixes the issue by enconding the `SourceFile`'s `CrateNum` when we encode a `Span`. During decoding, we call `imported_source_files()` when we encounter a foreign `CrateNum`, which ensure that all `SourceFile`s from that crate are imported into the current session.