Re: [PATCH v7 3/6] rust: types: Support &'static and &'static mut ForeignOwnable

From: Danilo Krummrich
Date: Wed Jun 25 2025 - 04:45:17 EST


On Tue, Jun 24, 2025 at 11:25:22PM +0000, Matthew Maurer wrote:
> + fn into_foreign(self) -> *mut Self::PointedTo {
> + self as *const _ as _

Please prefer

core::ptr::from_ref(self).cast_mut()

instead.

> + }