Skip to content

Commit 49cdf06

Browse files
authored
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 #115003.
2 parents b88849d + 6101ddd commit 49cdf06

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_span/src/hygiene.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1291,11 +1291,11 @@ pub fn register_expn_id(
12911291
let expn_id = ExpnId { krate, local_id };
12921292
HygieneData::with(|hygiene_data| {
12931293
let _old_data = hygiene_data.foreign_expn_data.insert(expn_id, data);
1294-
debug_assert!(_old_data.is_none());
1294+
debug_assert!(_old_data.is_none() || cfg!(parallel_compiler));
12951295
let _old_hash = hygiene_data.foreign_expn_hashes.insert(expn_id, hash);
1296-
debug_assert!(_old_hash.is_none());
1296+
debug_assert!(_old_hash.is_none() || _old_hash == Some(hash));
12971297
let _old_id = hygiene_data.expn_hash_to_expn_id.insert(hash, expn_id);
1298-
debug_assert!(_old_id.is_none());
1298+
debug_assert!(_old_id.is_none() || _old_id == Some(expn_id));
12991299
});
13001300
expn_id
13011301
}

0 commit comments

Comments
 (0)