mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lorenzo Delgado <lnsdev@proton.me>
To: Gary Guo <gary@garyguo.net>
Cc: "Lorenzo Delgado" <lnsdev@proton.me>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	"Thorsten Blum" <blum@kernel.org>,
	"Francis Laniel" <laniel_francis@npnm.eu>
Subject: Re: [PATCH v2 1/2] rust: non_empty: add NonEmpty
Date: Tue, 13 Oct 2026 15:11:37 +0000	[thread overview]
Message-ID: <20261013151131.725271-1-lnsdev@proton.me> (raw)
In-Reply-To: <DM3RF8H2M4WU.1CB0H9Z2A6WQY@garyguo.net>

On Tue Oct 13, 2026 at 2:54 PM BST, Gary Guo wrote:
>> +    pub fn from_array_mut<const N: usize>(array: &mut [T; N]) -> &mut Self {
>
> Construction of array should be of form
>
>     &&mut [T; N] --construct--> &mut NonEmpty<[T; N]> --unsize coercion--> &mut NonEmpty<[T]>

Good point, no need to go through the slice then. I'll make it a
`from_mut()` on `NonEmpty<[T; N]>` in v3.

Thanks,
Lorenzo


  reply	other threads:[~2026-10-13 15:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 13:49 [PATCH v2 0/2] rust: " Lorenzo Delgado
2026-10-13 13:49 ` [PATCH v2 1/2] rust: non_empty: " Lorenzo Delgado
2026-10-13 13:54   ` Gary Guo
2026-10-13 15:11     ` Lorenzo Delgado [this message]
2026-10-13 13:49 ` [PATCH v2 2/2] rust: uaccess: use NonEmpty in strcpy_into_buf() Lorenzo Delgado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261013151131.725271-1-lnsdev@proton.me \
    --to=lnsdev@proton.me \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=blum@kernel.org \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=laniel_francis@npnm.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®