Re: [PATCH] rust: irq: add `'static` bounds to irq callbacks
From: Benno Lossin
Date: Sat Feb 14 2026 - 07:49:36 EST
On Sat Feb 14, 2026 at 1:18 PM CET, Danilo Krummrich wrote:
> On Sat Feb 14, 2026 at 12:56 PM CET, Benno Lossin wrote:
>> Oh yeah I forgot about that, good catch. I think it should be
>>
>> Fixes: 29e16fcd67ee ("rust: irq: add &Device<Bound> argument to irq callbacks")
>>
>> Since that introduces the usage of the `[Threaded]Registration` types
>> in the function bodies.
>>
>> It can also be backported further, but then it needs to be split into
>> threaded and non-threaded variants:
>
> All commits were introduced in v6.18, so technically there is no "backported
> further".
>
> But IIUC, with a fixed compiler, it also would not compile without commit
> 29e16fcd67ee ("rust: irq: add &Device<Bound> argument to irq callbacks"),
> correct? I.e. the two commits below are the correct Fixes: tags.
>
>> - 135d40523244 ("rust: irq: add support for threaded IRQs and handlers")
>> - 0851d34a8cc3 ("rust: irq: add support for non-threaded IRQs and handlers")
With a fixed compiler these two would also still compile. It's just that
the callbacks will only ever be called with `T: 'static`, since that is
a bound on `[Threaded]Registration`, which stores these functions in the
C side. So from a purely no-compile-error perspective, 29e16fcd67ee is
the correct fixes. But from a "good API design" perspective, we could
choose the two other commits.
But since all commits are in v6.18, it doesn't matter all that much.
Cheers,
Benno