summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/rmeta/decoder
AgeCommit message (Collapse)AuthorLines
2022-08-01Remove trait_of_item query.Camille GILLOT-1/+0
2022-07-24Do not prefer module parents which are `doc(hidden)` in visibility mapMichael Goulet-5/+15
2022-07-20passes: improved partial stabilization diagnosticDavid Wood-0/+3
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-02Auto merge of #97235 - nbdd0121:unwind, r=Amanieubors-1/+1
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-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-06-08Rename `panic_strategy` query to `required_panic_strategy`Gary Guo-1/+1
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