Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit dc21612

Browse files
committed
Ignore orig_id for stable hashing
This does not affect semantic equality, and was causing an enormous number of Span hash invalidations.
1 parent 979dd77 commit dc21612

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/librustc_span/hygiene.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,9 +711,16 @@ pub struct ExpnData {
711711
/// The raw that this `ExpnData` had in its original crate.
712712
/// An `ExpnData` can be created before being assigned an `ExpnId`,
713713
/// so this might be `None` until `set_expn_data` is called
714+
// This is used only for serialization/deserialization purposes:
715+
// two `ExpnData`s that differ only in their `orig_id` should
716+
// be considered equivalent.
717+
#[stable_hasher(ignore)]
714718
pub orig_id: Option<u32>,
715719
}
716720

721+
// This would require special handling of `orig_id` and `parent`
722+
impl !PartialEq for ExpnData {}
723+
717724
impl ExpnData {
718725
/// Constructs expansion data with default properties.
719726
pub fn default(

0 commit comments

Comments
 (0)