about summary refs log tree commit diff
path: root/src/librustc_metadata/cstore_impl.rs
AgeCommit message (Collapse)AuthorLines
2019-11-07rustc_metadata: Move cstore_impl into mod decoderVadim Petrochenkov-533/+0
2019-11-07rustc_metadata: Move decoder/encoder/table into mod schemaVadim Petrochenkov-2/+1
2019-11-07Rollup merge of #59789 - eddyb:typeck-reverts, r=nikomatsakisMazdak Farrokhzad-2/+2
Revert two unapproved changes to rustc_typeck. There was a breakdown in process (https://github.com/rust-lang/rust/pull/59004#issuecomment-477600735, https://github.com/rust-lang/rust/pull/58894#discussion_r272795560) and two changes were made to `rustc_typeck`'s "collect" queries, for rustdoc, that were neither needed *nor* correct. I'm reverting them here, and will fix up rustdoc *somehow*, if necessary. cc @rust-lang/compiler How do we ensure this doesn't happen again? r? @nikomatsakis or @oli-obk
2019-11-04Auto merge of #65838 - estebank:resilient-recovery, r=Centrilbors-1/+1
Reduce amount of errors given unclosed delimiter When in a file with a non-terminated item, catch the error and consume the block instead of trying to recover it on a more granular way in order to reduce the amount of unrelated errors that would be fixed after adding the missing closing brace. Also point out the possible location of the missing closing brace. Fix #63690.
2019-11-03rustc_metadata: replace predicates_defined_on with explicit_predicates_of ↵Eduard-Mihai Burtescu-1/+2
and inferred_outlives_of.
2019-11-03rustc_metadata: remove predicates_of and rely on predicates_defined_on alone.Eduard-Mihai Burtescu-1/+0
2019-11-01Rollup merge of #66018 - pnkfelix:issue-64872-revert-64324, r=alexcrichtonTyler Mandry-21/+5
Revert PR 64324: dylibs export generics again (for now) As discussed on PR #65781, this is a targeted attempt to undo the main semantic change from PR #64324, by putting `dylib` back in the set of crate types that export generic symbols. The main reason to do this is that PR #64324 had unanticipated side-effects that caused bugs like #64872, and in the opinion of @alexcrichton and myself, the impact of #64872 is worse than #64319. In other words, it is better for us, in the short term, to reopen #64319 as currently unfixed for now than to introduce new bugs like #64872. Fix #64872 Reopen #64319
2019-11-01targeted revert of PR rust-lang/rust#64324 (just undo change to dylib ↵Felix S. Klock II-21/+5
generics export). Includes the anticipated fallout to run-make-fulldeps test suite from this change. (We need to reopen issue 64319 as part of landing this.)
2019-10-31Implement dual proc macro hashingmsizanoen-0/+4
This changes the mechanism of `-Z dual-proc-macro` to record the host proc macro hash in the transistive dependency information and use it during dependency resolution instead of resolving only by name.
2019-10-30Do not complain about missing `fn main()` in some casesEsteban Küber-1/+1
2019-10-24rustc_metadata: Minimize use of `Lrc` in crate storeVadim Petrochenkov-5/+5
Crate metadatas are still stored as `Lrc<CrateMetadata>` in `CStore` because crate store has to be cloneable due to `Resolver::clone_outputs`.
2019-10-24Turn crate store into a resolver outputVadim Petrochenkov-6/+1
2019-10-21Convert fields within `DefPathData` from `InternedString` to `Symbol`.Nicholas Nethercote-1/+1
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-18rustc: arena-allocate the slice in `ty::GenericsPredicate`, not the whole ↵Eduard-Mihai Burtescu-5/+3
struct.
2019-10-14rustc_metadata: Remove resolutions for extern crate items from `CStore`Vadim Petrochenkov-5/+0
Use a more traditional scheme with providing them as a resolver output
2019-10-14rustc_metadata: Privatize private code and remove dead codeVadim Petrochenkov-16/+5
2019-10-14Auto merge of #65240 - michaelwoerister:sp-review-3, r=Mark-Simulacrumbors-20/+11
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-2/+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-09resolve: Keep field spans for diagnosticsVadim Petrochenkov-2/+3
2019-10-09Remove some outdated comments about dependency tracking from cstore_impl.Michael Woerister-10/+0
2019-10-09self-profiling: Add events for tracking crate metadata loading related ↵Michael Woerister-0/+5
activities.
2019-10-09Cache the DepNodeIndex of upstream crates in order to avoid multiple locks ↵Michael Woerister-10/+6
and table lookups on each access of crate metadata.
2019-10-07Add feature gate for raw_dylib.Charles Lew-1/+5
2019-10-04Rollup merge of #65026 - petrochenkov:ice1, r=eddybMazdak Farrokhzad-4/+3
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-3/+3
It duplicates `CrateRoot::name`
2019-10-04metadata: Remove `CrateMetadata::imported_name`Vadim Petrochenkov-2/+1
It's entirely irrelevant to crate loading
2019-09-30Remove HIR based const qualificationMatthew Jasper-3/+0
2019-09-29remove bit_set re-export from rustc_data_structurescsmoe-1/+1
2019-09-28Rollup merge of #64678 - tomtau:fix/no-std-error, r=matthewjasperMazdak Farrokhzad-1/+1
added more context for duplicate lang item errors (fixes #60561) Some more information about #60561 -- these errors are pretty common when one works in restrictive environments with `no_std` or customized `std`, but they don't provide much context for debugging, as any transitive dependency could have brought in `std` crate. With that, currently, one needs to use something like `cargo tree` and investigate transitive dependencies one by one. It'll be more helpful to know at least the crate that uses `std` (which `cargo tree` doesn't show) to pin down this investigation when debugging. I'm not sure what the best way to get this context is inside rustc internals (I'm new to them). I found that `all_crate_nums` query returns the crates in some dependency order, so printing out the name of the preceding crate seems to do the trick. But I welcome suggestions if this can be done in a better way.
2019-09-27getting more context for duplicate lang items (fixes #60561)Tomas Tauber-1/+1
Where possible, the error message includes the name of the crate that brought in the crate with duplicate lang items (which helps with debugging). This information is passed on from cstore using the `extern_crate` query.
2019-09-26Rename `Item.node` to `Item.kind`varkor-1/+1
2019-09-25Rollup merge of #64599 - csmoe:doc_async_reexport, r=nikomatsakisMazdak Farrokhzad-0/+1
Rustdoc render async function re-export Closes #63710 r? @nikomatsakis
2019-09-23Allow using upstream generics in a dylib crate typeAlex Crichton-7/+6
... just don't export them!
2019-09-23rustc: Fix mixing crates with different `share_generics`Alex Crichton-1/+26
This commit addresses #64319 by removing the `dylib` crate type from the list of crate type that exports generic symbols. The bug in #64319 arises because a `dylib` crate type was trying to export a symbol in an uptream crate but it miscalculated the symbol name of the uptream symbol. This isn't really necessary, though, since `dylib` crates aren't that heavily used, so we can just conservatively say that the `dylib` crate type never exports generic symbols, forcibly removing them from the exported symbol lists if were to otherwise find them. The fix here happens in two places: * First is in the `local_crate_exports_generics` method, indicating that it's now `false` for the `Dylib` crate type. Only rlibs actually export generics at this point. * Next is when we load exported symbols from upstream crate. If, for our compilation session, the crate may be included from a dynamic library, then its generic symbols are removed. When the crate was linked into a dynamic library its symbols weren't exported, so we can't consider them a candidate to link against. Overally this should avoid situations where we incorrectly calculate the upstream symbol names in the face of differnet `share_generics` options, ultimately... Closes #64319
2019-09-23rustc: Convert `dependency_formats` to a queryAlex Crichton-0/+5
This commit converts a field of `Session`, `dependency_formats`, into a query of `TyCtxt`. This information then also needed to be threaded through to other remaining portions of the linker, but it's relatively straightforward. The only change here is that instead of `HashMap<CrateType, T>` the data structure changed to `Vec<(CrateType, T)>` to make it easier to deal with in queries.
2019-09-21rename is_async_fn to asyncnesscsmoe-1/+1
2019-09-19append asyncness info to functionscsmoe-1/+1
2019-09-19add is_async_fn querycsmoe-0/+1
2019-09-15Avoid some unnecessary `&str` to `Ident` conversionsMatthew Jasper-1/+2
2019-08-30Add a "diagnostic item" schemeOliver Scherer-0/+1
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 #63933 - wesleywiser:cleanup_from_move_promoted, r=oli-obkMazdak Farrokhzad-18/+2
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-28Simplify `maybe_get_optimized_mir` and `maybe_get_promoted_mir`Wesley Wiser-18/+2
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-1/+1
Cleanup: Consistently use `Param` instead of `Arg` #62426 Fixes #62426
2019-08-27Cleanup: Consistently use `Param` instead of `Arg` #62426Kevin Per-1/+1
2019-08-27metadata: Eliminate `FullProcMacro`Vadim Petrochenkov-1/+1
Fix caching of loaded proc macros
2019-08-27proc_macro: Turn `quote` into a regular built-in macroVadim Petrochenkov-11/+1
Previously in was implemented using a special hack in the metadata loader
2019-08-22Move promoted out of mir::BodyWesley Wiser-0/+9
2019-08-17Serialize additional data for procedural macrosAaron Hill-3/+4
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-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-07-27Move proc macro server into libsyntaxVadim Petrochenkov-1/+1