rust/libdnf_sys: Use uninstantiable type rather than wrapper struct

When we ran rustfmt, it converted our bare `extern` blocks to
`extern "C"` which has a different meaning apparently.

This caused cbindgen to try to interpret the structs, and it barfed
on the newtype void wrappers.

Looking at libgit2-rs, it seems to use these "uninstantiable types"
instead.

Prep for using `rustfmt`.
This commit is contained in:
Colin Walters 2020-04-06 22:19:09 +00:00 committed by OpenShift Merge Robot
parent 3e91d5a38e
commit 66816eeabe

View File

@ -12,10 +12,8 @@ use glib_sys;
* https://github.com/swig/swig/issues/1468) or at least `bindgen` for the strict C parts of the * https://github.com/swig/swig/issues/1468) or at least `bindgen` for the strict C parts of the
* API. For now, I just took the shortcut of manually defining a tiny subset we care about. */ * API. For now, I just took the shortcut of manually defining a tiny subset we care about. */
#[repr(C)] pub(crate) enum DnfPackage {}
pub(crate) struct DnfPackage(libc::c_void); pub(crate) enum DnfRepo {}
#[repr(C)]
pub(crate) struct DnfRepo(libc::c_void);
#[allow(dead_code)] #[allow(dead_code)]
extern { extern {