On Mon Oct 27, 2025 at 12:35 AM JST, Danilo Krummrich wrote: > On 10/26/25 3:39 PM, Alexandre Courbot wrote: >> This patchset tries to eradicate the use of `as` in nova-core, by using >> existing means and introducing new ones. > > Thanks a lot for working on this cleanup! >> The first 4 patches use the already-available `From` and `TryFrom` trait >> where it is possible or advisable. >> >> The fifth patch introduces a new module that proposes conversion >> functions for those that are infallible under the current build target. >> This is done through a set of const functions, and the `FromAs` and >> `IntoAs` extension traits which, as their names lightly suggest, offer >> conversion for those types on which the `as` operator can be used >> losslessly. >> >> This new module is put to use in the sixth patch. >> >> The idea was first suggested by Danilo, and I hope I captured it >> properly. :) > > Yes, this is what I thought of.
Great! >> As Danilo suggested, this could eventually find its place in the kernel >> crate if the implementation is deemed to be fit, but for now let's >> review and let it mature in nova-core. > > Yeah, I think this approach makes sense. Though, I think we want to move this > to > the kernel crate sooner than later, it's definitely something we want for core > code and other drivers as well. > > Depending on the initial feedback, it might even make sense to do it right > away. Moving to the kernel crate sounds good to me, but this work has been initiated from the Nova GSP boot series and is now a dependency of it - so taking it through another tree than `drm-rust` would delay the GSP boot some more.
