Re: [PATCH 2/2] rust: time: Use wrapping_sub() for Ktime::sub()
From: Miguel Ojeda
Date: Tue May 14 2024 - 10:23:39 EST
On Tue, May 14, 2024 at 3:13 PM Boqun Feng <boqun.feng@xxxxxxxxx> wrote:
>
> However, I must point out that it needs more than a customized panic
> handler to work: we also need to change the code generation (or adding
> a different flag similar to -Coverflow-checks), because the current code
> generation is Rust panic when overflow happens, which means the
> subsequent code is unreachable.
Yeah, definitely. That first step RFC is a bit ambiguous ("custom
implementations of `panic_*`"), but what we discussed was the ability
to customize the report and continue, rather than providing a
different panic handler. So the customization point function should
not return `!` for our use case, at least in the integer arithmetic
overflow case.
Cheers,
Miguel