summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/rmeta/decoder.rs
AgeCommit message (Collapse)AuthorLines
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
2022-08-20rmeta/query cache: don't write string values of preinterned symbolsklensy-0/+4
2022-08-19Auto merge of #100209 - cjgillot:source-file-index, r=estebankbors-126/+102
Lazily decode SourceFile from metadata Currently, source files from foreign crates are decoded up-front from metadata. Spans from those crates were matched with the corresponding source using binary search among those files. This PR changes the strategy by matching spans to files during encoding. This allows to decode source files on-demand, instead of up-front. The on-disk format for spans becomes: `<tag> <position from start of file> <length> <file index> <crate (if foreign file)>`.
2022-08-15cache strings while encoding/decoding to compiler artifactsklensy-0/+29
2022-08-08Remove unused parameter.Camille GILLOT-1/+0
2022-08-07Only encode position from start of file.Camille GILLOT-10/+8
2022-08-06Support parallel compiler.Camille GILLOT-4/+3
2022-08-06Remove unused cache.Camille GILLOT-10/+0
2022-08-06Decode SourceFile out of order.Camille GILLOT-93/+94
2022-08-06Encode index of SourceFile along with span.Camille GILLOT-22/+11
2022-08-01Remove trait_of_item query.Camille GILLOT-13/+0
2022-08-01Remove DefId from AssocItemContainer.Camille GILLOT-9/+4
2022-08-01Remove visibility from AssocItem.Camille GILLOT-1/+0
2022-08-01Store associated item defaultness in impl_defaultness.Camille GILLOT-1/+0
2022-07-27Update mentions to `rustc_metadata::rmeta::Lazy`Yuki Okushi-1/+1
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-07-24remove new allocations from imported_source_filesPietro Albini-20/+20
2022-07-20passes: improved partial stabilization diagnosticDavid Wood-0/+7
Improves the diagnostic when a feature attribute is specified unnecessarily but the feature implies another (i.e. it was partially stabilized) to refer to the implied feature. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-14Rollup merge of #99000 - JulianKnodt:allow_resolve_no_substs, r=lcnrDylan DPC-2/+1
Move abstract const to middle Moves AbstractConst (and all associated methods) to rustc middle for use in `rustc_infer`. This allows for const resolution in infer to use abstract consts to walk consts and check if they are resolvable. This attempts to resolve the issue where `Foo<{ concrete const }, generic T>` is incorrectly marked as conflicting, and is independent from the other issue where nested abstract consts must be resolved. r? `@lcnr`
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-3/+3
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-12Move abstract const to rustc_middle::tykadmin-2/+1
2022-07-02Auto merge of #97235 - nbdd0121:unwind, r=Amanieubors-2/+2
Fix FFI-unwind unsoundness with mixed panic mode UB maybe introduced when an FFI exception happens in a `C-unwind` foreign function and it propagates through a crate compiled with `-C panic=unwind` into a crate compiled with `-C panic=abort` (#96926). To prevent this unsoundness from happening, we will disallow a crate compiled with `-C panic=unwind` to be linked into `panic-abort` *if* it contains a call to `C-unwind` foreign function or function pointer. If no such call exists, then we continue to allow such mixed panic mode linking because it's sound (and stable). In fact we still need the ability to do mixed panic mode linking for std, because we only compile std once with `-C panic=unwind` and link it regardless panic strategy. For libraries that wish to remain compile-once-and-linkable-to-both-panic-runtimes, a `ffi_unwind_calls` lint is added (gated under `c_unwind` feature gate) to flag any FFI unwind calls that will cause the linkable panic runtime be restricted. In summary: ```rust #![warn(ffi_unwind_calls)] mod foo { #[no_mangle] pub extern "C-unwind" fn foo() {} } extern "C-unwind" { fn foo(); } fn main() { // Call to Rust function is fine regardless ABI. foo::foo(); // Call to foreign function, will cause the crate to be unlinkable to panic-abort if compiled with `-Cpanic=unwind`. unsafe { foo(); } //~^ WARNING call to foreign function with FFI-unwind ABI let ptr: extern "C-unwind" fn() = foo::foo; // Call to function pointer, will cause the crate to be unlinkable to panic-abort if compiled with `-Cpanic=unwind`. ptr(); //~^ WARNING call to function pointer with FFI-unwind ABI } ``` Fix #96926 `@rustbot` label: T-compiler F-c_unwind
2022-06-29Rollup merge of #97786 - ferrocene:pa-fix-simulate-remap-prefix, ↵Dylan DPC-16/+22
r=Mark-Simulacrum Account for `-Z simulate-remapped-rust-src-base` when resolving remapped paths Discovered in #97682, `-Z simulate-remapped-rust-src-base` only partially simulated the behavior of `remap-debuginfo = true`. While the flag successfully simulates the remapping when stdlib's `rmeta` file is loaded, the simulated prefix was not accounted for when the remapped path's local path was being discovered. This caused the flag to not fully simulate the behavior of `remap-debuginfo = true`, leading to inconsistent behaviors. This PR fixes https://github.com/rust-lang/rust/issues/97682 by also accounting for the simulated path.
2022-06-14Rename rustc_serialize::opaque::Encoder as MemEncoder.Nicholas Nethercote-4/+5
This avoids the name clash with `rustc_serialize::Encoder` (a trait), and allows lots qualifiers to be removed and imports to be simplified (e.g. fewer `as` imports). (This was previously merged as commit 5 in #94732 and then was reverted in #97905 because of a perf regression caused by commit 4 in #94732.)
2022-06-13account for simulated remap-debuginfo when resolving remapped pathsPietro Albini-16/+22
2022-06-11Auto merge of #95880 - cjgillot:def-ident-span, r=petrochenkovbors-11/+2
Handle `def_ident_span` like `def_span`. `def_ident_span` had an ad-hoc status in the compiler. This PR refactors it to be a first-class citizen like `def_span`: - it gets encoded in the main metadata loop, instead of the visitor; - its implementation is updated to mirror the one of `def_span`. We do not remove the `Option` in the return type, since some items do not have an ident, AnonConsts for instance.
2022-06-10Assert def_ident_span presence.Camille GILLOT-1/+2
2022-06-10Encode def_ident_span using the query.Camille GILLOT-11/+1
2022-06-08Rename `panic_strategy` query to `required_panic_strategy`Gary Guo-2/+2
2022-06-08Fix FFI-unwind unsoundness with mixed panic modeGary Guo-1/+1
2022-06-08Rename `rustc_serialize::opaque::Encoder` as `MemEncoder`.Nicholas Nethercote-4/+5
This avoids the name clash with `rustc_serialize::Encoder` (a trait), and allows lots qualifiers to be removed and imports to be simplified (e.g. fewer `as` imports).
2022-06-06fix #71363 test by adding `-Z translate-remapped-path-to-local-path=no`Pietro Albini-0/+2
The test relies on library/std/src/error.rs not corresponding to a local path, but remapping might still find the related local file of a remapped path. To fix the test, this adds a new -Z flag to disable finding the corresponding local path of a remapped path.
2022-05-28Make TyCtxt implement Interner, make HashStable generic and move to ↵Michael Goulet-3/+3
rustc_type_ir
2022-05-28Remove some comments, inline interner fnMichael Goulet-0/+1
2022-05-28Initial fixes on top of type interner commitMichael Goulet-5/+6
2022-05-27Auto merge of #97004 - nnethercote:proc-macro-tweaks, r=eddybbors-2/+2
Proc macro tweaks Various improvements I spotted while looking through the proc macro code. r? `@eddyb`
2022-05-27Rename `ProcMacroDerive` as `DeriveProcMacro`.Nicholas Nethercote-2/+2
So it matches the existing `AttrProcMacro` and `BangProcMacro` types.
2022-05-26Auto merge of #97386 - nnethercote:optimize-pos-adjustments, r=bjorn3bors-22/+4
Optimize position adjustments A small improvement. r? `@bjorn3`
2022-05-26Avoid adjusting file positions twice.Nicholas Nethercote-22/+4
`imported_source_files` adjusts lots of file positions, and then calls `new_imported_source_file`, which then adjust them all again. This commit combines the two adjustments into one, for a small perf win.
2022-05-24Make Lazy not care about lifetimes until decodeMichael Goulet-11/+23