about summary refs log tree commit diff
path: root/src/librustc_metadata
AgeCommit message (Collapse)AuthorLines
2020-03-14Update `krate_attrs` and `get_module`John Kåre Alsaker-2/+2
2020-03-14rustc_metadata: Remove `rmeta::MacroDef`Vadim Petrochenkov-24/+6
Use `ast::MacroDef` instead. Also remove `Session::imported_macro_spans`, external macros have spans now.
2020-03-12Rollup merge of #69674 - mark-i-m:assoc-fn, r=matthewjasperMazdak Farrokhzad-2/+2
Rename DefKind::Method and TraitItemKind::Method r? @eddyb, @Centril, or @matthewjasper cc #69498 #60163
2020-03-10Auto merge of #66364 - Centril:cleanup-macro-def, r=petrochenkov,eddybbors-34/+19
Cleanup `rmeta::MacroDef` Avoid using rountrip parsing in the encoder and in `fn load_macro_untracked`. The main reason I was interested in this was to remove `rustc_parse` as a dependency of `rustc_metadata` but it seems like this had other benefits as well. Fixes #49511. r? @eddyb cc @matthewjasper @estebank @petrochenkov
2020-03-10Store `TokenStream` in `rmeta::MacroDef`.Mazdak Farrokhzad-34/+19
This removes a hack from `load_macro_untracked` in which parsing is used.
2020-03-10Rollup merge of #69677 - petrochenkov:spancode, r=eddybMazdak Farrokhzad-107/+126
rustc_metadata: Give decoder access to whole crate store Pre-requisite for https://github.com/rust-lang/rust/pull/68941. r? @eddyb
2020-03-07Rollup merge of #69773 - matthiaskrgr:typos, r=petrochenkovMazdak Farrokhzad-2/+2
fix various typos
2020-03-06Don't redundantly repeat field names (clippy::redundant_field_names)Matthias Krüger-1/+1
2020-03-06fix various typosMatthias Krüger-2/+2
2020-03-05rustc_metadata: Move some code from `impl CrateMetadataRef` to `impl ↵Vadim Petrochenkov-89/+87
CrateMetadata`
2020-03-05rustc_metadata: Give decoder access to whole crate storeVadim Petrochenkov-22/+43
2020-03-03rename TraitItemKind::Method -> FnMark Mansi-1/+1
2020-03-03DefKind::Method -> DefKind::AssocFnMark Mansi-1/+1
2020-03-03Run format.12101111-1/+3
2020-03-03Don't use static crt by default when build proc-macro.12101111-2/+2
2020-03-02Auto merge of #69432 - petrochenkov:alldeps, r=eddybbors-15/+4
rustc_metadata: Load metadata for indirect macro-only dependencies Imagine this dependency chain between crates ``` Executable crate -> Library crate -> Macro crate ``` where "Library crate" uses the macros from "Macro crate" for some code generation, but doesn't reexport them any further. Currently, when compiling "Executable crate" we don't even load metadata for it, because why would we want to load any metadata from "Macro crate" if it already did all its code generation job when compiling "Library crate". Right? Wrong! Hygiene data and spans (https://github.com/rust-lang/rust/issues/68686, https://github.com/rust-lang/rust/pull/68941) from "Macro crate" still may need to be decoded from "Executable crate". So we'll have to load them properly. Questions: - How this will affect compile times for larger crate trees in practice? How to measure it? Hygiene/span encoding/decoding will necessarily slow down compilation because right now we just don't do some work that we should do, but this introduces a whole new way to slow down things. E.g. loading metadata for `syn` (and its dependencies) when compiling your executable if one of its library dependencies uses it. - We are currently detecting whether a crate reexports macros from "Macro crate" or not, could we similarly detect whether a crate "reexports spans" and keep it unloaded if it doesn't? Or at least "reexports important spans" affecting hygiene, we can probably lose spans that only affect diagnostics.
2020-03-01Rollup merge of #69580 - matthiaskrgr:map_clone, r=CentrilYuki Okushi-1/+1
use .copied() instead of .map(|x| *x) on iterators
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-13/+13
2020-02-29Make it build againVadim Petrochenkov-2/+2
2020-02-29use .copied() instead of .map(|x| *x) on iteratorsMatthias Krüger-1/+1
2020-02-29Rollup merge of #69551 - matthiaskrgr:len_zero, r=Mark-SimulacrumDylan DPC-1/+1
use is_empty() instead of len() == x to determine if structs are empty.
2020-02-28Rollup merge of #69541 - dotdash:format, r=Mark-SimulacrumMazdak Farrokhzad-4/+1
Remove unneeded calls to format!()
2020-02-28use is_empty() instead of len() == x to determine if structs are empty.Matthias Krüger-1/+1
2020-02-27Remove unneeded calls to format!()Björn Steinbrink-4/+1
2020-02-26Auto merge of #67742 - mark-i-m:describe-it, r=matthewjasperbors-22/+22
Generalized article_and_description r? @matthewjasper The logic of finding the right word and article to print seems to be repeated elsewhere... this is an experimental method to unify this logic...
2020-02-24rustc_metadata: Use binary search from standard libraryVadim Petrochenkov-13/+5
instead of a hand rolled one.
2020-02-24rustc_metadata: Load metadata for indirect macro-only dependenciesVadim Petrochenkov-15/+4
2020-02-22get rid of lazymark-3/+3
2020-02-22add generator_kind queryMark Mansi-21/+21
2020-02-15Record proc macro harness order for use during metadata deserializationAaron Hill-12/+1
Fixes #68690 When we generate the proc macro harness, we now explicitly recorder the order in which we generate entries. We then use this ordering data to deserialize the correct proc-macro-data from the crate metadata.
2020-02-11Rollup merge of #66498 - bjorn3:less_feature_flags, r=Dylan-DPCDylan DPC-4/+0
Remove unused feature gates I think many of the remaining unstable things can be easily be replaced with stable things. I have kept the `#![feature(nll)]` even though it is only necessary in `libstd`, to make regressions of it harder.
2020-02-07Remove unused feature gates from librustc_metadatabjorn3-4/+0
2020-02-06Add a Hir wrapper typeJohn Kåre Alsaker-2/+2
2020-02-04Auto merge of #68708 - Mark-Simulacrum:stage0-step, r=pietroalbinibors-1/+0
Step stage0 to bootstrap from 1.42 This also includes a commit which fixes the rustfmt downloading logic to redownload when the rustfmt channel changes, and bumps rustfmt to a more recent version.
2020-02-01syntax::print -> new crate rustc_ast_prettyMazdak Farrokhzad-1/+2
2020-02-01Move builtin attribute logic to new rustc_attr crate.Mazdak Farrokhzad-3/+5
For now, this is all the crate contains, but more attribute logic & types will be moved there over time.
2020-01-31Drop cfg(bootstrap) codeMark Rousskov-1/+0
2020-01-31Auto merge of #68080 - varkor:declared-here, r=petrochenkovbors-1/+1
Address inconsistency in using "is" with "declared here" "is" was generally used for NLL diagnostics, but not other diagnostics. Using "is" makes the diagnostics sound more natural and readable, so it seems sensible to commit to them throughout. r? @Centril
2020-01-25Auto merge of #68448 - maurer:dyn-cdylib, r=alexcrichtonbors-9/+11
rustc: Allow cdylibs to link against dylibs Previously, rustc mandated that cdylibs could only link against rlibs as dependencies (not dylibs). This commit disables that restriction and tests that it works in a simple case. I don't have a windows rustc dev environment, so I guessed at the MSVC test code, I'm hoping the CI can run that for me. Additionally, we might want to consider emitting (through cargo or rustc) some metadata to help C users of a cdylib figure out where all the dylibs they need are. I don't think that should be needed to land this change, as it will still be usable by homogeneous build systems without it. My new test was templated off the `tests/run-make-fulldeps/cdylib` test. It seemed more appropriate to have it as a separate test, since both foo.rs and bar.rs would need to be replicated to make that test cover both cases, but I can do that if it would be preferred. If I'm doing anything out of order/process, please let me know; this is only my second change to rustc and the prior one was trivial. r? alexcrichton
2020-01-24Normalise diagnostics with respect to "the X is declared/defined here"varkor-1/+1
2020-01-23rustc: Allow cdylibs to link against dylibsMatthew Maurer-9/+11
Previously, rustc mandated that cdylibs could only link against rlibs as dependencies (not dylibs). This commit disables that restriction and tests that it works in a simple case.
2020-01-23Auto merge of #68298 - Mark-Simulacrum:binary-depdep-fix, r=petrochenkovbors-6/+38
Avoid declaring a fake dependency edge When we're producing an rlib, we do not need anything more than an rmeta file for each of our dependencies (this is indeed utilized by Cargo for pipelining). Previously, we were still storing the paths of possible rlib/dylib crates, which meant that they could still plausibly be accessed. With -Zbinary-dep-depinfo, that meant that Cargo thought that rustc was using both the rlib and an (earlier emitted) rmeta, and so needed a recompile, as the rlib may have finished writing *after* compilation started (for more detail, see issue 68149). This commit changes metadata loading to not store the filepaths of dylib/rlib if we're going to end up creating an rlib only. Fixes #68149.
2020-01-20Read metadata from rmeta exclusively, if possibleMark Rousskov-6/+38
When we're producing an rlib, we do not need anything more than an rmeta file for each of our dependencies (this is indeed utilized by Cargo for pipelining). Previously, we were still storing the paths of possible rlib/dylib crates, which meant that they could still plausibly be accessed. With -Zbinary-dep-depinfo, that meant that Cargo thought that rustc was using both the rlib and an (earlier emitted) rmeta, and so needed a recompile, as the rlib may have finished writing *after* compilation started (for more detail, see issue 68149). This commit changes metadata loading to not store the filepaths of dylib/rlib if we're going to end up creating an rlib only.
2020-01-20Rollup merge of #68353 - Centril:code-liberation, r=petrochenkovDylan DPC-5/+0
Remove `rustc_error_codes` deps except in `rustc_driver` Remove dependencies on `rustc_error_codes` in all crates except for `rustc_driver`. This has some benefits: 1. Adding a new error code when hacking on the compiler only requires rebuilding at most `rustc_error_codes`, `rustc_driver`, and the reflexive & transitive closure of the crate where the new error code is being added and its reverse dependencies. This improves time-to-UI-tests (TTUT). 2. Adding an error description to an error code only requires rebuilding `rustc_error_codes` and `rustc_driver`. This should substantially improve TTUT. r? @petrochenkov cc @rust-lang/wg-diagnostics
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-5/+0
2020-01-18slice_patterns: remove internal uses of gateMazdak Farrokhzad-1/+1
2020-01-17Use named fields for `hir::ItemKind::Impl`Dylan MacKenzie-7/+7
2020-01-16don't clone types that are copyMatthias Krüger-2/+2
found via clippy
2020-01-11use winapi for non-stdlib Windows bindingsAndy Russell-21/+15
2020-01-11Auto merge of #65912 - estebank:variants-orig, r=petrochenkovbors-0/+4
Point at the span for the definition of crate foreign ADTs Follow up to #65421. Partially addresses #65386. Blocked on #53081.