about summary refs log tree commit diff
path: root/tvix/castore/src/errors.rs
diff options
context:
space:
mode:
authorBen Webb <benjaminedwardwebb@gmail.com>2024-08-20T22·19-0500
committerbenjaminedwardwebb <benjaminedwardwebb@gmail.com>2024-08-21T22·05+0000
commit565c0fd24c616adce50e940fc33b7bf9137a21cc (patch)
tree7e235c18d78d17b671b1215368b55a70fc0b018d /tvix/castore/src/errors.rs
parente03ea11badbf40971d6bf87eede33fe3b046c98b (diff)
fix(tvix/castore): u32 -> u64 in DirectoryError::SizeOverflow message r/8548
Fix a discrepancy in the error message for DirectoryError::SizeOverflow.

The message indicates that the SizeOverflow error occurs when total size
exceeds u32::MAX, but that's not true. All size fields within the
castore's internal Directory ADT are u64, and the SizeOverflow error is
only returned after a call to the checked_add implementation on u64.

See tvix/castore/nodes/directory.rs +111
and tvix/castore/nodes/directory.rs +88
as of this commit.

Change-Id: I74d161ea8927362e1cb601ba163489aa96fb91b1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12259
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/castore/src/errors.rs')
-rw-r--r--tvix/castore/src/errors.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/castore/src/errors.rs b/tvix/castore/src/errors.rs
index 3c044d9d79cb..7b5d1a422c99 100644
--- a/tvix/castore/src/errors.rs
+++ b/tvix/castore/src/errors.rs
@@ -47,7 +47,7 @@ pub enum DirectoryError {
     /// Node failed validation
     #[error("invalid node with name {}: {:?}", .0, .1.to_string())]
     InvalidNode(PathComponent, ValidateNodeError),
-    #[error("Total size exceeds u32::MAX")]
+    #[error("Total size exceeds u64::MAX")]
     SizeOverflow,
     /// Invalid name encountered
     #[error("Invalid name: {0}")]