Add comment about the lack of ExpnData serialization for proc-macro crates
This commit is contained in:
parent
955aebf529
commit
ef49032297
2 changed files with 7 additions and 0 deletions
|
|
@ -280,6 +280,10 @@ impl<'a, 'tcx> SpecializedEncoder<Span> for EncodeContext<'a, 'tcx> {
|
|||
// cross-crate inconsistencies (getting one behavior in the same
|
||||
// crate, and a different behavior in another crate) due to the
|
||||
// limited surface that proc-macros can expose.
|
||||
//
|
||||
// IMPORTANT: If this is ever changed, be sure to update
|
||||
// `rustc_span::hygiene::raw_encode_expn_id` to handle
|
||||
// encoding `ExpnData` for proc-macro crates.
|
||||
if self.is_proc_macro {
|
||||
SyntaxContext::root().encode(self)?;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1188,6 +1188,9 @@ pub fn raw_encode_expn_id<E: Encoder>(
|
|||
let data = expn.expn_data();
|
||||
// We only need to serialize the ExpnData
|
||||
// if it comes from this crate.
|
||||
// We currently don't serialize any hygiene information data for
|
||||
// proc-macro crates: see the `SpecializedEncoder<Span>` impl
|
||||
// for crate metadata.
|
||||
if data.krate == LOCAL_CRATE {
|
||||
needs_data();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue