about summary refs log tree commit diff
path: root/src/test/ui/proc-macro/auxiliary/make-macro.rs
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-18/+0
2020-07-26Add test for serializing hygiene *into* a proc-macro crateAaron Hill-1/+7
This is a very obscure corner case, and should never be hit in practice.
2020-06-30Add force-host to test aux file used by proc-macroAaron Hill-0/+2
2020-06-29Serialize all foreign `SourceFile`s into proc-macro crate metadataAaron Hill-0/+10
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.