mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
Rollup merge of #115081 - Zoxc:expn-id-decode, r=cjgillot
Allow overwriting ExpnId for concurrent decoding These assertions only hold for the single threaded compiler. They were triggered in https://github.com/rust-lang/rust/pull/115003.
This commit is contained in:
commit
49cdf06b4a
@ -1291,11 +1291,11 @@ pub fn register_expn_id(
|
|||||||
let expn_id = ExpnId { krate, local_id };
|
let expn_id = ExpnId { krate, local_id };
|
||||||
HygieneData::with(|hygiene_data| {
|
HygieneData::with(|hygiene_data| {
|
||||||
let _old_data = hygiene_data.foreign_expn_data.insert(expn_id, 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);
|
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);
|
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
|
expn_id
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user