Closed
Description
Input C/C++ Header
class Foo {
public:
void bar();
};
inline void Foo::bar() {
// Oh-no
}
Bindgen Invocation
Generated by bindgen input.hpp
, no flags
/* automatically generated by rust-bindgen 0.59.2 */
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Foo {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_Foo() {
assert_eq!(
::std::mem::size_of::<Foo>(),
1usize,
concat!("Size of: ", stringify!(Foo))
);
assert_eq!(
::std::mem::align_of::<Foo>(),
1usize,
concat!("Alignment of ", stringify!(Foo))
);
}
extern "C" {
#[link_name = "\u{1}_ZN3Foo3barEv"]
pub fn Foo_bar(this: *mut Foo);
}
impl Foo {
#[inline]
pub unsafe fn bar(&mut self) {
Foo_bar(self)
}
}
Expected Results
Bindgen shouldn't be generating bindings for bar()
. It probably gets confused by the fact that Foo
's declaration doesn't specifically say that bar()
is inline, but instead it should look forward for a possible inline definition.
Marking the bar()
declaration with inline
does fix the issue, even if we don't provide an actual body.
The specific header I'm working with is this one, and it makes heavy usage of this to define std dependent helpers.
Metadata
Metadata
Assignees
Labels
No labels