Andrei Homescu
Andrei Homescu
@spernsteiner Do you have time to look into this? Should I take a pass at it?
Note so we don't forget: once this is implemented we should revert https://github.com/immunant/c2rust/commit/beb017f3d100f157e043e2bbdabdbd7ed26ae2c7 and re-enable `test_ref_field`.
> Non-owning to owning: This is an error for the rewriter. There is no reasonable safe way to convert `&T`/`&mut T` to `Box` How about `Copy` or `Clone` where those...
`Some(p.take().unwrap())` could be `p.take().or_else(|| panic!("Got None"))` or something like that (not that it made it shorter).
> we rewrite the malloc call either to Box::new(T::default()) We could also use `Box::new_uninit`, if we can live with it being nightly and unsafe.
> Then a nullable owning pointer location would have type `Option` I'm generally in favor of using standard types, but this is a bit clunky. We could just use our...
> Out of curiosity I tried compiling on both x86-32 and x86-64. I noticed that they produced different definitions of va_list That is coming from clang, C uses a different...
We could revisit this now that C string literals are in the language.
This is already supported, but turned off by default because `c2rust-refactor` has bitrotted a bit (see https://github.com/immunant/c2rust/issues/215). We are working on reviving that tool.
@thedataking had an interesting idea if we want to enable `reorganize_definitions` by default: we could try to detect this (and inline assembly) in the transpiler, and call `c2rust-refactor` if none...