fn init(mut self: Pin<SelfReferential>) {
let this : &mut SelfReferential = unsafe { Pin::get_mut(&mut self) };
// Set up self_ref to point to this.data.
- this.self_ref = &mut this.data as *const i32;
+ this.self_ref = &this.data as *const i32;
}
- fn read_ref(mut self: Pin<SelfReferential>) -> Option<i32> {
- let this : &mut SelfReferential = unsafe { Pin::get_mut(&mut self) };
+ fn read_ref(self: Pin<SelfReferential>) -> Option<i32> {
+ let this : &SelfReferential = &*self;
// Dereference self_ref if it is non-NULL.
if this.self_ref == ptr::null() {
None