Re: [PATCH v3 2/6] rust: types: avoid `as` casts

From: Tamir Duberstein
Date: Fri Nov 08 2024 - 11:40:43 EST


On Fri, Nov 8, 2024 at 11:34 AM Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
> > @@ -333,13 +334,13 @@ impl<T: 'static> ForeignOwnable for Arc<T> {
> > type Borrowed<'a> = ArcBorrow<'a, T>;
> >
> > fn into_foreign(self) -> *const core::ffi::c_void {
> > - ManuallyDrop::new(self).ptr.as_ptr() as _
> > + ManuallyDrop::new(self).ptr.as_ptr().cast_const().cast()
>
> What's up with this cast_const?

Doh, just missed it. Gone in v4.