Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace the usage of usize with u64 for writing bytes to a byte vector #761

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

alexanderkjall
Copy link
Contributor

as usize have variable size across architectures

Errors on i386:

 95s failures:
 95s 
 95s ---- test_deserialize_bytes stdout ----
 95s thread 'test_deserialize_bytes' panicked at 'called `Result::unwrap()` on an `Err` value: Custom("Invalid size 4340694056158888000: sizes must fit in a usize (0 to 4294967295)")', tests/serde.rs:59:76
 95s stack backtrace:
 95s    0: rust_begin_unwind
 95s              at /usr/src/rustc-1.70.0/library/std/src/panicking.rs:578:5
 95s    1: core::panicking::panic_fmt
 95s              at /usr/src/rustc-1.70.0/library/core/src/panicking.rs:67:14
 95s    2: core::result::unwrap_failed
 95s              at /usr/src/rustc-1.70.0/library/core/src/result.rs:1687:5
 95s    3: core::result::Result<T,E>::unwrap
 95s              at /usr/src/rustc-1.70.0/library/core/src/result.rs:1089:23
 95s    4: serde::test_deserialize_bytes
 95s              at ./tests/serde.rs:59:32
 95s    5: serde::test_deserialize_bytes::{{closure}}
 95s              at ./tests/serde.rs:48:29
 95s    6: core::ops::function::FnOnce::call_once
 95s              at /usr/src/rustc-1.70.0/library/core/src/ops/function.rs:250:5
 95s    7: core::ops::function::FnOnce::call_once
 95s              at /usr/src/rustc-1.70.0/library/core/src/ops/function.rs:250:5
 95s note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
 95s 
 95s ---- test_serialize_bytes stdout ----
 95s thread 'test_serialize_bytes' panicked at 'assertion failed: `(left == right)`
 95s   left: `[64, 0, 0, 0, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]`,
 95s  right: `[64, 0, 0, 0, 0, 0, 0, 0, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]`', tests/serde.rs:43:5
 95s stack backtrace:
 95s    0: rust_begin_unwind
 95s              at /usr/src/rustc-1.70.0/library/std/src/panicking.rs:578:5
 95s    1: core::panicking::panic_fmt
 95s              at /usr/src/rustc-1.70.0/library/core/src/panicking.rs:67:14
 95s    2: core::panicking::assert_failed_inner
 95s    3: core::panicking::assert_failed
 95s              at /usr/src/rustc-1.70.0/library/core/src/panicking.rs:228:5
 95s    4: serde::test_serialize_bytes
 95s              at ./tests/serde.rs:43:5
 95s    5: serde::test_serialize_bytes::{{closure}}
 95s              at ./tests/serde.rs:29:27
 95s    6: core::ops::function::FnOnce::call_once
 95s              at /usr/src/rustc-1.70.0/library/core/src/ops/function.rs:250:5
 95s    7: core::ops::function::FnOnce::call_once
 95s              at /usr/src/rustc-1.70.0/library/core/src/ops/function.rs:250:5
 95s note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

…r, as usize have variable size across architectures
@tarcieri tarcieri merged commit 571d31f into RustCrypto:master Nov 21, 2023
8 checks passed
@alexanderkjall alexanderkjall deleted the fix-usize-on-32-bit branch November 21, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants