Correctly set the `ptr_for_ref` arg on `write_c_type` calls in enum printing
authorMatt Corallo <git@bluematt.me>
Fri, 24 Jun 2022 01:16:46 +0000 (01:16 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 28 Jun 2022 17:15:29 +0000 (17:15 +0000)
commit827f4ccfacf8c5651fad3becf197168374b90e1f
treec2ed49db23f107726eb86b67c68f920759088c7a
parentf388c0d91e63a43899d3188370c4256ae0f2e7cb
Correctly set the `ptr_for_ref` arg on `write_c_type` calls in enum printing

This avoids adding references to opaque structs in enum fields,
where we should, of course, map them as owned opaque structs.

It does generate some difficult-to-parse-by-downstream-bindings
code, which is addressed in a later commit by adding documentation.

Note that it also relies on the types being mapped differently
being opaque as it now needs logic to map a reference to a
non-reference with `is_owned` unset.
c-bindings-gen/src/main.rs