Re: [PATCH] rust: transmute: Add implementation for FromBytes trait
From: Alice Ryhl
Date: Wed Oct 09 2024 - 03:37:35 EST
On Wed, Oct 9, 2024 at 3:48 AM Christian dos Santos de Lima
<christiansantoslima21@xxxxxxxxx> wrote:
>
> Add implementation and documentation for FromBytes trait.
>
> Add new feature block in order to allow using ToBytes
> and bound to from_bytes_mut function.
>
> Link: https://github.com/Rust-for-Linux/linux/issues/1119
> Signed-off-by: Christian dos Santos de Lima <christiansantoslima21@xxxxxxxxx>
> ---
> rust/kernel/lib.rs | 2 +
> rust/kernel/transmute.rs | 302 +++++++++++++++++++++++++++++++++++++--
> 2 files changed, 290 insertions(+), 14 deletions(-)
>
> diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs
> index dc37aef6a008..5215f5744e12 100644
> --- a/rust/kernel/lib.rs
> +++ b/rust/kernel/lib.rs
> @@ -18,6 +18,8 @@
> #![feature(lint_reasons)]
> #![feature(new_uninit)]
> #![feature(unsize)]
> +#![feature(portable_simd)]
> +#![feature(trivial_bounds)]
New unstable features must come with a good justification. Why are you
adding these? Why can't we avoid adding them? This information needs
to be in the commit message.
Alice