about summary refs log tree commit diff
path: root/src/librustc_metadata
AgeCommit message (Collapse)AuthorLines
2019-12-02Fix remaining compilation issuesPaul Daniel Faria-4/+10
2019-12-02Simplify BodyCache impl and fix all remaining type errors in librustc_mir ↵Paul Daniel Faria-6/+5
(lifetime errors still exist)
2019-12-02Fix typo caused by rebasingPaul Daniel Faria-1/+1
2019-12-02Move predecessors cache back to its own typePaul Daniel Faria-1/+1
This ensures that the cache can be properly ignored during encoding and decoding. Fix panics that arose due to lack of encoding
2019-11-30Rollup merge of #66895 - Centril:rustc_feature, r=oli-obkMazdak Farrokhzad-17/+19
Feature gating *declarations* => new crate `rustc_feature` This PR moves the data-oriented parts of feature gating into its own crate, `rustc_feature`. The parts consist of some data types as well as `accepted`, `active`, `removed`, and `builtin_attrs`. Feature gate checking itself remains in `syntax::feature_gate::check`. The parts which define how to emit feature gate errors could probably be moved to `rustc_errors` or to the new `rustc_session` crate introduced in #66878. The visitor itself could probably be moved as a pass in `rustc_passes` depending on how the dependency edges work out. The PR also contains some drive-by cleanup of feature gate checking. As such, the PR probably best read commit-by-commit. r? @oli-obk cc @petrochenkov cc @Mark-Simulacrum
2019-11-30move GateIssue to rustc_feature & simplify emit_feature_errMazdak Farrokhzad-17/+19
2019-11-28rustc: Move some queries to `rustc_metadata`Vadim Petrochenkov-23/+21
2019-11-28rustc_metadata: Avoid some side effects during speculative crate resolutionVadim Petrochenkov-28/+5
Namely, `update_extern_crate`. Also, stop tracking visited crates in `update_extern_crate`, the rank check does the same thing (prevents visiting dependencies if the rank didn't change), but more precisely.
2019-11-28rustc_metadata: Pass SVH by valueVadim Petrochenkov-11/+10
2019-11-28rustc_metadata: Move `has_global_allocator` from session to cstoreVadim Petrochenkov-19/+21
2019-11-28rustc_metadata: Privatize some fields and methods of `CStore`Vadim Petrochenkov-7/+15
After it's moved to `creader.rs`
2019-11-28rustc_metadata: Merge `cstore.rs` into `creader.rs`Vadim Petrochenkov-114/+98
2019-11-28rustc_metadata: Privatize `CrateMetadata::root`Vadim Petrochenkov-16/+32
2019-11-28rustc_metadata: Privatize all fields of `CrateRoot`Vadim Petrochenkov-57/+105
All of them are read-only
2019-11-28rustc_metadata: Privatize `CrateMetadata::dep_kind`Vadim Petrochenkov-6/+12
2019-11-28rustc_metadata: Privatize `CrateMetadata::source`Vadim Petrochenkov-6/+10
2019-11-28rustc_metadata: Privatize `CrateMetadata::extern_crate`Vadim Petrochenkov-31/+16
2019-11-28rustc_metadata: Privatize `CrateMetadata::dependencies`Vadim Petrochenkov-5/+13
2019-11-28rustc_metadata: Cleanup generation of crate dependency listsVadim Petrochenkov-33/+28
2019-11-27rustc_metadata: use a macro to deduplicate LazyPerDefTables and ↵Eduard-Mihai Burtescu-69/+47
PerDefTableBuilders.
2019-11-27rustc_metadata: remove Encodable requirements from LazyMeta impls.Eduard-Mihai Burtescu-12/+11
2019-11-27rustc_metadata: use a separate TableBuilder type to build a Table.Eduard-Mihai Burtescu-33/+39
2019-11-27rustc_metadata: replace PerDefTable<T> with Table<DefIndex, T>.Eduard-Mihai Burtescu-113/+68
2019-11-25Tweak multiple allocators errorEsteban Küber-1/+3
2019-11-20Rollup merge of #66496 - petrochenkov:metapriv2, r=eddybMazdak Farrokhzad-282/+343
rustc_metadata: Privatize more things Continuation of https://github.com/rust-lang/rust/pull/66056. The most notable change here is that `CrateMetadata` is moved from `cstore.rs` to `decoder.rs`. Most of uses of `CrateMetadata` fields are in the decoder and uses of `root: CrateRoot` and other fields are so intertwined with each other that it would be hard to move a part of them into `cstore.rs` to privatize `CrateMetadata` fields, so we are going the other way round. `cstore.rs` can probably be dismantled now, but I'll leave this to some other day. Similarly, remaining `CrateMetadata` fields can be privatized by introducing some getter/setter methods, but not today. r? @eddyb
2019-11-17rustc_metadata: Cleanup crate search with exact pathsVadim Petrochenkov-26/+22
2019-11-17rustc_metadata: Remove `CrateMetadata::is_proc_macro_crate`Vadim Petrochenkov-12/+8
2019-11-17rustc_metadata: Stop leaking `Lazy` from the `rmeta` moduleVadim Petrochenkov-22/+36
2019-11-17rustc_metadata: Move `CrateMetadata` into `decoder.rs`Vadim Petrochenkov-142/+135
It allows to make most of its fields private
2019-11-17rustc_metadata: Give a constructor to `CratePaths`Vadim Petrochenkov-3/+9
2019-11-17rustc_metadata: Minor cleanupVadim Petrochenkov-3/+3
2019-11-17rustc_metadata: Give a constructor to `CrateMetadata`Vadim Petrochenkov-34/+53
2019-11-17rustc_metadata: Give a constructor to `CrateLocator`Vadim Petrochenkov-48/+81
2019-11-17rustc_metadata: `locator::Context` -> `CrateLocator`Vadim Petrochenkov-26/+26
2019-11-17rustc_metadata: Move some structs from `cstore` to `decoder`Vadim Petrochenkov-27/+31
This allows to privatize their fields.
2019-11-15Remove newtype for qualifs in `rustc_metadata`Dylan MacKenzie-17/+12
We have a proper type for these now, so the wrapper is no longer necessary.
2019-11-15Fix nits from reviewDylan MacKenzie-2/+2
2019-11-15Use a bespoke type for the result of `mir_const_qualif`Dylan MacKenzie-3/+7
2019-11-14Remove unused error_codes.rs filesGuillaume Gomez-97/+0
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-2/+7
2019-11-11Move allocator_kind to CrateStoreMark Rousskov-5/+13
Similarly to the previous commit, there's no need for this to be in Session and have a Once around it.
2019-11-11Move injected_panic_runtime to CrateStoreMark Rousskov-6/+11
This was essentially a "query" previously (with no key, just always run once when resolving the crate dependencies), and remains so, just now in a way that isn't on Session. This removes the need for the `Once` as well.
2019-11-11Auto merge of #66252 - cjgillot:trees, r=oli-obkbors-6/+8
Merge repeated definitions Step forward on #66149 I may need further context to understand the need for a separate crate. Also, please tell me if you think of other definitions to merge.
2019-11-10Auto merge of #65324 - Centril:organize-syntax, r=petrochenkovbors-2/+3
Split libsyntax apart In this PR the general idea is to separate the AST, parser, and friends by a more data / logic structure (tho not fully realized!) by separating out the parser and macro expansion code from libsyntax. Specifically have now three crates instead of one (libsyntax): - libsyntax: - concrete syntax tree (`syntax::ast`) - definition of tokens and token-streams (`syntax::{token, tokenstream}`) -- used by `syntax::ast` - visitors (`syntax::visit`, `syntax::mut_visit`) - shared definitions between `libsyntax_expand` - feature gating (`syntax::feature_gate`) -- we could possibly move this out to its own crater later. - attribute and meta item utilities, including used-marking (`syntax::attr`) - pretty printer (`syntax::print`) -- this should possibly be moved out later. For now I've reduced down the dependencies to a single essential one which could be broken via `ParseSess`. This entails that e.g. `Debug` impls for `Path` cannot reference the pretty printer. - definition of `ParseSess` (`syntax::sess`) -- this is used by `syntax::{attr, print, feature_gate}` and is a common definition used by the parser and other things like librustc. - the `syntax::source_map` -- this includes definitions used by `syntax::ast` and other things but could ostensibly be moved `syntax_pos` since that is more related to this module. - a smattering of misc utilities not sufficiently important to itemize -- some of these could be moved to where they are used (often a single place) but I wanted to limit the scope of this PR. - librustc_parse: - parser (`rustc_parse::parser`) -- reading a file and such are defined in the crate root tho. - lexer (`rustc_parse::lexer`) - validation of meta grammar (post-expansion) in (`rustc_parse::validate_attr`) - libsyntax_expand -- this defines the infra for macro expansion and conditional compilation but this is not libsyntax_ext; we might want to merge them later but currently libsyntax_expand is depended on by librustc_metadata which libsyntax_ext is not. - conditional compilation (`syntax_expand::config`) -- moved from `syntax::config` to here - the bulk of this crate is made up of the old `syntax::ext` r? @estebank
2019-11-10Fix tidy.Camille GILLOT-2/+4
2019-11-10Merge hir::Mutability into ast::Mutability.Camille GILLOT-6/+6
2019-11-10move syntax::parse -> librustc_parseMazdak Farrokhzad-2/+3
also move MACRO_ARGUMENTS -> librustc_parse
2019-11-10Rollup merge of #66235 - eddyb:coff-syrup, r=nagisaYuki Okushi-6/+3
rustc_metadata: don't let LLVM confuse rmeta blobs for COFF object files. This has likely been a silent issue since 1.10 but only caused trouble recently (see https://github.com/rust-lang/rust/issues/65536#issuecomment-552018224), when recent changes to the `rmeta` schema introduced more opportunities for COFF parse errors. To prevent any undesired interactions with old compilers, I've renamed the file inside `rlib`s from `rust.metadata.bin` to `lib.rmeta` (not strongly attached to it, suggestions welcome). Fixes #65536. <hr/> Before: ``` $ llvm-objdump -all-headers build/*/stage1-std/*/release/deps/libcore-*.rmeta build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcore-6b9e8b5a59b79a1d.rmeta: file format COFF-<unknown arch> architecture: unknown start address: 0x00000000 Sections: Idx Name Size VMA Type SYMBOL TABLE: ``` After: ``` $ llvm-objdump -all-headers build/*/stage1-std/*/release/deps/libcore-*.rmeta llvm-objdump: error: 'build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcore-6b9e8b5a59b79a1d.rmeta': The file was not recognized as a valid object file ```
2019-11-09rustc_metadata: don't let LLVM confuse rmeta blobs for COFF object files.Eduard-Mihai Burtescu-6/+3
2019-11-08Stop returning promotables from `mir_const_qualif`Dylan MacKenzie-7/+4