summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/rmeta/decoder.rs
AgeCommit message (Collapse)AuthorLines
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
2022-05-23Fix iterator implementation, add some inlinesMichael Goulet-3/+13
2022-05-23refine comments, disambiguate len for array and tablesMichael Goulet-6/+6
2022-05-23split out the various responsibilities of LazyMichael Goulet-150/+54
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-32/+32
2022-05-16Add a query for checking whether a function is an intrinsic.Oli Scherer-0/+4
2022-05-03Add support for a new attribute `#[debugger_visualizer]` to support ↵ridwanabdillahi-0/+4
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-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 #94493 - ↵Dylan DPC-0/+19
oribenshir:feature/ISSUE-78543_async_fn_in_foreign_crate_diag_2, r=davidtwco Improved diagnostic on failure to meet send bound on future in a foreign crate Provide a better diagnostic on failure to meet send bound on futures in a foreign crate. fixes #78543
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-16Auto merge of #95899 - petrochenkov:modchild2, r=cjgillotbors-57/+50
rustc_metadata: Do not encode unnecessary module children This should remove the syntax context shift and the special case for `ExternCrate` in decoder in https://github.com/rust-lang/rust/pull/95880. This PR also shifts some work from decoding to encoding, which is typically useful for performance (but probably not much in this case). r? `@cjgillot`
2022-04-16Provide a better diagnostic on failure to meet send bound on futures in a ↵oribenshir-0/+19
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-14library: Move `CStr` to libcore, and `CString` to liballocVadim Petrochenkov-9/+15
2022-04-13rustc_metadata: Do not encode unnecessary module childrenVadim Petrochenkov-57/+50
2022-04-10Directly encode DefId in metadata.Camille GILLOT-3/+19
2022-04-10Directly encode DefPathHash in metadata.Camille GILLOT-3/+3
2022-04-10Directly encode DefKind in metadata.Camille GILLOT-10/+14
2022-04-10Directly encode ImplPolarity in metadata.Camille GILLOT-0/+6
2022-04-07rustdoc: Early doc link resolution fixes and refactoringsVadim Petrochenkov-8/+12
2022-03-31Merge impl_constness and is_const_fn_raw.Camille GILLOT-14/+0
2022-03-31Create trait_def table.Camille GILLOT-34/+3