immunant / c2rust

Migrate C code to Rust
https://c2rust.com/
Other
3.81k stars 220 forks source link

add support for emitting casts to and from *mut T and Cell<T> #968

Closed aneksteind closed 1 year ago

aneksteind commented 1 year ago

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 and Cell<T>. This adds support for those casts via:

kkysen commented 1 year ago

The *mut T -> *const T -> *const Cell<T> is safe because Cell is #[repr(transparent)], right?

aneksteind commented 1 year ago

The mut T -> const T -> *const Cell is safe because Cell is #[repr(transparent)], right?

That sounds correct to me