about summary refs log tree commit diff
path: root/src/librustc_span/hygiene.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-1239/+0
2020-08-15replaced log with tracingGurpreet Singh-1/+1
2020-08-14Rework `rustc_serialize`Matthew Jasper-16/+33
- Move the type parameter from `encode` and `decode` methods to the trait. - Remove `UseSpecialized(En|De)codable` traits. - Remove blanket impls for references. - Add `RefDecodable` trait to allow deserializing to arena-allocated references safely. - Remove ability to (de)serialize HIR. - Create proc-macros `(Ty)?(En|De)codable` to help implement these new traits.
2020-08-09Auto merge of #75137 - Aaron1011:fix/hygiene-skip-expndata, r=petrochenkovbors-4/+21
Don't serialize ExpnData for foreign crates When we encode an ExpnId into the crate metadata, we write out the CrateNum of the crate that 'owns' the corresponding `ExpnData`, which is later used to decode the `ExpnData` from its owning crate. However, we current serialize the `ExpnData` for all `ExpnIds` that we serialize, even if the `ExpnData` was already serialized into a foreign crate. This commit skips encoding this kind of `ExpnData`, which should hopefully speed up metadata encoding and reduce the total metadata size.
2020-08-09Auto merge of #75134 - Aaron1011:feature/expn-data-parent-hash, r=petrochenkovbors-3/+5
Hash parent ExpnData cc https://github.com/rust-lang/rust/pull/72121#discussion_r460528326
2020-08-09Add comment about the lack of `ExpnData` serialization for proc-macro cratesAaron Hill-0/+3
2020-08-08fix clippy::needless_return: remove unneeded return statementsMatthias Krüger-2/+2
2020-08-04Don't serialize ExpnData for foreign cratesAaron Hill-4/+18
When we encode an ExpnId into the crate metadata, we write out the CrateNum of the crate that 'owns' the corresponding `ExpnData`, which is later used to decode the `ExpnData` from its owning crate. However, we current serialize the `ExpnData` for all `ExpnIds` that we serialize, even if the `ExpnData` was already serialized into a foreign crate. This commit skips encoding this kind of `ExpnData`, which should hopefully speed up metadata encoding and reduce the total metadata size.
2020-08-04Hash parent ExpnDataAaron Hill-3/+5
2020-08-02fix typosliuzhenyu-2/+2
2020-07-26Share serialization optimization between incr and metadataAaron Hill-35/+109
2020-07-26Properly reset `orig_id` when loading from incremental cacheAaron Hill-1/+11
2020-07-26Ignore `orig_id` for stable hashingAaron Hill-0/+7
This does not affect semantic equality, and was causing an enormous number of Span hash invalidations.
2020-07-26Hygiene serialization implementationAaron Hill-24/+276
2020-07-09Eliminate confusing "globals" terminology.Nicholas Nethercote-2/+2
There are some structures that are called "globals", but are they global to a compilation session, and not truly global. I have always found this highly confusing, so this commit renames them as "session globals" and adds a comment explaining things. Also, the commit fixes an unnecessary nesting of `set()` calls `src/librustc_errors/json/tests.rs`
2020-07-03Rollup merge of #73881 - pierwill:pierwill-citations, r=jonas-schievinkManish Goregaokar-5/+4
Standardize bibliographic citations in rustc API docs See #73877.
2020-07-02Standardize bibliographic citations in rustc API docspierwill-5/+4
2020-06-29Serialize all foreign `SourceFile`s into proc-macro crate metadataAaron Hill-1/+2
Normally, we encode a `Span` that references a foreign `SourceFile` by encoding information about the foreign crate. When we decode this `Span`, we lookup the foreign crate in order to decode the `SourceFile`. However, this approach does not work for proc-macro crates. When we load a proc-macro crate, we do not deserialzie any of its dependencies (since a proc-macro crate can only export proc-macros). This means that we cannot serialize a reference to an upstream crate, since the associated metadata will not be available when we try to deserialize it. This commit modifies foreign span handling so that we treat all foreign `SourceFile`s as local `SourceFile`s when serializing a proc-macro. All `SourceFile`s will be stored into the metadata of a proc-macro crate, allowing us to cotinue to deserialize a proc-macro crate without needing to load any of its dependencies. Since the number of foreign `SourceFile`s that we load during a compilation session may be very large, we only serialize a `SourceFile` if we have also serialized a `Span` which requires it.
2020-06-26Explain move errors that occur due to method calls involving `self`Aaron Hill-2/+9
This is a re-attempt of #72389 (which was reverted in #73594) Instead of using `ExpnKind::Desugaring` to represent operators, this PR checks the lang item directly.
2020-06-22Revert "Rollup merge of #72389 - Aaron1011:feature/move-fn-self-msg, ↵Aaron Hill-11/+2
r=nikomatsakis" This reverts commit 372cb9b69c76a042d0b9d4b48ff6084f64c84a2c, reversing changes made to 5c61a8dc34c3e2fc6d7f02cb288c350f0233f944.
2020-06-11Explain move errors that occur due to method calls involving `self`Aaron Hill-2/+11
2020-05-22Remove `macro_defs` mapAaron Hill-3/+19
We store store the `DefId` directly in `ExpnData`. This will allow us to serialize `ExpnData` in PR #72121 without needing to manage a side table.
2020-05-02fix rustdoc warningsTshepang Lekhonkhobe-1/+1
2020-03-23Split long derive lists into two derive attributes.Ana-Maria Mihalache-23/+4
2020-03-16hygiene: `modern` -> `normalize_to_macros_2_0`Vadim Petrochenkov-16/+16
`modern_and_legacy` -> `normalize_to_macro_rules`
2020-01-26rustc_span: move pretty syntax from macro_backtrace to ExpnKind::descr.Eduard-Mihai Burtescu-5/+9
2020-01-26Don't use ExpnKind::descr to get the name of a bang macro.Eduard-Mihai Burtescu-2/+4
2019-12-30Rename directories for some crates from `syntax_x` to `rustc_x`Vadim Petrochenkov-0/+850
`syntax_expand` -> `rustc_expand` `syntax_pos` -> `rustc_span` `syntax_ext` -> `rustc_builtin_macros`