diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2020-07-22 15:11:25 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2020-07-26 18:37:02 -0400 |
| commit | dc216123830d75cffcb20f2b1350145b05409c4d (patch) | |
| tree | 720a3484d9ab0bfbf9d402422916424efa1a2005 | |
| parent | 979dd77c5d88cd21f350da5235d198b97264ec68 (diff) | |
| download | rust-dc216123830d75cffcb20f2b1350145b05409c4d.tar.gz rust-dc216123830d75cffcb20f2b1350145b05409c4d.zip | |
Ignore `orig_id` for stable hashing
This does not affect semantic equality, and was causing an enormous number of Span hash invalidations.
| -rw-r--r-- | src/librustc_span/hygiene.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/librustc_span/hygiene.rs b/src/librustc_span/hygiene.rs index c5ba42c5728..2bc38eab92a 100644 --- a/src/librustc_span/hygiene.rs +++ b/src/librustc_span/hygiene.rs @@ -711,9 +711,16 @@ pub struct ExpnData { /// The raw that this `ExpnData` had in its original crate. /// An `ExpnData` can be created before being assigned an `ExpnId`, /// so this might be `None` until `set_expn_data` is called + // This is used only for serialization/deserialization purposes: + // two `ExpnData`s that differ only in their `orig_id` should + // be considered equivalent. + #[stable_hasher(ignore)] pub orig_id: Option<u32>, } +// This would require special handling of `orig_id` and `parent` +impl !PartialEq for ExpnData {} + impl ExpnData { /// Constructs expansion data with default properties. pub fn default( |
