[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <64a4a0fe-d364-4cd0-e2e5-8e7cfd782ee6@gmail.com>
Date: Wed, 29 Mar 2023 11:49:44 -0300
From: Martin Rodriguez Reboredo <yakoyoku@...il.com>
To: Asahi Lina <lina@...hilina.net>, Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Wedson Almeida Filho <wedsonaf@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Sven Van Asbroeck <thesven73@...il.com>
Cc: Fox Chen <foxhlchen@...il.com>,
Andreas Hindborg <a.hindborg@...sung.com>,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
asahi@...ts.linux.dev
Subject: Re: [PATCH v2 2/6] rust: error: Add Error::to_ptr()
On 3/29/23 09:04, Asahi Lina wrote:
> [...]
>
> +
> + /// Returns the error encoded as a pointer.
> + #[allow(dead_code)]
> + pub(crate) fn to_ptr<T>(self) -> *mut T {
> + // SAFETY: Valid as long as self.0 is a valid error
> + unsafe { bindings::ERR_PTR(self.0.into()) as *mut _ }
> + }
> }
>
> impl From<AllocError> for Error {
>
Reviewed-by: Martin Rodriguez Reboredo
Powered by blists - more mailing lists