diff options
-rw-r--r-- | libbindgen/tests/expectations/tests/issue-410.rs | 41 | ||||
-rw-r--r-- | libbindgen/tests/headers/issue-410.hpp | 12 | ||||
-rw-r--r-- | src/ir/comp.rs | 6 |
3 files changed, 58 insertions, 1 deletions
diff --git a/libbindgen/tests/expectations/tests/issue-410.rs b/libbindgen/tests/expectations/tests/issue-410.rs new file mode 100644 index 00000000..a5d94960 --- /dev/null +++ b/libbindgen/tests/expectations/tests/issue-410.rs @@ -0,0 +1,41 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(non_snake_case)] + + +pub mod root { + #[allow(unused_imports)] + use self::super::root; + pub mod JS { + #[allow(unused_imports)] + use self::super::super::root; + pub use root::_bindgen_ty_1 as JSWhyMagic; + #[repr(C)] + #[derive(Debug, Copy)] + pub struct Value { + pub _address: u8, + } + #[test] + fn bindgen_test_layout_Value() { + assert_eq!(::std::mem::size_of::<Value>() , 1usize); + assert_eq!(::std::mem::align_of::<Value>() , 1usize); + } + extern "C" { + #[link_name = "_ZN2JS5Value1aE10JSWhyMagic"] + pub fn Value_a(this: *mut root::JS::Value, + arg1: root::JS::JSWhyMagic); + } + impl Clone for Value { + fn clone(&self) -> Self { *self } + } + impl Value { + #[inline] + pub unsafe fn a(&mut self, arg1: root::JS::JSWhyMagic) { + Value_a(&mut *self, arg1) + } + } + } + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub enum _bindgen_ty_1 { } +} diff --git a/libbindgen/tests/headers/issue-410.hpp b/libbindgen/tests/headers/issue-410.hpp new file mode 100644 index 00000000..a7a834cf --- /dev/null +++ b/libbindgen/tests/headers/issue-410.hpp @@ -0,0 +1,12 @@ +// bindgen-flags: --enable-cxx-namespaces --whitelist-type JS::Value + +namespace JS { +class Value; +} +typedef enum {} JSWhyMagic; +namespace JS { +class Value { +public: + void a(JSWhyMagic); +}; +} diff --git a/src/ir/comp.rs b/src/ir/comp.rs index 968bf879..27b2fe4e 100644 --- a/src/ir/comp.rs +++ b/src/ir/comp.rs @@ -957,6 +957,10 @@ impl TypeCollector for CompInfo { types.insert(var); } - // FIXME(emilio): Methods, VTable? + for method in self.methods() { + types.insert(method.signature); + } + + // FIXME(emilio): VTable? } } |