Closed aneksteind closed 1 year ago
The *mut T
-> *const T
-> *const Cell<T>
is safe because Cell
is #[repr(transparent)]
, right?
The mut T -> const T -> *const Cell
is safe because Cell is #[repr(transparent)], right?
That sounds correct to me
Fixes #964 . The
lighttpd-minimal
test had failures due to unsupported casts that the rewriter wanted to emit, namely in going to and from*mut T
andCell<T>
. This adds support for those casts via:as_ptr()
rewrite forCell<T>
, which produces the underlying*mut T
*mut T -> *const Cell<T> -> &Cell<T>
rewrite, accomplished through a pointer-to-pointer cast followed by a reborrow&*c
wherec: *const Cell<T>