Ignore `orig_id` for stable hashing

This does not affect semantic equality, and was causing an enormous
number of Span hash invalidations.
This commit is contained in:
Aaron Hill 2020-07-22 15:11:25 -04:00
parent 979dd77c5d
commit dc21612383
No known key found for this signature in database
GPG Key ID: B4087E510E98B164
1 changed files with 7 additions and 0 deletions

View File

@ -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(