Skip to content

Commit 786d828

Browse files
Rollup merge of #148306 - zetanumbers:expn_id_decode, r=nnethercote
Remove double check when decoding ExpnId to avoid races Fixes debug assertion failure as described in #141540 (comment) Essentially failure happens during the race while decoding one `ExpnId` from different threads. This ICE doesn't happen with single threaded thread_pool due to early return within `decode_expn_id` with the same condition: https://github.com/rust-lang/rust/blob/8205e6b75ec656305ac235d4726d2c7a1ddcef14/compiler/rustc_middle/src/query/on_disk_cache.rs#L605-L607 However I believe this race does not hurt because `register_expn_id` is pretty much idempotent: https://github.com/rust-lang/rust/blob/8205e6b75ec656305ac235d4726d2c7a1ddcef14/compiler/rustc_span/src/hygiene.rs#L1397-L1413
2 parents 4f266bd + 2a5d830 commit 786d828

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

compiler/rustc_metadata/src/rmeta/decoder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,6 @@ impl<'a> CrateMetadataRef<'a> {
15601560
}
15611561

15621562
fn expn_hash_to_expn_id(self, sess: &Session, index_guess: u32, hash: ExpnHash) -> ExpnId {
1563-
debug_assert_eq!(ExpnId::from_hash(hash), None);
15641563
let index_guess = ExpnIndex::from_u32(index_guess);
15651564
let old_hash = self.root.expn_hashes.get(self, index_guess).map(|lazy| lazy.decode(self));
15661565

0 commit comments

Comments
 (0)