@@ -319,6 +319,8 @@ foreignPointers =
319319 where
320320 rule (Ptr _ t _) context
321321 | First (Just (t', Nothing )) <- lookupRTypeInContext t context = pure ([t |ForeignPtr $t'|], Nothing )
322+ rule (Rptr _ _ t _) context
323+ | First (Just (t', Nothing )) <- lookupRTypeInContext t context = pure ([t |ForeignPtr $t'|], Nothing )
322324 rule (PathTy Nothing (Path False [PathSegment " ForeignPtr" (Just (AngleBracketed [] [t] [] _)) _] _) _) context
323325 | First (Just (t', Nothing )) <- lookupRTypeInContext t context = pure ([t |ForeignPtr $t'|], Nothing )
324326 rule _ _ = mempty
@@ -334,6 +336,10 @@ foreignPointers =
334336 [ " impl<T> MarshalInto<*const T> for *const T {"
335337 , " fn marshal(self) -> *const T { self }"
336338 , " }"
339+ , " "
340+ , " impl<'a, T> MarshalInto<&'a T> for &'a T {"
341+ , " fn marshal(self) -> &'a T { self }"
342+ , " }"
337343 ]
338344
339345 mutPtr =
@@ -344,6 +350,7 @@ foreignPointers =
344350 , " ptr"
345351 , " }"
346352 , " }"
353+ , " "
347354 , " impl<T> MarshalInto<ForeignPtr<T>> for ForeignPtr<T> {"
348355 , " fn marshal(self) -> Self {"
349356 , " self"
@@ -363,6 +370,10 @@ foreignPointers =
363370 , " impl<T> MarshalInto<*mut T> for *mut T {"
364371 , " fn marshal(self) -> *mut T { self }"
365372 , " }"
373+ , " "
374+ , " impl<'a, T> MarshalInto<&'a mut T> for &'a mut T {"
375+ , " fn marshal(self) -> &'a mut T { self }"
376+ , " }"
366377 ]
367378
368379{- | This maps a Rust function type into the corresponding 'FunPtr' wrapped
0 commit comments