Re: [PATCH] rust: irq: add `'static` bounds to irq callbacks
From: Benno Lossin
Date: Sat Feb 14 2026 - 06:57:05 EST
On Sat Feb 14, 2026 at 11:23 AM CET, Danilo Krummrich wrote:
> On Sat Feb 14, 2026 at 10:27 AM CET, Benno Lossin wrote:
>> These callback functions take a generic `T` that is used in the body as
>> the generic argument in `Registration` and `ThreadedRegistration`. Those
>> types require `T: 'static`, but due to a compiler bug this requirement
>> isn't propagated to the function. Thus add the bound. This was caught in
>> the upstream Rust CI [1].
>>
>> Signed-off-by: Benno Lossin <lossin@xxxxxxxxxx>
>> Link: https://github.com/rust-lang/rust/pull/149389 [1]
>
> IIUC, the current code will not compile with a fixed compiler, right?
Correct.
> If this is correct, this needs to be backported; I can add the Fixes: tag and
> Cc: stable when I apply the patch.
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:
- 135d40523244 ("rust: irq: add support for threaded IRQs and handlers")
- 0851d34a8cc3 ("rust: irq: add support for non-threaded IRQs and handlers")
Cheers,
Benno