From d4667542377d993a0c5d85cc59911d78c13ddfd3 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Wed, 8 May 2019 11:20:47 +0200 Subject: [PATCH] Update tests to account for changed #[link_name] attribute emission. --- tests/expectations/tests/bitfield_large_overflow.rs | 1 - tests/expectations/tests/class_nested.rs | 2 -- tests/expectations/tests/complex_global.rs | 3 --- tests/expectations/tests/decl_extern_int_twice.rs | 1 - tests/expectations/tests/decl_ptr_to_array.rs | 1 - tests/expectations/tests/extern-const-struct.rs | 1 - tests/expectations/tests/func_ptr.rs | 1 - tests/expectations/tests/issue-511.rs | 4 ---- .../tests/issue-574-assertion-failure-in-codegen.rs | 1 - tests/expectations/tests/keywords.rs | 12 ------------ .../tests/libclang-3.8/constant-evaluate.rs | 8 -------- .../tests/libclang-3.9/call-conv-field.rs | 1 - .../tests/libclang-3.9/constant-evaluate.rs | 1 - .../expectations/tests/libclang-4/call-conv-field.rs | 1 - .../expectations/tests/libclang-5/call-conv-field.rs | 1 - tests/expectations/tests/mangling-ios.rs | 1 - tests/expectations/tests/mangling-macos.rs | 1 - tests/expectations/tests/mangling-win32.rs | 1 - tests/expectations/tests/objc_class.rs | 1 - tests/expectations/tests/objc_interface_type.rs | 1 - tests/expectations/tests/objc_sel_and_id.rs | 2 -- .../tests/test_multiple_header_calls_in_builder.rs | 1 - tests/expectations/tests/use-core.rs | 1 - tests/expectations/tests/use-core_1_0.rs | 1 - tests/tests.rs | 2 -- 25 files changed, 51 deletions(-) diff --git a/tests/expectations/tests/bitfield_large_overflow.rs b/tests/expectations/tests/bitfield_large_overflow.rs index 7df5b937f8..ea9b97abef 100644 --- a/tests/expectations/tests/bitfield_large_overflow.rs +++ b/tests/expectations/tests/bitfield_large_overflow.rs @@ -27,6 +27,5 @@ fn bindgen_test_layout__bindgen_ty_1() { ); } extern "C" { - #[link_name = "\u{1}a"] pub static mut a: _bindgen_ty_1; } diff --git a/tests/expectations/tests/class_nested.rs b/tests/expectations/tests/class_nested.rs index 7fee662a92..efd7dac256 100644 --- a/tests/expectations/tests/class_nested.rs +++ b/tests/expectations/tests/class_nested.rs @@ -95,7 +95,6 @@ fn bindgen_test_layout_A_C() { ); } extern "C" { - #[link_name = "\u{1}var"] pub static mut var: A_B; } #[test] @@ -118,7 +117,6 @@ fn __bindgen_test_layout_A_D_open0_int_close0_instantiation() { ); } extern "C" { - #[link_name = "\u{1}baz"] pub static mut baz: A_D<::std::os::raw::c_int>; } #[repr(C)] diff --git a/tests/expectations/tests/complex_global.rs b/tests/expectations/tests/complex_global.rs index defdbe68ca..417ccd4a01 100644 --- a/tests/expectations/tests/complex_global.rs +++ b/tests/expectations/tests/complex_global.rs @@ -11,14 +11,11 @@ pub struct __BindgenComplex { pub im: T, } extern "C" { - #[link_name = "\u{1}globalValueFloat"] pub static mut globalValueFloat: __BindgenComplex; } extern "C" { - #[link_name = "\u{1}globalValueDouble"] pub static mut globalValueDouble: __BindgenComplex; } extern "C" { - #[link_name = "\u{1}globalValueLongDouble"] pub static mut globalValueLongDouble: __BindgenComplex; } diff --git a/tests/expectations/tests/decl_extern_int_twice.rs b/tests/expectations/tests/decl_extern_int_twice.rs index 995457587e..04a53e51e5 100644 --- a/tests/expectations/tests/decl_extern_int_twice.rs +++ b/tests/expectations/tests/decl_extern_int_twice.rs @@ -5,6 +5,5 @@ extern "C" { - #[link_name = "\u{1}foo"] pub static mut foo: ::std::os::raw::c_int; } diff --git a/tests/expectations/tests/decl_ptr_to_array.rs b/tests/expectations/tests/decl_ptr_to_array.rs index 6d6eeb4b88..0750bbbbcf 100644 --- a/tests/expectations/tests/decl_ptr_to_array.rs +++ b/tests/expectations/tests/decl_ptr_to_array.rs @@ -5,6 +5,5 @@ extern "C" { - #[link_name = "\u{1}foo"] pub static mut foo: *mut [::std::os::raw::c_int; 1usize]; } diff --git a/tests/expectations/tests/extern-const-struct.rs b/tests/expectations/tests/extern-const-struct.rs index 2f9ade8b03..df81311b7b 100644 --- a/tests/expectations/tests/extern-const-struct.rs +++ b/tests/expectations/tests/extern-const-struct.rs @@ -41,6 +41,5 @@ impl Default for nsFoo { } } extern "C" { - #[link_name = "\u{1}gDetails"] pub static gDetails: nsFoo; } diff --git a/tests/expectations/tests/func_ptr.rs b/tests/expectations/tests/func_ptr.rs index 730849c059..0f39a07579 100644 --- a/tests/expectations/tests/func_ptr.rs +++ b/tests/expectations/tests/func_ptr.rs @@ -5,7 +5,6 @@ extern "C" { - #[link_name = "\u{1}foo"] pub static mut foo: ::std::option::Option< unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) diff --git a/tests/expectations/tests/issue-511.rs b/tests/expectations/tests/issue-511.rs index 453fed0917..5d7982e054 100644 --- a/tests/expectations/tests/issue-511.rs +++ b/tests/expectations/tests/issue-511.rs @@ -8,18 +8,14 @@ )] extern "C" { - #[link_name = "\u{1}a"] pub static mut a: *mut ::std::os::raw::c_char; } extern "C" { - #[link_name = "\u{1}b"] pub static mut b: *const ::std::os::raw::c_char; } extern "C" { - #[link_name = "\u{1}c"] pub static c: *mut ::std::os::raw::c_char; } extern "C" { - #[link_name = "\u{1}d"] pub static d: *const ::std::os::raw::c_char; } diff --git a/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs b/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs index db573a7ec9..21d381a721 100644 --- a/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs +++ b/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs @@ -38,7 +38,6 @@ fn bindgen_test_layout__bindgen_ty_1() { ); } extern "C" { - #[link_name = "\u{1}AutoIdVector"] pub static mut AutoIdVector: _bindgen_ty_1; } #[test] diff --git a/tests/expectations/tests/keywords.rs b/tests/expectations/tests/keywords.rs index b354f431f9..35f518f812 100644 --- a/tests/expectations/tests/keywords.rs +++ b/tests/expectations/tests/keywords.rs @@ -5,51 +5,39 @@ extern "C" { - #[link_name = "\u{1}u8"] pub static mut u8: ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}u16"] pub static mut u16: ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}u32"] pub static mut u32: ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}u64"] pub static mut u64: ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}i8"] pub static mut i8: ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}i16"] pub static mut i16: ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}i32"] pub static mut i32: ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}i64"] pub static mut i64: ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}f32"] pub static mut f32: ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}f64"] pub static mut f64: ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}usize"] pub static mut usize: ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}isize"] pub static mut isize: ::std::os::raw::c_int; } extern "C" { diff --git a/tests/expectations/tests/libclang-3.8/constant-evaluate.rs b/tests/expectations/tests/libclang-3.8/constant-evaluate.rs index fa54df27a6..73455f3a6a 100644 --- a/tests/expectations/tests/libclang-3.8/constant-evaluate.rs +++ b/tests/expectations/tests/libclang-3.8/constant-evaluate.rs @@ -12,34 +12,26 @@ pub enum _bindgen_ty_1 { foo = 4, bar = 8, } pub type EasyToOverflow = ::std::os::raw::c_ulonglong; pub const k: EasyToOverflow = 2147483648; extern "C" { - #[link_name = "\u{1}k_expr"] pub static k_expr: EasyToOverflow; } extern "C" { - #[link_name = "\u{1}wow"] pub static wow: EasyToOverflow; } extern "C" { - #[link_name = "\u{1}BAZ"] pub static BAZ: ::std::os::raw::c_longlong; } extern "C" { - #[link_name = "\u{1}fuzz"] pub static fuzz: f64; } extern "C" { - #[link_name = "\u{1}BAZZ"] pub static BAZZ: ::std::os::raw::c_char; } extern "C" { - #[link_name = "\u{1}WAT"] pub static WAT: ::std::os::raw::c_char; } extern "C" { - #[link_name = "\u{1}bytestring"] pub static mut bytestring: *const ::std::os::raw::c_char; } extern "C" { - #[link_name = "\u{1}NOT_UTF8"] pub static mut NOT_UTF8: *const ::std::os::raw::c_char; } diff --git a/tests/expectations/tests/libclang-3.9/call-conv-field.rs b/tests/expectations/tests/libclang-3.9/call-conv-field.rs index 6cf8ec5b8e..7007d2217a 100644 --- a/tests/expectations/tests/libclang-3.9/call-conv-field.rs +++ b/tests/expectations/tests/libclang-3.9/call-conv-field.rs @@ -48,6 +48,5 @@ fn bindgen_test_layout_JNINativeInterface_() { ); } extern "stdcall" { - #[link_name = "\u{1}_bar@0"] pub fn bar(); } diff --git a/tests/expectations/tests/libclang-3.9/constant-evaluate.rs b/tests/expectations/tests/libclang-3.9/constant-evaluate.rs index 6a3c8a362b..7e6fcd60de 100644 --- a/tests/expectations/tests/libclang-3.9/constant-evaluate.rs +++ b/tests/expectations/tests/libclang-3.9/constant-evaluate.rs @@ -16,7 +16,6 @@ pub type EasyToOverflow = ::std::os::raw::c_ulonglong; pub const k: EasyToOverflow = 2147483648; pub const k_expr: EasyToOverflow = 0; extern "C" { - #[link_name = "\u{1}wow"] pub static wow: EasyToOverflow; } pub const BAZ: ::std::os::raw::c_longlong = 24; diff --git a/tests/expectations/tests/libclang-4/call-conv-field.rs b/tests/expectations/tests/libclang-4/call-conv-field.rs index 6cf8ec5b8e..7007d2217a 100644 --- a/tests/expectations/tests/libclang-4/call-conv-field.rs +++ b/tests/expectations/tests/libclang-4/call-conv-field.rs @@ -48,6 +48,5 @@ fn bindgen_test_layout_JNINativeInterface_() { ); } extern "stdcall" { - #[link_name = "\u{1}_bar@0"] pub fn bar(); } diff --git a/tests/expectations/tests/libclang-5/call-conv-field.rs b/tests/expectations/tests/libclang-5/call-conv-field.rs index 76712fe790..3286ac4668 100644 --- a/tests/expectations/tests/libclang-5/call-conv-field.rs +++ b/tests/expectations/tests/libclang-5/call-conv-field.rs @@ -51,6 +51,5 @@ fn bindgen_test_layout_JNINativeInterface_() { ); } extern "stdcall" { - #[link_name = "\u{1}_bar@0"] pub fn bar(); } diff --git a/tests/expectations/tests/mangling-ios.rs b/tests/expectations/tests/mangling-ios.rs index 0fddb5d707..87df5e4ad7 100644 --- a/tests/expectations/tests/mangling-ios.rs +++ b/tests/expectations/tests/mangling-ios.rs @@ -5,6 +5,5 @@ extern "C" { - #[link_name = "\u{1}_foo"] pub fn foo(); } diff --git a/tests/expectations/tests/mangling-macos.rs b/tests/expectations/tests/mangling-macos.rs index 7835dd928c..7101b321d6 100644 --- a/tests/expectations/tests/mangling-macos.rs +++ b/tests/expectations/tests/mangling-macos.rs @@ -5,7 +5,6 @@ extern "C" { - #[link_name = "\u{1}_foo"] pub fn foo(); } #[repr(C)] diff --git a/tests/expectations/tests/mangling-win32.rs b/tests/expectations/tests/mangling-win32.rs index 2d2d7fcdbd..0d9c49faf7 100644 --- a/tests/expectations/tests/mangling-win32.rs +++ b/tests/expectations/tests/mangling-win32.rs @@ -5,7 +5,6 @@ extern "C" { - #[link_name = "\u{1}_foo"] pub fn foo(); } #[repr(C)] diff --git a/tests/expectations/tests/objc_class.rs b/tests/expectations/tests/objc_class.rs index b5c15a0e2a..062cab3f20 100644 --- a/tests/expectations/tests/objc_class.rs +++ b/tests/expectations/tests/objc_class.rs @@ -9,7 +9,6 @@ extern crate objc; #[allow(non_camel_case_types)] pub type id = *mut objc::runtime::Object; extern "C" { - #[link_name = "\u{1}fooVar"] pub static mut fooVar: *mut id; } pub trait Foo { diff --git a/tests/expectations/tests/objc_interface_type.rs b/tests/expectations/tests/objc_interface_type.rs index 9931f5a94c..0b77b5bec0 100644 --- a/tests/expectations/tests/objc_interface_type.rs +++ b/tests/expectations/tests/objc_interface_type.rs @@ -47,6 +47,5 @@ extern "C" { pub fn fooFunc(foo: id); } extern "C" { - #[link_name = "\u{1}kFoo"] pub static mut kFoo: *const id; } diff --git a/tests/expectations/tests/objc_sel_and_id.rs b/tests/expectations/tests/objc_sel_and_id.rs index 8802c206ea..da69c7a897 100644 --- a/tests/expectations/tests/objc_sel_and_id.rs +++ b/tests/expectations/tests/objc_sel_and_id.rs @@ -9,11 +9,9 @@ extern crate objc; #[allow(non_camel_case_types)] pub type id = *mut objc::runtime::Object; extern "C" { - #[link_name = "\u{1}object"] pub static mut object: id; } extern "C" { - #[link_name = "\u{1}selector"] pub static mut selector: objc::runtime::Sel; } extern "C" { diff --git a/tests/expectations/tests/test_multiple_header_calls_in_builder.rs b/tests/expectations/tests/test_multiple_header_calls_in_builder.rs index 94504951d7..528a7a2fc2 100644 --- a/tests/expectations/tests/test_multiple_header_calls_in_builder.rs +++ b/tests/expectations/tests/test_multiple_header_calls_in_builder.rs @@ -1,7 +1,6 @@ /* automatically generated by rust-bindgen */ extern "C" { - #[link_name = "\u{1}foo"] pub static mut foo: ::std::option::Option< unsafe extern "C" fn(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) diff --git a/tests/expectations/tests/use-core.rs b/tests/expectations/tests/use-core.rs index 563258a0b1..8f6c4cd56e 100644 --- a/tests/expectations/tests/use-core.rs +++ b/tests/expectations/tests/use-core.rs @@ -95,7 +95,6 @@ impl Default for _bindgen_ty_1 { } } extern "C" { - #[link_name = "\u{1}bazz"] pub static mut bazz: _bindgen_ty_1; } pub type fooFunction = ::core::option::Option; diff --git a/tests/expectations/tests/use-core_1_0.rs b/tests/expectations/tests/use-core_1_0.rs index 3ce8fe5cca..ce17d3bca7 100644 --- a/tests/expectations/tests/use-core_1_0.rs +++ b/tests/expectations/tests/use-core_1_0.rs @@ -139,7 +139,6 @@ impl Clone for _bindgen_ty_1 { } } extern "C" { - #[link_name = "\u{1}bazz"] pub static mut bazz: _bindgen_ty_1; } pub type fooFunction = ::core::option::Option; diff --git a/tests/tests.rs b/tests/tests.rs index 092824f154..ee4783ebd9 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -339,11 +339,9 @@ fn test_clang_env_args() { let (expected, _) = rustfmt("/* automatically generated by rust-bindgen */ extern \"C\" { - #[link_name = \"\\u{1}x\"] pub static mut x: [::std::os::raw::c_int; 1usize]; } extern \"C\" { - #[link_name = \"\\u{1}y\"] pub static mut y: [::std::os::raw::c_int; 1usize]; } ".to_string());