summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ir/ty.rs1
-rw-r--r--tests/expectations/tests/issue-372.rs15
-rw-r--r--tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs9
-rw-r--r--tests/expectations/tests/libclang-3.9/partial-specialization-and-inheritance.rs9
-rw-r--r--tests/expectations/tests/libclang-4/partial-specialization-and-inheritance.rs9
-rw-r--r--tests/expectations/tests/non-type-params.rs32
-rw-r--r--tests/expectations/tests/opaque_pointer.rs8
-rw-r--r--tests/expectations/tests/size_t_template.rs14
-rw-r--r--tests/expectations/tests/template.rs8
9 files changed, 3 insertions, 102 deletions
diff --git a/src/ir/ty.rs b/src/ir/ty.rs
index 78274d94..5cbc4cf6 100644
--- a/src/ir/ty.rs
+++ b/src/ir/ty.rs
@@ -359,6 +359,7 @@ impl IsOpaque for Type {
TypeKind::Opaque => true,
TypeKind::TemplateInstantiation(ref inst) => inst.is_opaque(ctx, item),
TypeKind::Comp(ref comp) => comp.is_opaque(ctx, &()),
+ TypeKind::ResolvedTypeRef(to) => to.is_opaque(ctx, &()),
_ => false,
}
}
diff --git a/tests/expectations/tests/issue-372.rs b/tests/expectations/tests/issue-372.rs
index 43ca6c1a..8a115924 100644
--- a/tests/expectations/tests/issue-372.rs
+++ b/tests/expectations/tests/issue-372.rs
@@ -83,7 +83,6 @@ pub mod root {
ai = 11,
}
#[repr(C)]
- #[derive(Copy)]
pub struct F {
pub w: [u64; 33usize],
}
@@ -99,21 +98,7 @@ pub mod root {
"Alignment of field: " , stringify ! ( F ) , "::" ,
stringify ! ( w ) ));
}
- impl Clone for F {
- fn clone(&self) -> Self { *self }
- }
impl Default for F {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
- #[test]
- fn __bindgen_test_layout_C_open0_n_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<[u64; 33usize]>() , 264usize , concat
- ! (
- "Size of template specialization: " , stringify ! (
- [u64; 33usize] ) ));
- assert_eq!(::std::mem::align_of::<[u64; 33usize]>() , 8usize , concat
- ! (
- "Alignment of template specialization: " , stringify ! (
- [u64; 33usize] ) ));
- }
}
diff --git a/tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs b/tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs
index 283b6359..159cad11 100644
--- a/tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs
+++ b/tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs
@@ -45,12 +45,3 @@ impl Usage {
__bindgen_tmp
}
}
-#[test]
-fn __bindgen_test_layout__bindgen_ty_id_21_open0__bindgen_ty_id_19_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! (
- "Size of template specialization: " , stringify ! (
- [u32; 2usize] ) ));
- assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- [u32; 2usize] ) ));
-}
diff --git a/tests/expectations/tests/libclang-3.9/partial-specialization-and-inheritance.rs b/tests/expectations/tests/libclang-3.9/partial-specialization-and-inheritance.rs
index 7760f033..4f6794e9 100644
--- a/tests/expectations/tests/libclang-3.9/partial-specialization-and-inheritance.rs
+++ b/tests/expectations/tests/libclang-3.9/partial-specialization-and-inheritance.rs
@@ -33,12 +33,3 @@ fn bindgen_test_layout_Usage() {
impl Clone for Usage {
fn clone(&self) -> Self { *self }
}
-#[test]
-fn __bindgen_test_layout__bindgen_ty_id_20_open0__bindgen_ty_id_18_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! (
- "Size of template specialization: " , stringify ! (
- [u32; 2usize] ) ));
- assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- [u32; 2usize] ) ));
-}
diff --git a/tests/expectations/tests/libclang-4/partial-specialization-and-inheritance.rs b/tests/expectations/tests/libclang-4/partial-specialization-and-inheritance.rs
index 7760f033..4f6794e9 100644
--- a/tests/expectations/tests/libclang-4/partial-specialization-and-inheritance.rs
+++ b/tests/expectations/tests/libclang-4/partial-specialization-and-inheritance.rs
@@ -33,12 +33,3 @@ fn bindgen_test_layout_Usage() {
impl Clone for Usage {
fn clone(&self) -> Self { *self }
}
-#[test]
-fn __bindgen_test_layout__bindgen_ty_id_20_open0__bindgen_ty_id_18_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! (
- "Size of template specialization: " , stringify ! (
- [u32; 2usize] ) ));
- assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- [u32; 2usize] ) ));
-}
diff --git a/tests/expectations/tests/non-type-params.rs b/tests/expectations/tests/non-type-params.rs
index b469d50d..c367d806 100644
--- a/tests/expectations/tests/non-type-params.rs
+++ b/tests/expectations/tests/non-type-params.rs
@@ -7,7 +7,7 @@
pub type Array16 = u8;
pub type ArrayInt4 = [u32; 4usize];
#[repr(C)]
-#[derive(Debug, Copy)]
+#[derive(Debug, Default, Copy)]
pub struct UsesArray {
pub array_char_16: [u8; 16usize],
pub array_bool_8: [u8; 8usize],
@@ -38,33 +38,3 @@ fn bindgen_test_layout_UsesArray() {
impl Clone for UsesArray {
fn clone(&self) -> Self { *self }
}
-impl Default for UsesArray {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
-}
-#[test]
-fn __bindgen_test_layout_Array_open0_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat ! (
- "Size of template specialization: " , stringify ! (
- [u32; 4usize] ) ));
- assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- [u32; 4usize] ) ));
-}
-#[test]
-fn __bindgen_test_layout_Array_open0_char_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<[u8; 16usize]>() , 16usize , concat ! (
- "Size of template specialization: " , stringify ! (
- [u8; 16usize] ) ));
- assert_eq!(::std::mem::align_of::<[u8; 16usize]>() , 1usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- [u8; 16usize] ) ));
-}
-#[test]
-fn __bindgen_test_layout_Array_open0_bool__close0_instantiation() {
- assert_eq!(::std::mem::size_of::<[u8; 8usize]>() , 8usize , concat ! (
- "Size of template specialization: " , stringify ! (
- [u8; 8usize] ) ));
- assert_eq!(::std::mem::align_of::<[u8; 8usize]>() , 1usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- [u8; 8usize] ) ));
-}
diff --git a/tests/expectations/tests/opaque_pointer.rs b/tests/expectations/tests/opaque_pointer.rs
index 8465ba6a..8c2cab8b 100644
--- a/tests/expectations/tests/opaque_pointer.rs
+++ b/tests/expectations/tests/opaque_pointer.rs
@@ -63,11 +63,3 @@ impl Clone for WithOpaquePtr {
impl Default for WithOpaquePtr {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
-#[test]
-fn __bindgen_test_layout_Opaque_open0_float_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<u32>() , 4usize , concat ! (
- "Size of template specialization: " , stringify ! ( u32 ) ));
- assert_eq!(::std::mem::align_of::<u32>() , 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! ( u32 )
- ));
-}
diff --git a/tests/expectations/tests/size_t_template.rs b/tests/expectations/tests/size_t_template.rs
index 188cbf2f..b3adbee6 100644
--- a/tests/expectations/tests/size_t_template.rs
+++ b/tests/expectations/tests/size_t_template.rs
@@ -5,7 +5,7 @@
#[repr(C)]
-#[derive(Debug, Copy)]
+#[derive(Debug, Default, Copy)]
pub struct C {
pub arr: [u32; 3usize],
}
@@ -24,15 +24,3 @@ fn bindgen_test_layout_C() {
impl Clone for C {
fn clone(&self) -> Self { *self }
}
-impl Default for C {
- fn default() -> Self { unsafe { ::std::mem::zeroed() } }
-}
-#[test]
-fn __bindgen_test_layout_Array_open0_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! (
- "Size of template specialization: " , stringify ! (
- [u32; 3usize] ) ));
- assert_eq!(::std::mem::align_of::<[u32; 3usize]>() , 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! (
- [u32; 3usize] ) ));
-}
diff --git a/tests/expectations/tests/template.rs b/tests/expectations/tests/template.rs
index 92ad2a54..8e432167 100644
--- a/tests/expectations/tests/template.rs
+++ b/tests/expectations/tests/template.rs
@@ -411,11 +411,3 @@ fn __bindgen_test_layout_WithDtor_open0_int_close0_instantiation() {
"Alignment of template specialization: " , stringify ! (
WithDtor<::std::os::raw::c_int> ) ));
}
-#[test]
-fn __bindgen_test_layout_Opaque_open0_int_close0_instantiation() {
- assert_eq!(::std::mem::size_of::<u32>() , 4usize , concat ! (
- "Size of template specialization: " , stringify ! ( u32 ) ));
- assert_eq!(::std::mem::align_of::<u32>() , 4usize , concat ! (
- "Alignment of template specialization: " , stringify ! ( u32 )
- ));
-}