Re: [PATCH v5 2/3] rust: time: make Delta division and remainder fail consistently
From: Andreas Hindborg
Date: Thu Nov 12 2026 - 08:15:52 EST
On Sat, 31 Oct 2026 18:32:05 +0800, chenhan wrote:
> Delta's division and rem_nanos() use Rust operators on 64-bit and C
> helpers on 32-bit. The report shows that rem_nanos(0) can return 10 for
> a 10 ns dividend on ARMv7, while the same call panics on x86-64. The
> i64::MIN / -1 case also differs, and neither API documents these inputs.
>
> Check for zero divisors and i64::MIN with -1 before the architecture-
> specific code, and document the panic conditions on each method. This
> matches Rust's signed division and remainder operators, including when
> overflow checks are disabled. Valid-input results and API signatures
> are unchanged; invalid inputs now panic on 32-bit too.
>
> [...]
Applied, thanks!
[2/3] rust: time: make Delta division and remainder fail consistently
commit: 9687257afe8c2c2c257e2168bc6c44e5145dc73a
Best regards,
--
Andreas Hindborg <a.hindborg@xxxxxxxxxx>