immunant / c2rust

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

rewriter: support casts needed by conversion to and from non-rewritten (fixed) types and rewritten types #964

Closed aneksteind closed 1 year ago

aneksteind commented 1 year ago

960 introduces a feature where types mentioned in extern blocks, for example, aren't rewritten. This leads to a situation such as the following:

foo /* has CELL permissions */ = bar.connection /* is FIXED */

and with that the rewriter wants to generate a cast that's not yet supported:

TypeDesc { own: RawMut, qty: Single, pointee_ty: connection } -> TypeDesc { own: Cell, qty: Single, pointee_ty: connection }

The above is only one example of an unsupported cast kind that will need to be supported for lighttpd. The extent of the known cases have been temporarily disabled.