about summary refs log tree commit diff
path: root/src/librustc_metadata/decoder.rs
AgeCommit message (Collapse)AuthorLines
2019-11-07rustc_metadata: Move decoder/encoder/table into mod schemaVadim Petrochenkov-1392/+0
2019-11-03rustc_metadata: don't encode an empty slice for inferred_outlives.Eduard-Mihai Burtescu-1/+3
2019-11-03rustc_metadata: replace predicates_defined_on with explicit_predicates_of ↵Eduard-Mihai Burtescu-2/+10
and inferred_outlives_of.
2019-11-03rustc_metadata: remove predicates_of and rely on predicates_defined_on alone.Eduard-Mihai Burtescu-8/+0
2019-10-30Make init_locking return a reference to the initialized dataSantiago Pastorino-3/+1
2019-10-30Change CrateMetadata's source_map_import_info from RwLock to OnceSantiago Pastorino-79/+62
This field is created lazily on first use and after that is read only. That's exactly what Once is for.
2019-10-30Correctly indent get_predicates functionSantiago Pastorino-1/+1
2019-10-27rustc, rustc_passes: don't depend on syntax_expand.Mazdak Farrokhzad-4/+4
This is done by moving some data definitions to syntax::expand.
2019-10-25Rollup merge of #65074 - Rantanen:json-byte-pos, r=matkladMazdak Farrokhzad-1/+6
Fix the start/end byte positions in the compiler JSON output Track the changes made during normalization in the `SourceFile` and use this information to correct the `start_byte` and `end_byte` fields in the JSON output. This should ensure the start/end byte fields can be used to index the original file, even if Rust normalized the source code for parsing purposes. Both CRLF to LF and BOM removal are handled with this one. The rough plan was discussed with @matklad in rust-lang-nursery/rustfix#176 - although I ended up going with `u32` offset tracking so I wouldn't need to deal with `u32 + i32` arithmetics when applying the offset to the span byte positions. Fixes #65029
2019-10-23Rollup merge of #65657 - nnethercote:rm-InternedString-properly, r=eddybMazdak Farrokhzad-5/+4
Remove `InternedString` This PR removes `InternedString` by converting all occurrences to `Symbol`. There are a handful of places that need to use the symbol chars instead of the symbol index, e.g. for stable sorting; local conversions `LocalInternedString` is used in those places. r? @eddyb
2019-10-22rustc_metadata: use a table for impl_trait_ref.Eduard-Mihai Burtescu-2/+2
2019-10-22rustc_metadata: use a table for fn_sig.Eduard-Mihai Burtescu-11/+2
2019-10-22rustc_metadata: use a table for super_predicates.Eduard-Mihai Burtescu-10/+4
2019-10-21Fix the start/end byte positions in the compiler JSON outputMikko Rantanen-1/+6
2019-10-21Convert fields within `DefPathData` from `InternedString` to `Symbol`.Nicholas Nethercote-5/+4
It's a full conversion, except in `DefKey::compute_stable_hash()` where a `Symbol` now is converted to an `InternedString` before being hashed. This was necessary to avoid test failures.
2019-10-17Auto merge of #65495 - Centril:rollup-tguwjt5, r=Centrilbors-2/+2
Rollup of 8 pull requests Successful merges: - #65237 (Move debug_map assertions after check for err) - #65316 (make File::try_clone produce non-inheritable handles on Windows) - #65319 (InterpCx: make memory field public) - #65461 (Don't recommend ONCE_INIT in std::sync::Once) - #65465 (Move syntax::ext to a syntax_expand and refactor some attribute logic) - #65475 (add example for type_name) - #65478 (fmt::Write is about string slices, not byte slices) - #65486 (doc: fix typo in OsStrExt and OsStringExt) Failed merges: r? @ghost
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-2/+2
2019-10-15rustc_metadata: replace Entry table with one table for each of its fields ↵Eduard-Mihai Burtescu-97/+97
(AoS -> SoA).
2019-10-15rustc_metadata: use decoder::Metadata instead of &[u8] for Lazy<Table<T>>::get.Eduard-Mihai Burtescu-5/+5
2019-10-15rustc_metadata: generalize Table<T> to hold T, not Lazy<T>, elements.Eduard-Mihai Burtescu-3/+3
2019-10-15rustc_metadata: add a helper macro for recording into PerDefTable's.Eduard-Mihai Burtescu-1/+1
2019-10-15rustc_metadata: split tables into an usize-keyed Table and a DefIndex-keyed ↵Eduard-Mihai Burtescu-3/+3
PerDefTable.
2019-10-15rustc_metadata: replace Lazy<[Table<T>]> with Lazy<Table<T>>.Eduard-Mihai Burtescu-5/+14
2019-10-15rustc_metadata: rename index::Index to table::Table.Eduard-Mihai Burtescu-1/+1
2019-10-15rustc_metadata: use NonZeroUsize for the position of a Lazy.Eduard-Mihai Burtescu-7/+13
2019-10-14rustc_metadata: Privatize private code and remove dead codeVadim Petrochenkov-71/+73
2019-10-14Auto merge of #65240 - michaelwoerister:sp-review-3, r=Mark-Simulacrumbors-0/+25
self-profiling: Add events for metadata loading (plus a small dep-tracking optimization) This PR - adds self-profiling events related to loading things from crate metadata - makes the compiler cache the `DepNodeIndex` of upstream crates, so that they don't have to be looked up over and over. The commits are best reviewed in isolation. Self-profiling tracking issue: https://github.com/rust-lang/rust/issues/58967 r? @Mark-Simulacrum cc @wesleywiser
2019-10-10Auto merge of #65153 - da-x:issue-58017, r=petrochenkovbors-3/+3
Improve message when attempting to instantiate tuple structs with private fields Fixes #58017, fixes #39703. ``` error[E0603]: tuple struct `Error` is private --> main.rs:22:16 | 2 | pub struct Error(usize, pub usize, usize); | ----- ----- field is private | | | field is private ... 22 | let x = a::Error(3, 1, 2); | ^^^^^ | = note: a tuple struct constructor is private if any of its fields is private ```
2019-10-10Add 'unlikely' annotation to branch in crate DepNodeIndex caching.Michael Woerister-1/+1
2019-10-09resolve: Keep field spans for diagnosticsVadim Petrochenkov-3/+3
2019-10-09Cache the DepNodeIndex of upstream crates in order to avoid multiple locks ↵Michael Woerister-0/+25
and table lookups on each access of crate metadata.
2019-10-04Fix lonely backtickYechan Bae-1/+1
2019-10-04Rollup merge of #65026 - petrochenkov:ice1, r=eddybMazdak Farrokhzad-7/+2
metadata: Some crate loading cleanup So, my goal was to fix caching of loaded crates which is broken and causes ICEs like #56935 or #64450. While investigating I found that the code is pretty messy and likes to confuse various things that look similar but are actually different. This PR does some initial cleanup in that area, I hope to get to the caching itself a bit later.
2019-10-04metadata: Remove `CrateMetadata::name`Vadim Petrochenkov-1/+1
It duplicates `CrateRoot::name`
2019-10-04metadata: Remove `CrateMetadata::host_lib`Vadim Petrochenkov-6/+1
It was only used for retreiving edition, which was a bug. In case of dual proc macros the edition should be taken from the target crate version, like any other metadata.
2019-09-30Remove HIR based const qualificationMatthew Jasper-8/+0
2019-09-29remove indexed_vec re-export from rustc_data_structurescsmoe-1/+1
2019-09-26Auto merge of #62661 - arielb1:never-reserve, r=nikomatsakisbors-1/+1
reserve `impl<T> From<!> for T` this is necessary for never-type stabilization. cc #57012 #35121 I think we wanted a crater run for this @nikomatsakis? r? @nikomatsakis
2019-09-25Rollup merge of #64599 - csmoe:doc_async_reexport, r=nikomatsakisMazdak Farrokhzad-0/+9
Rustdoc render async function re-export Closes #63710 r? @nikomatsakis
2019-09-24resolve the rustc_reservation_impl attribute in 1 placeAriel Ben-Yehuda-1/+1
2019-09-24bug-out asyncness query on non-local funtionscsmoe-1/+2
2019-09-21rename is_async_fn to asyncnesscsmoe-4/+3
2019-09-19add is_async_fn querycsmoe-0/+9
2019-09-17Generate proc macro harness in AST order.Aaron Hill-1/+5
This ensures that we match the order used by proc macro metadata serialization. Fixes #64251
2019-08-30Add a "diagnostic item" schemeOliver Scherer-0/+18
This allows lints and other diagnostics to refer to items by a unique ID instead of relying on whacky path resolution schemes that may break when items are relocated.
2019-08-29Rollup merge of #63867 - petrochenkov:dhelpers, r=matthewjasperMazdak Farrokhzad-3/+1
resolve: Block expansion of a derive container until all its derives are resolved So, it turns out there's one more reason to block expansion of a `#[derive]` container until all the derives inside it are resolved, beside `Copy` (https://github.com/rust-lang/rust/pull/63248). The set of derive helper attributes registered by derives in the container also has to be known before the derives themselves are expanded, otherwise it may be too late (see https://github.com/rust-lang/rust/pull/63468#issuecomment-524550872 and the `#[stable_hasher]`-related test failures in https://github.com/rust-lang/rust/pull/63468). So, we stop our attempts to unblock the container earlier, as soon as the `Copy` status is known, and just block until all its derives are resolved. After all the derives are resolved we immediately go and process their helper attributes in the item, without delaying it until expansion of the individual derives. Unblocks https://github.com/rust-lang/rust/pull/63468 r? @matthewjasper (as a reviewer of https://github.com/rust-lang/rust/pull/63248) cc @c410-f3r
2019-08-29Rollup merge of #63933 - wesleywiser:cleanup_from_move_promoted, r=oli-obkMazdak Farrokhzad-15/+23
Resolve some small issues related to #63580 This resolves some feedback left on #63580 after it was merged: - Adds documentation to `mir::Static` and `mir::StaticKind` - Simplifies `maybe_get_optimized_mir()` and `maybe_get_promoted_mir()` cc @bjorn3 @RalfJung
2019-08-28Extract `Decoder::entry_unless_proc_macro()`Wesley Wiser-22/+20
2019-08-28Simplify `maybe_get_optimized_mir` and `maybe_get_promoted_mir`Wesley Wiser-11/+21
Since both functions are always unwrapped, don't wrap the return value in an `Option`.
2019-08-28Auto merge of #63127 - kper:pr, r=nikomatsakisbors-5/+5
Cleanup: Consistently use `Param` instead of `Arg` #62426 Fixes #62426