@@ -319,8 +319,6 @@ foreignPointers = do
319319 foreignPtrT <- [t |ForeignPtr|]
320320 pure $ Context ([rule], [rev foreignPtrT], [foreignPtr, constPtr, mutPtr])
321321 where
322- rule (Ptr _ t _) context
323- | First (Just (t', Nothing )) <- lookupRTypeInContext t context = pure ([t |ForeignPtr $t'|], Nothing )
324322 rule (Rptr _ _ t _) context
325323 | First (Just (t', Nothing )) <- lookupRTypeInContext t context = pure ([t |ForeignPtr $t'|], Nothing )
326324 rule (PathTy Nothing (Path False [PathSegment " ForeignPtr" (Just (AngleBracketed [] [t] [] _)) _] _) _) context
@@ -330,10 +328,6 @@ foreignPointers = do
330328 pure ([t |Maybe (ForeignPtr $t')|], pure . pure $ PathTy Nothing (Path False [PathSegment " ForeignPtr" (Just (AngleBracketed [] [t] [] () )) () ] () ) () )
331329 rule _ _ = mempty
332330
333- rev foreignPtrT (AppT foreignPtr t) context
334- | foreignPtr == foreignPtrT = do
335- t' <- lookupHTypeInContext t context
336- pure (Ptr Mutable <$> t' <*> pure () )
337331 rev _ _ _ = mempty
338332
339333 foreignPtr =
@@ -344,11 +338,7 @@ foreignPointers = do
344338
345339 constPtr =
346340 unlines
347- [ " impl<T> MarshalInto<*const T> for *const T {"
348- , " fn marshal(self) -> *const T { self }"
349- , " }"
350- , " "
351- , " impl<'a, T> MarshalInto<&'a T> for &'a T {"
341+ [ " impl<'a, T> MarshalInto<&'a T> for &'a T {"
352342 , " fn marshal(self) -> &'a T { self }"
353343 , " }"
354344 ]
@@ -378,10 +368,6 @@ foreignPointers = do
378368 , " }"
379369 , " }"
380370 , " "
381- , " impl<T> MarshalInto<*mut T> for *mut T {"
382- , " fn marshal(self) -> *mut T { self }"
383- , " }"
384- , " "
385371 , " impl<'a, T> MarshalInto<&'a mut T> for &'a mut T {"
386372 , " fn marshal(self) -> &'a mut T { self }"
387373 , " }"
0 commit comments