lkml.org 
[lkml]   [2023]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] rust: make `UnsafeCell` the outer type in `Opaque`
From
On 6/14/23 16:27, Benno Lossin wrote:>> @@ -258,7 +258,7 @@ pub fn 
ffi_init(init_func: impl FnOnce(*mut T)) -> impl PinInit<Self> {
>>
>> /// Returns a raw pointer to the opaque data.
>> pub fn get(&self) -> *mut T {
>> - UnsafeCell::raw_get(self.0.as_ptr())
>> + UnsafeCell::get(&self.0).cast::<T>()
>
> Is there a reason you don't do `self.0.get().cast::<T>()`?
>

Not really. I just modified what was already there.

\
 
 \ /
  Last update: 2023-06-14 16:38    [W:0.056 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site