Skip to content

Commit

Permalink
Make AbsoluteBytePos a u64.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Nov 8, 2022
1 parent ddfe1e8 commit c49e250
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler/rustc_query_impl/src/on_disk_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,11 @@ pub type EncodedDepNodeIndex = Vec<(SerializedDepNodeIndex, AbsoluteBytePos)>;
struct SourceFileIndex(u32);

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

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

fn to_usize(self) -> usize {
Expand Down

0 comments on commit c49e250

Please sign in to comment.