Skip to content

Commit c49e250

Browse files
committed
Make AbsoluteBytePos a u64.
1 parent ddfe1e8 commit c49e250

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/rustc_query_impl/src/on_disk_cache.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,11 @@ pub type EncodedDepNodeIndex = Vec<(SerializedDepNodeIndex, AbsoluteBytePos)>;
119119
struct SourceFileIndex(u32);
120120

121121
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, Encodable, Decodable)]
122-
pub struct AbsoluteBytePos(u32);
122+
pub struct AbsoluteBytePos(u64);
123123

124124
impl AbsoluteBytePos {
125125
fn new(pos: usize) -> AbsoluteBytePos {
126-
debug_assert!(pos <= u32::MAX as usize);
127-
AbsoluteBytePos(pos as u32)
126+
AbsoluteBytePos(pos.try_into().expect("Incremental cache file size overflowed u64."))
128127
}
129128

130129
fn to_usize(self) -> usize {

0 commit comments

Comments
 (0)