about summary refs log tree commit diff
path: root/compiler/rustc_query_impl/src
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-11-08 18:47:26 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2022-11-08 18:47:26 +0000
commitc49e2501bfeb18c1bfc0c6deb1aeb3e59def33a5 (patch)
treeb3bd3899122f9347d8b9baee2853f16c6d6d392f /compiler/rustc_query_impl/src
parentddfe1e87f7c85c03773c29180a931447fcd03b65 (diff)
downloadrust-c49e2501bfeb18c1bfc0c6deb1aeb3e59def33a5.tar.gz
rust-c49e2501bfeb18c1bfc0c6deb1aeb3e59def33a5.zip
Make AbsoluteBytePos a u64.
Diffstat (limited to 'compiler/rustc_query_impl/src')
-rw-r--r--compiler/rustc_query_impl/src/on_disk_cache.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_query_impl/src/on_disk_cache.rs b/compiler/rustc_query_impl/src/on_disk_cache.rs
index a6cb8f7bd55..eaed9aeb850 100644
--- a/compiler/rustc_query_impl/src/on_disk_cache.rs
+++ b/compiler/rustc_query_impl/src/on_disk_cache.rs
@@ -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 {