Some methods of CGContext accept an argument image: &CGImage. CGImage will automatically call CGImageRelease when it is dropped.
The problem is, sometimes we don't actually own the CGImage. For example, I try to obtain a sys::CGImageRef from an NSImage using CGImageForProposedRect, and draw it on some CGBitmapContext with CGContext::draw_image. As the documentation says, the caller should not release the returned value. So it should be only possible to convert the raw pointer to a&CGImageRef rather than a CGImage. Changing the argument type to &CGImageRef will make the interface more flexible.