diff --git a/.github/workflows/bindgen.yml b/.github/workflows/bindgen.yml index 87b2cdb1d8..95316d9705 100644 --- a/.github/workflows/bindgen.yml +++ b/.github/workflows/bindgen.yml @@ -99,7 +99,7 @@ jobs: - debian: null cross: null rust: null - llvm_version: ["4.0", "5.0", "9.0"] + llvm_version: ["5.0", "9.0"] main_tests: [1] release_build: [0, 1] no_default_features: [0, 1] @@ -109,14 +109,6 @@ jobs: feature_extra_asserts: [0] feature_testing_only_docs: [0] - exclude: - # 4.0 is too old to support regular dynamic linking, so this - # is not expected to work. - - os: ubuntu-latest - llvm_version: "4.0" - no_default_features: 1 - feature_runtime: 0 - include: # Test with extra asserts + docs just with latest llvm versions to # prevent explosion diff --git a/Cargo.toml b/Cargo.toml index cec8a57902..82f9dc17eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,4 +83,3 @@ testing_only_docs = [] testing_only_extra_assertions = [] testing_only_libclang_9 = [] testing_only_libclang_5 = [] -testing_only_libclang_4 = [] diff --git a/appveyor.yml b/appveyor.yml index 51129cdcbe..62efeea2c4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,18 +2,12 @@ environment: RUST_BACKTRACE: 1 RUST_CHANNEL: "%Configuration%" matrix: - - TARGET: gnu - LLVM_VERSION: 4.0.0-1 - BINDGEN_FEATURES: testing_only_libclang_4 - TARGET: gnu LLVM_VERSION: 5.0.0-1 BINDGEN_FEATURES: testing_only_libclang_5 - TARGET: gnu LLVM_VERSION: 9.0.0-1 BINDGEN_FEATURES: testing_only_libclang_9 - - TARGET: msvc - LLVM_VERSION: 4.0.0 - BINDGEN_FEATURES: testing_only_libclang_4 - TARGET: msvc LLVM_VERSION: 5.0.0 BINDGEN_FEATURES: testing_only_libclang_5 diff --git a/bindgen-integration/Cargo.toml b/bindgen-integration/Cargo.toml index 9dcf1d377b..733fba58db 100644 --- a/bindgen-integration/Cargo.toml +++ b/bindgen-integration/Cargo.toml @@ -18,4 +18,3 @@ testing_only_docs = ["bindgen/testing_only_docs"] testing_only_extra_assertions = ["bindgen/testing_only_extra_assertions"] testing_only_libclang_9 = ["bindgen/testing_only_libclang_9"] testing_only_libclang_5 = ["bindgen/testing_only_libclang_5"] -testing_only_libclang_4 = ["bindgen/testing_only_libclang_4"] diff --git a/src/clang.rs b/src/clang.rs index 528c8a9111..587cc0ba7d 100644 --- a/src/clang.rs +++ b/src/clang.rs @@ -2065,10 +2065,7 @@ pub struct TargetInfo { impl TargetInfo { /// Tries to obtain target information from libclang. - pub fn new(tu: &TranslationUnit) -> Option { - if !clang_getTranslationUnitTargetInfo::is_loaded() { - return None; - } + pub fn new(tu: &TranslationUnit) -> Self { let triple; let pointer_width; unsafe { @@ -2079,9 +2076,9 @@ impl TargetInfo { } assert!(pointer_width > 0); assert_eq!(pointer_width % 8, 0); - Some(TargetInfo { + TargetInfo { triple, pointer_width: pointer_width as usize, - }) + } } } diff --git a/src/ir/context.rs b/src/ir/context.rs index 9afd16d6a6..9cf43ec3c6 100644 --- a/src/ir/context.rs +++ b/src/ir/context.rs @@ -368,7 +368,7 @@ pub struct BindgenContext { translation_unit: clang::TranslationUnit, /// Target information that can be useful for some stuff. - target_info: Option, + target_info: clang::TargetInfo, /// The options given by the user via cli or other medium. options: BindgenOptions, @@ -584,10 +584,7 @@ If you encounter an error missing from this list, please file an issue or a PR!" /// Returns `true` if the target architecture is wasm32 pub fn is_target_wasm32(&self) -> bool { - match self.target_info { - Some(ref ti) => ti.triple.starts_with("wasm32-"), - None => false, - } + self.target_info.triple.starts_with("wasm32-") } /// Creates a timer for the current bindgen phase. If time_phases is `true`, @@ -600,10 +597,7 @@ If you encounter an error missing from this list, please file an issue or a PR!" /// Returns the pointer width to use for the target for the current /// translation. pub fn target_pointer_size(&self) -> usize { - if let Some(ref ti) = self.target_info { - return ti.pointer_width / 8; - } - mem::size_of::<*mut ()>() + return self.target_info.pointer_width / 8; } /// Get the stack of partially parsed types that we are in the middle of diff --git a/src/main.rs b/src/main.rs index a208957410..50f3e71440 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,8 +23,6 @@ fn clang_version_check() { Some((9, 0)) } else if cfg!(feature = "testing_only_libclang_5") { Some((5, 0)) - } else if cfg!(feature = "testing_only_libclang_4") { - Some((4, 0)) } else { None }; diff --git a/tests/expectations/build.rs b/tests/expectations/build.rs index beed7116a4..a5904d9622 100644 --- a/tests/expectations/build.rs +++ b/tests/expectations/build.rs @@ -9,7 +9,6 @@ use std::io::Write; use std::path::Path; const LIBCLANG_VERSION_DIRS: &'static [&'static str] = &[ - "libclang-4", "libclang-5", "libclang-9", ]; diff --git a/tests/expectations/tests/libclang-4/abi_variadic_function.rs b/tests/expectations/tests/libclang-4/abi_variadic_function.rs deleted file mode 100644 index 6aeb16f2a7..0000000000 --- a/tests/expectations/tests/libclang-4/abi_variadic_function.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![allow( - dead_code, - non_snake_case, - non_camel_case_types, - non_upper_case_globals -)] - -extern "C" { - #[link_name = "\u{1}_Z1bcz"] - pub fn b(arg1: ::std::os::raw::c_char, ...) -> ::std::os::raw::c_char; -} diff --git a/tests/expectations/tests/libclang-4/auto.rs b/tests/expectations/tests/libclang-4/auto.rs deleted file mode 100644 index 0b20b39eb6..0000000000 --- a/tests/expectations/tests/libclang-4/auto.rs +++ /dev/null @@ -1,35 +0,0 @@ -#![allow( - dead_code, - non_snake_case, - non_camel_case_types, - non_upper_case_globals -)] - -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct Foo { - pub _address: u8, -} -pub const Foo_kFoo: bool = true; -#[test] -fn bindgen_test_layout_Foo() { - assert_eq!( - ::std::mem::size_of::(), - 1usize, - concat!("Size of: ", stringify!(Foo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(Foo)) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct Bar { - pub _address: u8, -} -extern "C" { - #[link_name = "\u{1}_Z5Test2v"] - pub fn Test2() -> ::std::os::raw::c_uint; -} diff --git a/tests/expectations/tests/libclang-4/call-conv-field.rs b/tests/expectations/tests/libclang-4/call-conv-field.rs deleted file mode 100644 index f134bd8a46..0000000000 --- a/tests/expectations/tests/libclang-4/call-conv-field.rs +++ /dev/null @@ -1,60 +0,0 @@ -#![allow( - dead_code, - non_snake_case, - non_camel_case_types, - non_upper_case_globals -)] -#![cfg(not(test))] - -#[repr(C)] -#[derive(Default, Copy, Clone)] -pub struct JNINativeInterface_ { - pub GetVersion: ::std::option::Option< - unsafe extern "stdcall" fn( - env: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int, - >, - pub __hack: ::std::os::raw::c_ulonglong, -} -#[test] -fn bindgen_test_layout_JNINativeInterface_() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(JNINativeInterface_)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(JNINativeInterface_)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetVersion - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface_), - "::", - stringify!(GetVersion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__hack as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface_), - "::", - stringify!(__hack) - ) - ); -} -extern "stdcall" { - pub fn bar(); -} diff --git a/tests/expectations/tests/libclang-4/const_bool.rs b/tests/expectations/tests/libclang-4/const_bool.rs deleted file mode 100644 index 97e1d8dda4..0000000000 --- a/tests/expectations/tests/libclang-4/const_bool.rs +++ /dev/null @@ -1,29 +0,0 @@ -#![allow( - dead_code, - non_snake_case, - non_camel_case_types, - non_upper_case_globals -)] - -pub const k: bool = true; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct A { - pub _address: u8, -} -pub const A_k: bool = false; -#[test] -fn bindgen_test_layout_A() { - assert_eq!( - ::std::mem::size_of::(), - 1usize, - concat!("Size of: ", stringify!(A)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(A)) - ); -} -pub type foo = bool; -pub const k2: foo = true; diff --git a/tests/expectations/tests/libclang-4/constant-evaluate.rs b/tests/expectations/tests/libclang-4/constant-evaluate.rs deleted file mode 100644 index 9debe39d3e..0000000000 --- a/tests/expectations/tests/libclang-4/constant-evaluate.rs +++ /dev/null @@ -1,25 +0,0 @@ -#![allow( - dead_code, - non_snake_case, - non_camel_case_types, - non_upper_case_globals -)] - -pub const foo: _bindgen_ty_1 = _bindgen_ty_1::foo; -pub const bar: _bindgen_ty_1 = _bindgen_ty_1::bar; -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum _bindgen_ty_1 { - foo = 4, - bar = 8, -} -pub type EasyToOverflow = ::std::os::raw::c_ulonglong; -pub const k: EasyToOverflow = 2147483648; -pub const k_expr: EasyToOverflow = 1152921504606846976; -pub const wow: EasyToOverflow = 2147483648; -pub const BAZ: ::std::os::raw::c_longlong = 24; -pub const fuzz: f64 = 51.0; -pub const BAZZ: ::std::os::raw::c_char = 53; -pub const WAT: ::std::os::raw::c_char = 0; -pub const bytestring: &[u8; 4usize] = b"Foo\0"; -pub const NOT_UTF8: [u8; 5usize] = [240u8, 40u8, 140u8, 40u8, 0u8]; diff --git a/tests/expectations/tests/libclang-4/error-E0600-cannot-apply-unary-negation-to-u32.rs b/tests/expectations/tests/libclang-4/error-E0600-cannot-apply-unary-negation-to-u32.rs deleted file mode 100644 index 57878592d9..0000000000 --- a/tests/expectations/tests/libclang-4/error-E0600-cannot-apply-unary-negation-to-u32.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![allow( - dead_code, - non_snake_case, - non_camel_case_types, - non_upper_case_globals -)] -#![allow(overflowing_literals)] - -pub const a: u32 = 4294967291; diff --git a/tests/expectations/tests/libclang-4/issue-769-bad-instantiation-test.rs b/tests/expectations/tests/libclang-4/issue-769-bad-instantiation-test.rs deleted file mode 100644 index 60857966ce..0000000000 --- a/tests/expectations/tests/libclang-4/issue-769-bad-instantiation-test.rs +++ /dev/null @@ -1,67 +0,0 @@ -#![allow( - dead_code, - non_snake_case, - non_camel_case_types, - non_upper_case_globals -)] - -#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] -pub mod root { - #[allow(unused_imports)] - use self::super::root; - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct Rooted { - pub member: T, - pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, - } - impl Default for Rooted { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } - } - pub type AutoValueVector_Alias = ::std::os::raw::c_int; - #[test] - fn __bindgen_test_layout_Rooted_open0_int_close0_instantiation() { - assert_eq!( - ::std::mem::size_of::>(), - 4usize, - concat!( - "Size of template specialization: ", - stringify!(root::Rooted<::std::os::raw::c_int>) - ) - ); - assert_eq!( - ::std::mem::align_of::>(), - 4usize, - concat!( - "Alignment of template specialization: ", - stringify!(root::Rooted<::std::os::raw::c_int>) - ) - ); - } - #[test] - fn __bindgen_test_layout_Rooted_open0_AutoValueVector_Alias_close0_instantiation( - ) { - assert_eq!( - ::std::mem::size_of::>(), - 4usize, - concat!( - "Size of template specialization: ", - stringify!(root::Rooted) - ) - ); - assert_eq!( - ::std::mem::align_of::>(), - 4usize, - concat!( - "Alignment of template specialization: ", - stringify!(root::Rooted) - ) - ); - } -} diff --git a/tests/expectations/tests/libclang-4/mangling-win32.rs b/tests/expectations/tests/libclang-4/mangling-win32.rs deleted file mode 100644 index 0aee327414..0000000000 --- a/tests/expectations/tests/libclang-4/mangling-win32.rs +++ /dev/null @@ -1,52 +0,0 @@ -#![allow( - dead_code, - non_snake_case, - non_camel_case_types, - non_upper_case_globals -)] - -extern "C" { - pub fn foo(); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct Foo { - pub _address: u8, -} -extern "C" { - #[link_name = "\u{1}?sBar@Foo@@2_NA"] - pub static mut Foo_sBar: bool; -} -#[test] -fn bindgen_test_layout_Foo() { - assert_eq!( - ::std::mem::size_of::(), - 1usize, - concat!("Size of: ", stringify!(Foo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(Foo)) - ); -} -extern "fastcall" { - pub fn fast_call_func_no_args() -> ::std::os::raw::c_int; -} -extern "fastcall" { - pub fn fast_call_func_many_args( - arg1: ::std::os::raw::c_int, - arg2: ::std::os::raw::c_int, - arg3: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "stdcall" { - pub fn std_call_func_no_args() -> ::std::os::raw::c_int; -} -extern "stdcall" { - pub fn std_call_func_many_args( - arg1: ::std::os::raw::c_int, - arg2: ::std::os::raw::c_int, - arg3: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} diff --git a/tests/expectations/tests/libclang-4/objc_inheritance.rs b/tests/expectations/tests/libclang-4/objc_inheritance.rs deleted file mode 100644 index 5f07dbaab1..0000000000 --- a/tests/expectations/tests/libclang-4/objc_inheritance.rs +++ /dev/null @@ -1,117 +0,0 @@ -#![allow( - dead_code, - non_snake_case, - non_camel_case_types, - non_upper_case_globals -)] -#![cfg(target_os = "macos")] - -#[macro_use] -extern crate objc; -#[allow(non_camel_case_types)] -pub type id = *mut objc::runtime::Object; -#[repr(transparent)] -#[derive(Clone)] -pub struct Foo(pub id); -impl std::ops::Deref for Foo { - type Target = objc::runtime::Object; - fn deref(&self) -> &Self::Target { - unsafe { &*self.0 } - } -} -unsafe impl objc::Message for Foo {} -impl Foo { - pub fn alloc() -> Self { - Self(unsafe { msg_send!(objc::class!(Foo), alloc) }) - } -} -impl IFoo for Foo {} -pub trait IFoo: Sized + std::ops::Deref {} -#[repr(transparent)] -#[derive(Clone)] -pub struct Bar(pub id); -impl std::ops::Deref for Bar { - type Target = objc::runtime::Object; - fn deref(&self) -> &Self::Target { - unsafe { &*self.0 } - } -} -unsafe impl objc::Message for Bar {} -impl Bar { - pub fn alloc() -> Self { - Self(unsafe { msg_send!(objc::class!(Bar), alloc) }) - } -} -impl IFoo for Bar {} -impl From for Foo { - fn from(child: Bar) -> Foo { - Foo(child.0) - } -} -impl std::convert::TryFrom for Bar { - type Error = &'static str; - fn try_from(parent: Foo) -> Result { - let is_kind_of: bool = - unsafe { msg_send!(parent, isKindOfClass: class!(Bar)) }; - if is_kind_of { - Ok(Bar(parent.0)) - } else { - Err("This Foo cannot be downcasted to Bar") - } - } -} -impl IBar for Bar {} -pub trait IBar: Sized + std::ops::Deref {} -#[repr(transparent)] -#[derive(Clone)] -pub struct Baz(pub id); -impl std::ops::Deref for Baz { - type Target = objc::runtime::Object; - fn deref(&self) -> &Self::Target { - unsafe { &*self.0 } - } -} -unsafe impl objc::Message for Baz {} -impl Baz { - pub fn alloc() -> Self { - Self(unsafe { msg_send!(objc::class!(Baz), alloc) }) - } -} -impl IBar for Baz {} -impl From for Bar { - fn from(child: Baz) -> Bar { - Bar(child.0) - } -} -impl std::convert::TryFrom for Baz { - type Error = &'static str; - fn try_from(parent: Bar) -> Result { - let is_kind_of: bool = - unsafe { msg_send!(parent, isKindOfClass: class!(Baz)) }; - if is_kind_of { - Ok(Baz(parent.0)) - } else { - Err("This Bar cannot be downcasted to Baz") - } - } -} -impl IFoo for Baz {} -impl From for Foo { - fn from(child: Baz) -> Foo { - Foo(child.0) - } -} -impl std::convert::TryFrom for Baz { - type Error = &'static str; - fn try_from(parent: Foo) -> Result { - let is_kind_of: bool = - unsafe { msg_send!(parent, isKindOfClass: class!(Baz)) }; - if is_kind_of { - Ok(Baz(parent.0)) - } else { - Err("This Foo cannot be downcasted to Baz") - } - } -} -impl IBaz for Baz {} -pub trait IBaz: Sized + std::ops::Deref {} diff --git a/tests/expectations/tests/libclang-4/objc_template.rs b/tests/expectations/tests/libclang-4/objc_template.rs deleted file mode 100644 index 36b7d22baa..0000000000 --- a/tests/expectations/tests/libclang-4/objc_template.rs +++ /dev/null @@ -1,65 +0,0 @@ -#![allow( - dead_code, - non_snake_case, - non_camel_case_types, - non_upper_case_globals -)] -#![cfg(target_os = "macos")] - -#[macro_use] -extern crate objc; -#[allow(non_camel_case_types)] -pub type id = *mut objc::runtime::Object; -#[repr(transparent)] -#[derive(Clone)] -pub struct Foo(pub id); -impl std::ops::Deref for Foo { - type Target = objc::runtime::Object; - fn deref(&self) -> &Self::Target { - unsafe { &*self.0 } - } -} -unsafe impl objc::Message for Foo {} -impl Foo { - pub fn alloc() -> Self { - Self(unsafe { msg_send!(objc::class!(Foo), alloc) }) - } -} -impl IFoo for Foo {} -pub trait IFoo: Sized + std::ops::Deref { - unsafe fn get(&self) -> *mut ObjectType - where - ::Target: objc::Message + Sized, - { - msg_send!(*self, get) - } -} -#[repr(transparent)] -#[derive(Clone)] -pub struct FooMultiGeneric(pub id); -impl std::ops::Deref for FooMultiGeneric { - type Target = objc::runtime::Object; - fn deref(&self) -> &Self::Target { - unsafe { &*self.0 } - } -} -unsafe impl objc::Message for FooMultiGeneric {} -impl FooMultiGeneric { - pub fn alloc() -> Self { - Self(unsafe { msg_send!(objc::class!(FooMultiGeneric), alloc) }) - } -} -impl - IFooMultiGeneric for FooMultiGeneric -{ -} -pub trait IFooMultiGeneric: - Sized + std::ops::Deref -{ - unsafe fn objectForKey_(&self, key: *mut KeyType) -> *mut ObjectType - where - ::Target: objc::Message + Sized, - { - msg_send!(*self, objectForKey: key) - } -} diff --git a/tests/expectations/tests/libclang-4/partial-specialization-and-inheritance.rs b/tests/expectations/tests/libclang-4/partial-specialization-and-inheritance.rs deleted file mode 100644 index e62ea68172..0000000000 --- a/tests/expectations/tests/libclang-4/partial-specialization-and-inheritance.rs +++ /dev/null @@ -1,39 +0,0 @@ -#![allow( - dead_code, - non_snake_case, - non_camel_case_types, - non_upper_case_globals -)] - -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct Base { - pub _address: u8, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct Derived { - pub b: bool, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct Usage { - pub _address: u8, -} -extern "C" { - #[link_name = "\u{1}_ZN5Usage13static_memberE"] - pub static mut Usage_static_member: [u32; 2usize]; -} -#[test] -fn bindgen_test_layout_Usage() { - assert_eq!( - ::std::mem::size_of::(), - 1usize, - concat!("Size of: ", stringify!(Usage)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(Usage)) - ); -} diff --git a/tests/expectations/tests/libclang-4/type_alias_template_specialized.rs b/tests/expectations/tests/libclang-4/type_alias_template_specialized.rs deleted file mode 100644 index f874e9d221..0000000000 --- a/tests/expectations/tests/libclang-4/type_alias_template_specialized.rs +++ /dev/null @@ -1,65 +0,0 @@ -#![allow( - dead_code, - non_snake_case, - non_camel_case_types, - non_upper_case_globals -)] - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Rooted { - pub ptr: MaybeWrapped<::std::os::raw::c_int>, -} -#[test] -fn bindgen_test_layout_Rooted() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(Rooted)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(Rooted)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ptr as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Rooted), - "::", - stringify!(ptr) - ) - ); -} -impl Default for Rooted { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -///
-pub type MaybeWrapped
= a; -#[test] -fn __bindgen_test_layout_MaybeWrapped_open0_int_close0_instantiation() { - assert_eq!( - ::std::mem::size_of::>(), - 4usize, - concat!( - "Size of template specialization: ", - stringify!(MaybeWrapped<::std::os::raw::c_int>) - ) - ); - assert_eq!( - ::std::mem::align_of::>(), - 4usize, - concat!( - "Alignment of template specialization: ", - stringify!(MaybeWrapped<::std::os::raw::c_int>) - ) - ); -} diff --git a/tests/expectations/tests/libclang-4/wasm-constructor-returns.rs b/tests/expectations/tests/libclang-4/wasm-constructor-returns.rs deleted file mode 100644 index f207d0d8e1..0000000000 --- a/tests/expectations/tests/libclang-4/wasm-constructor-returns.rs +++ /dev/null @@ -1,37 +0,0 @@ -#![allow( - dead_code, - non_snake_case, - non_camel_case_types, - non_upper_case_globals -)] - -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct Foo { - pub _address: u8, -} -#[test] -fn bindgen_test_layout_Foo() { - assert_eq!( - ::std::mem::size_of::(), - 1usize, - concat!("Size of: ", stringify!(Foo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(Foo)) - ); -} -extern "C" { - #[link_name = "\u{1}_ZN3FooC1Ei"] - pub fn Foo_Foo(this: *mut Foo, var: ::std::os::raw::c_int); -} -impl Foo { - #[inline] - pub unsafe fn new(var: ::std::os::raw::c_int) -> Self { - let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit(); - Foo_Foo(__bindgen_tmp.as_mut_ptr(), var); - __bindgen_tmp.assume_init() - } -} diff --git a/tests/stylo_sanity.rs b/tests/stylo_sanity.rs index f44f12878d..52b96355e0 100755 --- a/tests/stylo_sanity.rs +++ b/tests/stylo_sanity.rs @@ -16,7 +16,6 @@ extern crate bindgen; #[test] #[cfg(not(any(debug_assertions, feature = "testing_only_extra_assertions",)))] #[cfg(any( - feature = "testing_only_libclang_4", feature = "testing_only_libclang_5", feature = "testing_only_libclang_9" ))] diff --git a/tests/tests.rs b/tests/tests.rs index 1f116c93b3..a3e27f05fb 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -141,8 +141,6 @@ fn compare_generated_header( expectation.push("libclang-9"); } else if cfg!(feature = "testing_only_libclang_5") { expectation.push("libclang-5"); - } else if cfg!(feature = "testing_only_libclang_4") { - expectation.push("libclang-4"); } else { match clang_version().parsed { None => expectation.push("libclang-9"),