about summary refs log tree commit diff
path: root/src/librustc_metadata/decoder.rs
AgeCommit message (Collapse)AuthorLines
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
2019-08-27Cleanup: Consistently use `Param` instead of `Arg` #62426Kevin Per-5/+5
2019-08-27metadata: Eliminate `FullProcMacro`Vadim Petrochenkov-35/+18
Fix caching of loaded proc macros
2019-08-27Respect attributes on proc macro definitionsVadim Petrochenkov-8/+10
2019-08-27resolve: Block expansion of a derive container until all its derives are ↵Vadim Petrochenkov-3/+1
resolved Also mark derive helpers as known as a part of the derive container's expansion instead of expansion of the derives themselves which may happen too late.
2019-08-22Resolve PR commentsWesley Wiser-2/+5
2019-08-22Fix tidyWesley Wiser-1/+2
2019-08-22Move promoted out of mir::BodyWesley Wiser-1/+9
2019-08-20rustc_metadata: replace LazySeq<T> with Lazy<[T]>.Eduard-Mihai Burtescu-16/+19
2019-08-18Auto merge of #63269 - Aaron1011:feature/proc-macro-data, r=eddyb,petrochenkovbors-71/+113
Serialize additional data for procedural macros Split off from #62855 This PR serializes the declaration `Span` and attributes for all procedural macros. This allows Rustdoc to properly render doc comments and source links when performing inlinig procedural macros across crates
2019-08-17Serialize additional data for procedural macrosAaron Hill-71/+113
Split off from #62855 This PR deerializes the declaration `Span` and attributes for all procedural macros from their underlying function definitions. This allows Rustdoc to properly render doc comments and source links when inlining procedural macros across crates
2019-08-17Remove unused `SyntaxContext` serialization implsMatthew Jasper-8/+0
The implementations were wrong and unused.
2019-08-17Stop emulating cross-crate hygiene with gensymsMatthew Jasper-0/+16
Most `Ident`s are serialized as `InternedString`s the exceptions are: * Reexports * Attributes * Idents in macro definitions Using gensyms helped reexports emulate hygiene. However, the actual item wouldn't have a gensymmed name so would be usable cross-crate. So removing this case until we have proper cross-crate hygiene seems sensible. Codegen attributes (`inline`, `export_name`) are resolved by their `Symbol`. This meant that opaque macro-expanded codegen attributes could cause linker errors. This prevented making built-in derives hygienic.
2019-08-15`Ident::with_empty_ctxt` -> `Ident::with_dummy_span`Vadim Petrochenkov-4/+4
`Ident` has had a full span rather than just a `SyntaxContext` for a long time now.
2019-08-15syntax_pos: `NO_EXPANSION`/`SyntaxContext::empty()` -> `SyntaxContext::root()`Vadim Petrochenkov-2/+2
For consistency with `ExpnId::root`. Also introduce a helper `Span::with_root_ctxt` for creating spans with `SyntaxContext::root()` context
2019-08-03Rollup merge of #63146 - Mark-Simulacrum:clean-attr, r=petrochenkovMazdak Farrokhzad-8/+1
Cleanup syntax::attr Mostly removing needless arguments to constructors r? @petrochenkov
2019-08-02Replace "existential" by "opaque"varkor-4/+4
2019-07-31Decode AttrId via mk_attr_idMark Rousskov-8/+1
2019-07-19libsyntax: Remove `Mark` into `ExpnId`Vadim Petrochenkov-2/+2
2019-06-19Rollup merge of #61898 - petrochenkov:sekind, r=eddybMazdak Farrokhzad-3/+4
syntax: Factor out common fields from `SyntaxExtension` variants And some other related cleanups. Continuation of https://github.com/rust-lang/rust/pull/61606. This will also help to unblock https://github.com/rust-lang/rust/pull/61877.
2019-06-18rustc: reintroduce lifetime bounds where necessary.Eduard-Mihai Burtescu-11/+9
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-3/+3
2019-06-18syntax: Factor out common fields from `SyntaxExtension` variantsVadim Petrochenkov-3/+4
2019-06-14Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-15/+4
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-23/+23
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-47/+39
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-23/+23