diff options
-rw-r--r-- | libbindgen/src/ir/context.rs | 2 | ||||
-rw-r--r-- | libbindgen/tests/expectations/tests/msvc-no-usr.rs | 19 | ||||
-rw-r--r-- | libbindgen/tests/headers/msvc-no-usr.hpp | 8 |
3 files changed, 28 insertions, 1 deletions
diff --git a/libbindgen/src/ir/context.rs b/libbindgen/src/ir/context.rs index a1ec8c70..bda3e3c8 100644 --- a/libbindgen/src/ir/context.rs +++ b/libbindgen/src/ir/context.rs @@ -222,7 +222,7 @@ impl<'ctx> BindgenContext<'ctx> { error!("Valid declaration with no USR: {:?}, {:?}", declaration, location); - return; + TypeKey::Declaration(declaration) }; let old = self.types.insert(key, id); diff --git a/libbindgen/tests/expectations/tests/msvc-no-usr.rs b/libbindgen/tests/expectations/tests/msvc-no-usr.rs new file mode 100644 index 00000000..8cab8cdc --- /dev/null +++ b/libbindgen/tests/expectations/tests/msvc-no-usr.rs @@ -0,0 +1,19 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(non_snake_case)] + + +#[repr(C)] +#[derive(Debug, Copy)] +pub struct A { + pub foo: usize, +} +#[test] +fn bindgen_test_layout_A() { + assert_eq!(::std::mem::size_of::<A>() , 8usize); + assert_eq!(::std::mem::align_of::<A>() , 8usize); +} +impl Clone for A { + fn clone(&self) -> Self { *self } +} diff --git a/libbindgen/tests/headers/msvc-no-usr.hpp b/libbindgen/tests/headers/msvc-no-usr.hpp new file mode 100644 index 00000000..b15e49f5 --- /dev/null +++ b/libbindgen/tests/headers/msvc-no-usr.hpp @@ -0,0 +1,8 @@ + +typedef unsigned long long size_t; + +class A { + const size_t foo; + + A() : foo(5) {} +}; |