Skip to content

Commit

Permalink
Rollup merge of #115081 - Zoxc:expn-id-decode, r=cjgillot
Browse files Browse the repository at this point in the history
Allow overwriting ExpnId for concurrent decoding

These assertions only hold for the single threaded compiler. They were triggered in #115003.
  • Loading branch information
matthiaskrgr authored Aug 25, 2023
2 parents b88849d + 6101ddd commit 49cdf06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_span/src/hygiene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1291,11 +1291,11 @@ pub fn register_expn_id(
let expn_id = ExpnId { krate, local_id };
HygieneData::with(|hygiene_data| {
let _old_data = hygiene_data.foreign_expn_data.insert(expn_id, data);
debug_assert!(_old_data.is_none());
debug_assert!(_old_data.is_none() || cfg!(parallel_compiler));
let _old_hash = hygiene_data.foreign_expn_hashes.insert(expn_id, hash);
debug_assert!(_old_hash.is_none());
debug_assert!(_old_hash.is_none() || _old_hash == Some(hash));
let _old_id = hygiene_data.expn_hash_to_expn_id.insert(hash, expn_id);
debug_assert!(_old_id.is_none());
debug_assert!(_old_id.is_none() || _old_id == Some(expn_id));
});
expn_id
}
Expand Down

0 comments on commit 49cdf06

Please sign in to comment.