Re: [PATCH] rust: devres: add 'static bound to Devres<T>
From: Danilo Krummrich
Date: Wed May 27 2026 - 14:05:06 EST
On Wed May 27, 2026 at 4:44 PM CEST, Gary Guo wrote:
> On Tue May 26, 2026 at 1:04 AM BST, Danilo Krummrich wrote:
>> Add a 'static bound to prevent storing types with borrowed data in
>> Devres.
>
> The bound should be added on `Devres::new` instead.
I did consider this as it is generally recommended to minimize bounds on
structs.
However, a Devres<T> with non-'static T is semantically nonsensical, not just
unconstructible, and I think type level bound represents that better.