Skip to content

Commit 1d1453a

Browse files
authored
Rollup merge of #110632 - saethlin:panic-if-dep-graph-too-big, r=lcnr
Panic instead of truncating if the incremental on-disk cache is too big It seems _unlikely_ that anyone would hit this truncation, but if this `as` does actually truncate, that seems incredibly bad.
2 parents f971264 + 010deb5 commit 1d1453a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_query_impl/src/on_disk_cache.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ impl<'sess> rustc_middle::ty::OnDiskCache<'sess> for OnDiskCache<'sess> {
300300
interpret_alloc_index.reserve(new_n - n);
301301
for idx in n..new_n {
302302
let id = encoder.interpret_allocs[idx];
303-
let pos = encoder.position() as u32;
303+
let pos: u32 = encoder.position().try_into().unwrap();
304304
interpret_alloc_index.push(pos);
305305
interpret::specialized_encode_alloc_id(&mut encoder, tcx, id);
306306
}

0 commit comments

Comments
 (0)