diff --git a/bindgen-tests/tests/expectations/tests/abi_variadic_function.rs b/bindgen-tests/tests/expectations/tests/abi_variadic_function.rs index b57ddafd32..8713f87161 100644 --- a/bindgen-tests/tests/expectations/tests/abi_variadic_function.rs +++ b/bindgen-tests/tests/expectations/tests/abi_variadic_function.rs @@ -1,5 +1,5 @@ #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] unsafe extern "C" { - #[link_name = "\u{1}_Z1bcz"] + #[link_name = "_Z1bcz"] pub fn b(arg1: ::std::os::raw::c_char, ...) -> ::std::os::raw::c_char; } diff --git a/bindgen-tests/tests/expectations/tests/allowlist-file.rs b/bindgen-tests/tests/expectations/tests/allowlist-file.rs index b1fb170de0..7768fbec05 100644 --- a/bindgen-tests/tests/expectations/tests/allowlist-file.rs +++ b/bindgen-tests/tests/expectations/tests/allowlist-file.rs @@ -1,7 +1,7 @@ #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] pub const SOME_DEFUN: u32 = 123; unsafe extern "C" { - #[link_name = "\u{1}_Z12SomeFunctionv"] + #[link_name = "_Z12SomeFunctionv"] pub fn SomeFunction(); } unsafe extern "C" { @@ -18,7 +18,7 @@ const _: () = { ["Alignment of someClass"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN9someClass16somePublicMethodEi"] + #[link_name = "_ZN9someClass16somePublicMethodEi"] pub fn someClass_somePublicMethod(this: *mut someClass, foo: ::std::os::raw::c_int); } impl someClass { @@ -31,7 +31,7 @@ unsafe extern "C" { pub fn ExternFunction(); } unsafe extern "C" { - #[link_name = "\u{1}_ZN3foo18NamespacedFunctionEv"] + #[link_name = "_ZN3foo18NamespacedFunctionEv"] pub fn foo_NamespacedFunction(); } #[repr(C)] diff --git a/bindgen-tests/tests/expectations/tests/arg_keyword.rs b/bindgen-tests/tests/expectations/tests/arg_keyword.rs index 5a48aba011..347ac41bbe 100644 --- a/bindgen-tests/tests/expectations/tests/arg_keyword.rs +++ b/bindgen-tests/tests/expectations/tests/arg_keyword.rs @@ -1,5 +1,5 @@ #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] unsafe extern "C" { - #[link_name = "\u{1}_Z3fooPKc"] + #[link_name = "_Z3fooPKc"] pub fn foo(type_: *const ::std::os::raw::c_char); } diff --git a/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result.rs b/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result.rs index 07eb7a80f6..9e5c320d81 100644 --- a/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result.rs +++ b/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result.rs @@ -11,7 +11,7 @@ fn bindgen_test_layout_Foo() { } extern "C" { #[must_use] - #[link_name = "\u{1}_ZN3Foo3fooEi"] + #[link_name = "_ZN3Foo3fooEi"] pub fn Foo_foo(this: *mut Foo, arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } impl Foo { @@ -23,6 +23,6 @@ impl Foo { } extern "C" { #[must_use] - #[link_name = "\u{1}_Z3fooi"] + #[link_name = "_Z3fooi"] pub fn foo(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } diff --git a/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result_no_attribute_detection.rs b/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result_no_attribute_detection.rs index aa01540b0e..fcae752ad2 100644 --- a/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result_no_attribute_detection.rs +++ b/bindgen-tests/tests/expectations/tests/attribute_warn_unused_result_no_attribute_detection.rs @@ -10,7 +10,7 @@ fn bindgen_test_layout_Foo() { assert_eq!(::std::mem::align_of::(), 1usize, "Alignment of Foo"); } extern "C" { - #[link_name = "\u{1}_ZN3Foo3fooEi"] + #[link_name = "_ZN3Foo3fooEi"] pub fn Foo_foo(this: *mut Foo, arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } impl Foo { @@ -20,6 +20,6 @@ impl Foo { } } extern "C" { - #[link_name = "\u{1}_Z3fooi"] + #[link_name = "_Z3fooi"] pub fn foo(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } diff --git a/bindgen-tests/tests/expectations/tests/auto.rs b/bindgen-tests/tests/expectations/tests/auto.rs index ba93e7a20b..c1ea95f701 100644 --- a/bindgen-tests/tests/expectations/tests/auto.rs +++ b/bindgen-tests/tests/expectations/tests/auto.rs @@ -16,6 +16,6 @@ pub struct Bar { pub _address: u8, } unsafe extern "C" { - #[link_name = "\u{1}_Z5Test2v"] + #[link_name = "_Z5Test2v"] pub fn Test2() -> ::std::os::raw::c_uint; } diff --git a/bindgen-tests/tests/expectations/tests/bitfield-method-same-name.rs b/bindgen-tests/tests/expectations/tests/bitfield-method-same-name.rs index 84e152f3fd..2d66a8d2b1 100644 --- a/bindgen-tests/tests/expectations/tests/bitfield-method-same-name.rs +++ b/bindgen-tests/tests/expectations/tests/bitfield-method-same-name.rs @@ -157,15 +157,15 @@ const _: () = { ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN3Foo4typeEv"] + #[link_name = "_ZN3Foo4typeEv"] pub fn Foo_type(this: *mut Foo) -> ::std::os::raw::c_char; } unsafe extern "C" { - #[link_name = "\u{1}_ZN3Foo9set_type_Ec"] + #[link_name = "_ZN3Foo9set_type_Ec"] pub fn Foo_set_type_(this: *mut Foo, c: ::std::os::raw::c_char); } unsafe extern "C" { - #[link_name = "\u{1}_ZN3Foo8set_typeEc"] + #[link_name = "_ZN3Foo8set_typeEc"] pub fn Foo_set_type(this: *mut Foo, c: ::std::os::raw::c_char); } impl Foo { diff --git a/bindgen-tests/tests/expectations/tests/blocklist-function.rs b/bindgen-tests/tests/expectations/tests/blocklist-function.rs index 65b66b2ac2..64b3dfb812 100644 --- a/bindgen-tests/tests/expectations/tests/blocklist-function.rs +++ b/bindgen-tests/tests/expectations/tests/blocklist-function.rs @@ -11,7 +11,7 @@ pub mod root { #[allow(unused_imports)] use self::super::super::root; unsafe extern "C" { - #[link_name = "\u{1}_ZN3bar18NamespacedFunctionEv"] + #[link_name = "_ZN3bar18NamespacedFunctionEv"] pub fn NamespacedFunction(); } } diff --git a/bindgen-tests/tests/expectations/tests/blocklist-item.rs b/bindgen-tests/tests/expectations/tests/blocklist-item.rs index c5daf050a1..db82565a22 100644 --- a/bindgen-tests/tests/expectations/tests/blocklist-item.rs +++ b/bindgen-tests/tests/expectations/tests/blocklist-item.rs @@ -11,7 +11,7 @@ pub mod root { #[allow(unused_imports)] use self::super::super::root; unsafe extern "C" { - #[link_name = "\u{1}_ZN3bar18NamespacedFunctionEv"] + #[link_name = "_ZN3bar18NamespacedFunctionEv"] pub fn NamespacedFunction(); } } diff --git a/bindgen-tests/tests/expectations/tests/blocklist-methods.rs b/bindgen-tests/tests/expectations/tests/blocklist-methods.rs index c89cadb3d5..46c81ba08c 100644 --- a/bindgen-tests/tests/expectations/tests/blocklist-methods.rs +++ b/bindgen-tests/tests/expectations/tests/blocklist-methods.rs @@ -10,7 +10,7 @@ const _: () = { ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN3Foo3fooEv"] + #[link_name = "_ZN3Foo3fooEv"] pub fn Foo_foo(this: *mut Foo) -> ::std::os::raw::c_int; } impl Foo { diff --git a/bindgen-tests/tests/expectations/tests/blocks-signature.rs b/bindgen-tests/tests/expectations/tests/blocks-signature.rs index 93cf28e009..68cc1aa355 100644 --- a/bindgen-tests/tests/expectations/tests/blocks-signature.rs +++ b/bindgen-tests/tests/expectations/tests/blocks-signature.rs @@ -2,24 +2,24 @@ #![cfg(target_os = "macos")] extern crate block; unsafe extern "C" { - #[link_name = "\u{1}_Z8atexit_bU13block_pointerFvvE"] + #[link_name = "_Z8atexit_bU13block_pointerFvvE"] pub fn atexit_b(arg1: _bindgen_ty_id_33); } pub type dispatch_data_t = *mut ::std::os::raw::c_void; pub type dispatch_data_applier_t = _bindgen_ty_id_40; unsafe extern "C" { - #[link_name = "\u{1}_Z19dispatch_data_applyPvU13block_pointerFbS_yPKvyE"] + #[link_name = "_Z19dispatch_data_applyPvU13block_pointerFbS_yPKvyE"] pub fn dispatch_data_apply( data: dispatch_data_t, applier: dispatch_data_applier_t, ) -> bool; } unsafe extern "C" { - #[link_name = "\u{1}_Z3fooU13block_pointerFvyE"] + #[link_name = "_Z3fooU13block_pointerFvyE"] pub fn foo(arg1: _bindgen_ty_id_50) -> bool; } unsafe extern "C" { - #[link_name = "\u{1}_Z7foo_ptrPU13block_pointerFvyE"] + #[link_name = "_Z7foo_ptrPU13block_pointerFvyE"] pub fn foo_ptr(arg1: *mut _bindgen_ty_id_56) -> bool; } #[repr(C)] diff --git a/bindgen-tests/tests/expectations/tests/blocks.rs b/bindgen-tests/tests/expectations/tests/blocks.rs index 4f51113c4b..9b0b74566b 100644 --- a/bindgen-tests/tests/expectations/tests/blocks.rs +++ b/bindgen-tests/tests/expectations/tests/blocks.rs @@ -1,24 +1,24 @@ #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] #![cfg(target_os = "macos")] unsafe extern "C" { - #[link_name = "\u{1}_Z8atexit_bU13block_pointerFvvE"] + #[link_name = "_Z8atexit_bU13block_pointerFvvE"] pub fn atexit_b(arg1: *mut ::std::os::raw::c_void); } pub type dispatch_data_t = *mut ::std::os::raw::c_void; pub type dispatch_data_applier_t = *mut ::std::os::raw::c_void; unsafe extern "C" { - #[link_name = "\u{1}_Z19dispatch_data_applyPvU13block_pointerFbS_yPKvyE"] + #[link_name = "_Z19dispatch_data_applyPvU13block_pointerFbS_yPKvyE"] pub fn dispatch_data_apply( data: dispatch_data_t, applier: dispatch_data_applier_t, ) -> bool; } unsafe extern "C" { - #[link_name = "\u{1}_Z3fooU13block_pointerFvyE"] + #[link_name = "_Z3fooU13block_pointerFvyE"] pub fn foo(arg1: *mut ::std::os::raw::c_void) -> bool; } unsafe extern "C" { - #[link_name = "\u{1}_Z7foo_ptrPU13block_pointerFvyE"] + #[link_name = "_Z7foo_ptrPU13block_pointerFvyE"] pub fn foo_ptr(arg1: *mut *mut ::std::os::raw::c_void) -> bool; } #[repr(C)] diff --git a/bindgen-tests/tests/expectations/tests/call-conv-field.rs b/bindgen-tests/tests/expectations/tests/call-conv-field.rs index 8f0502a435..8ce6c1a06f 100644 --- a/bindgen-tests/tests/expectations/tests/call-conv-field.rs +++ b/bindgen-tests/tests/expectations/tests/call-conv-field.rs @@ -26,5 +26,6 @@ const _: () = { ][::std::mem::offset_of!(JNINativeInterface_, __hack) - 8usize]; }; unsafe extern "stdcall" { + #[link_name = "\u{1}_bar@0"] pub fn bar(); } diff --git a/bindgen-tests/tests/expectations/tests/canonical_path_without_namespacing.rs b/bindgen-tests/tests/expectations/tests/canonical_path_without_namespacing.rs index 613da3060f..91e7320574 100644 --- a/bindgen-tests/tests/expectations/tests/canonical_path_without_namespacing.rs +++ b/bindgen-tests/tests/expectations/tests/canonical_path_without_namespacing.rs @@ -10,6 +10,6 @@ const _: () = { ["Alignment of Bar"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_Z3bazPN3foo3BarE"] + #[link_name = "_Z3bazPN3foo3BarE"] pub fn baz(arg1: *mut Bar); } diff --git a/bindgen-tests/tests/expectations/tests/char16_t.rs b/bindgen-tests/tests/expectations/tests/char16_t.rs index 82d30fe517..e7ac259cfe 100644 --- a/bindgen-tests/tests/expectations/tests/char16_t.rs +++ b/bindgen-tests/tests/expectations/tests/char16_t.rs @@ -2,6 +2,6 @@ #[repr(transparent)] pub struct bindgen_cchar16_t(u16); unsafe extern "C" { - #[link_name = "\u{1}_Z16receive_char16_tDs"] + #[link_name = "_Z16receive_char16_tDs"] pub fn receive_char16_t(input: bindgen_cchar16_t); } diff --git a/bindgen-tests/tests/expectations/tests/class.rs b/bindgen-tests/tests/expectations/tests/class.rs index 69591d1bce..c88d68835a 100644 --- a/bindgen-tests/tests/expectations/tests/class.rs +++ b/bindgen-tests/tests/expectations/tests/class.rs @@ -446,26 +446,26 @@ fn bindgen_test_layout_RealAbstractionWithTonsOfMethods() { ); } extern "C" { - #[link_name = "\u{1}_ZNK32RealAbstractionWithTonsOfMethods3barEv"] + #[link_name = "_ZNK32RealAbstractionWithTonsOfMethods3barEv"] pub fn RealAbstractionWithTonsOfMethods_bar( this: *const RealAbstractionWithTonsOfMethods, ); } extern "C" { - #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEv"] + #[link_name = "_ZN32RealAbstractionWithTonsOfMethods3barEv"] pub fn RealAbstractionWithTonsOfMethods_bar1( this: *mut RealAbstractionWithTonsOfMethods, ); } extern "C" { - #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEi"] + #[link_name = "_ZN32RealAbstractionWithTonsOfMethods3barEi"] pub fn RealAbstractionWithTonsOfMethods_bar2( this: *mut RealAbstractionWithTonsOfMethods, foo: ::std::os::raw::c_int, ); } extern "C" { - #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3staEv"] + #[link_name = "_ZN32RealAbstractionWithTonsOfMethods3staEv"] pub fn RealAbstractionWithTonsOfMethods_sta(); } impl RealAbstractionWithTonsOfMethods { diff --git a/bindgen-tests/tests/expectations/tests/class_static.rs b/bindgen-tests/tests/expectations/tests/class_static.rs index d448165d62..0b8294856b 100644 --- a/bindgen-tests/tests/expectations/tests/class_static.rs +++ b/bindgen-tests/tests/expectations/tests/class_static.rs @@ -5,11 +5,11 @@ pub struct MyClass { pub _address: u8, } unsafe extern "C" { - #[link_name = "\u{1}_ZN7MyClass7exampleE"] + #[link_name = "_ZN7MyClass7exampleE"] pub static mut MyClass_example: *const ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}_ZN7MyClass26example_check_no_collisionE"] + #[link_name = "_ZN7MyClass26example_check_no_collisionE"] pub static mut MyClass_example_check_no_collision: *const ::std::os::raw::c_int; } #[allow(clippy::unnecessary_operation, clippy::identity_op)] @@ -18,6 +18,6 @@ const _: () = { ["Alignment of MyClass"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZL26example_check_no_collision"] + #[link_name = "_ZL26example_check_no_collision"] pub static mut example_check_no_collision: *const ::std::os::raw::c_int; } diff --git a/bindgen-tests/tests/expectations/tests/class_with_typedef.rs b/bindgen-tests/tests/expectations/tests/class_with_typedef.rs index 73f2b55cc3..508509f998 100644 --- a/bindgen-tests/tests/expectations/tests/class_with_typedef.rs +++ b/bindgen-tests/tests/expectations/tests/class_with_typedef.rs @@ -22,19 +22,19 @@ const _: () = { ["Offset of field: C::other_ptr"][::std::mem::offset_of!(C, other_ptr) - 64usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN1C6methodEi"] + #[link_name = "_ZN1C6methodEi"] pub fn C_method(this: *mut C, c: C_MyInt); } unsafe extern "C" { - #[link_name = "\u{1}_ZN1C9methodRefERi"] + #[link_name = "_ZN1C9methodRefERi"] pub fn C_methodRef(this: *mut C, c: *mut C_MyInt); } unsafe extern "C" { - #[link_name = "\u{1}_ZN1C16complexMethodRefERPKc"] + #[link_name = "_ZN1C16complexMethodRefERPKc"] pub fn C_complexMethodRef(this: *mut C, c: *mut C_Lookup); } unsafe extern "C" { - #[link_name = "\u{1}_ZN1C13anotherMethodEi"] + #[link_name = "_ZN1C13anotherMethodEi"] pub fn C_anotherMethod(this: *mut C, c: AnotherInt); } impl Default for C { diff --git a/bindgen-tests/tests/expectations/tests/constify-module-enums-types.rs b/bindgen-tests/tests/expectations/tests/constify-module-enums-types.rs index 6ba94cb3b9..24dff991b5 100644 --- a/bindgen-tests/tests/expectations/tests/constify-module-enums-types.rs +++ b/bindgen-tests/tests/expectations/tests/constify-module-enums-types.rs @@ -115,7 +115,7 @@ impl Default for Bar { } } unsafe extern "C" { - #[link_name = "\u{1}_Z5func13fooPS_PS0_"] + #[link_name = "_Z5func13fooPS_PS0_"] pub fn func1( arg1: foo::Type, arg2: *mut foo::Type, @@ -123,7 +123,7 @@ unsafe extern "C" { ) -> *mut foo::Type; } unsafe extern "C" { - #[link_name = "\u{1}_Z5func23fooPS_PS0_"] + #[link_name = "_Z5func23fooPS_PS0_"] pub fn func2( arg1: foo_alias1, arg2: *mut foo_alias1, @@ -146,10 +146,10 @@ impl Default for Thing { } } unsafe extern "C" { - #[link_name = "\u{1}_Z5func35ThingI3fooE"] + #[link_name = "_Z5func35ThingI3fooE"] pub fn func3(arg1: Thing) -> foo::Type; } unsafe extern "C" { - #[link_name = "\u{1}_Z5func45ThingIS_I3fooEE"] + #[link_name = "_Z5func45ThingIS_I3fooEE"] pub fn func4(arg1: Thing>) -> foo::Type; } diff --git a/bindgen-tests/tests/expectations/tests/constructor-tp.rs b/bindgen-tests/tests/expectations/tests/constructor-tp.rs index 2585311d29..5509cc0559 100644 --- a/bindgen-tests/tests/expectations/tests/constructor-tp.rs +++ b/bindgen-tests/tests/expectations/tests/constructor-tp.rs @@ -15,7 +15,7 @@ const _: () = { ["Alignment of Bar"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN3BarC1Ev"] + #[link_name = "_ZN3BarC1Ev"] pub fn Bar_Bar(this: *mut Bar); } impl Bar { diff --git a/bindgen-tests/tests/expectations/tests/constructors.rs b/bindgen-tests/tests/expectations/tests/constructors.rs index 45c29e61e5..0a52eda67d 100644 --- a/bindgen-tests/tests/expectations/tests/constructors.rs +++ b/bindgen-tests/tests/expectations/tests/constructors.rs @@ -10,14 +10,14 @@ const _: () = { ["Alignment of TestOverload"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN12TestOverloadC1Ei"] + #[link_name = "_ZN12TestOverloadC1Ei"] pub fn TestOverload_TestOverload( this: *mut TestOverload, arg1: ::std::os::raw::c_int, ); } unsafe extern "C" { - #[link_name = "\u{1}_ZN12TestOverloadC1Ed"] + #[link_name = "_ZN12TestOverloadC1Ed"] pub fn TestOverload_TestOverload1(this: *mut TestOverload, arg1: f64); } impl TestOverload { @@ -47,7 +47,7 @@ const _: () = { ][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN16TestPublicNoArgsC1Ev"] + #[link_name = "_ZN16TestPublicNoArgsC1Ev"] pub fn TestPublicNoArgs_TestPublicNoArgs(this: *mut TestPublicNoArgs); } impl TestPublicNoArgs { diff --git a/bindgen-tests/tests/expectations/tests/constructors_1_33.rs b/bindgen-tests/tests/expectations/tests/constructors_1_33.rs index 0563b4e65d..8c4da62977 100644 --- a/bindgen-tests/tests/expectations/tests/constructors_1_33.rs +++ b/bindgen-tests/tests/expectations/tests/constructors_1_33.rs @@ -15,7 +15,7 @@ fn bindgen_test_layout_TestOverload() { } extern "C" { /// Calling this should use `mem::unintialized()` and not `MaybeUninit()` as only rust 1.36 includes that. - #[link_name = "\u{1}_ZN12TestOverloadC1Ei"] + #[link_name = "_ZN12TestOverloadC1Ei"] pub fn TestOverload_TestOverload( this: *mut TestOverload, arg1: ::std::os::raw::c_int, @@ -23,7 +23,7 @@ extern "C" { } extern "C" { /// Calling this should use `mem::unintialized()` and not `MaybeUninit()` as only rust 1.36 includes that. - #[link_name = "\u{1}_ZN12TestOverloadC1Ed"] + #[link_name = "_ZN12TestOverloadC1Ed"] pub fn TestOverload_TestOverload1(this: *mut TestOverload, arg1: f64); } impl TestOverload { @@ -59,7 +59,7 @@ fn bindgen_test_layout_TestPublicNoArgs() { ); } extern "C" { - #[link_name = "\u{1}_ZN16TestPublicNoArgsC1Ev"] + #[link_name = "_ZN16TestPublicNoArgsC1Ev"] pub fn TestPublicNoArgs_TestPublicNoArgs(this: *mut TestPublicNoArgs); } impl TestPublicNoArgs { diff --git a/bindgen-tests/tests/expectations/tests/default-template-parameter.rs b/bindgen-tests/tests/expectations/tests/default-template-parameter.rs index 67f8a486de..8cf4482501 100644 --- a/bindgen-tests/tests/expectations/tests/default-template-parameter.rs +++ b/bindgen-tests/tests/expectations/tests/default-template-parameter.rs @@ -26,6 +26,6 @@ const _: () = { ][::std::mem::align_of::>() - 4usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZL3bar"] + #[link_name = "_ZL3bar"] pub static mut bar: Foo; } diff --git a/bindgen-tests/tests/expectations/tests/deleted-function.rs b/bindgen-tests/tests/expectations/tests/deleted-function.rs index fc8588121f..0f5a83743f 100644 --- a/bindgen-tests/tests/expectations/tests/deleted-function.rs +++ b/bindgen-tests/tests/expectations/tests/deleted-function.rs @@ -10,11 +10,11 @@ const _: () = { ["Alignment of A"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN1A17inline_definitionEv"] + #[link_name = "_ZN1A17inline_definitionEv"] pub fn A_inline_definition(this: *mut A); } unsafe extern "C" { - #[link_name = "\u{1}_ZN1A22out_of_line_definitionEv"] + #[link_name = "_ZN1A22out_of_line_definitionEv"] pub fn A_out_of_line_definition(this: *mut A); } impl A { @@ -48,7 +48,7 @@ const _: () = { ["Alignment of C"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN1CC1ERS_"] + #[link_name = "_ZN1CC1ERS_"] pub fn C_C(this: *mut C, arg1: *mut C); } impl C { diff --git a/bindgen-tests/tests/expectations/tests/derive-bitfield-method-same-name.rs b/bindgen-tests/tests/expectations/tests/derive-bitfield-method-same-name.rs index 05e66a72bc..7d075ba344 100644 --- a/bindgen-tests/tests/expectations/tests/derive-bitfield-method-same-name.rs +++ b/bindgen-tests/tests/expectations/tests/derive-bitfield-method-same-name.rs @@ -111,15 +111,15 @@ fn bindgen_test_layout_Foo() { ); } extern "C" { - #[link_name = "\u{1}_ZN3Foo4typeEv"] + #[link_name = "_ZN3Foo4typeEv"] pub fn Foo_type(this: *mut Foo) -> ::std::os::raw::c_char; } extern "C" { - #[link_name = "\u{1}_ZN3Foo9set_type_Ec"] + #[link_name = "_ZN3Foo9set_type_Ec"] pub fn Foo_set_type_(this: *mut Foo, c: ::std::os::raw::c_char); } extern "C" { - #[link_name = "\u{1}_ZN3Foo8set_typeEc"] + #[link_name = "_ZN3Foo8set_typeEc"] pub fn Foo_set_type(this: *mut Foo, c: ::std::os::raw::c_char); } impl Default for Foo { diff --git a/bindgen-tests/tests/expectations/tests/duplicated-definition-count.rs b/bindgen-tests/tests/expectations/tests/duplicated-definition-count.rs index 86e1edbbf9..f57d2f05a3 100644 --- a/bindgen-tests/tests/expectations/tests/duplicated-definition-count.rs +++ b/bindgen-tests/tests/expectations/tests/duplicated-definition-count.rs @@ -10,7 +10,7 @@ const _: () = { ["Alignment of BitStream"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN9BitStream5WriteEPKcj"] + #[link_name = "_ZN9BitStream5WriteEPKcj"] pub fn BitStream_Write( this: *mut BitStream, inputByteArray: *const ::std::os::raw::c_char, @@ -18,7 +18,7 @@ unsafe extern "C" { ); } unsafe extern "C" { - #[link_name = "\u{1}_ZN9BitStream5WriteEPS_j"] + #[link_name = "_ZN9BitStream5WriteEPS_j"] pub fn BitStream_Write1( this: *mut BitStream, bitStream: *mut BitStream, @@ -26,7 +26,7 @@ unsafe extern "C" { ); } unsafe extern "C" { - #[link_name = "\u{1}_ZN9BitStream6Write1Ev"] + #[link_name = "_ZN9BitStream6Write1Ev"] pub fn BitStream_Write11(this: *mut BitStream); } impl BitStream { diff --git a/bindgen-tests/tests/expectations/tests/dynamic_loading_with_blocklist.rs b/bindgen-tests/tests/expectations/tests/dynamic_loading_with_blocklist.rs index 8c86674f7a..d78c15867f 100644 --- a/bindgen-tests/tests/expectations/tests/dynamic_loading_with_blocklist.rs +++ b/bindgen-tests/tests/expectations/tests/dynamic_loading_with_blocklist.rs @@ -11,15 +11,15 @@ const _: () = { ["Offset of field: X::_x"][::std::mem::offset_of!(X, _x) - 0usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN1X13some_functionEv"] + #[link_name = "_ZN1X13some_functionEv"] pub fn X_some_function(this: *mut X); } unsafe extern "C" { - #[link_name = "\u{1}_ZN1X19some_other_functionEv"] + #[link_name = "_ZN1X19some_other_functionEv"] pub fn X_some_other_function(this: *mut X); } unsafe extern "C" { - #[link_name = "\u{1}_ZN1XC1Ei"] + #[link_name = "_ZN1XC1Ei"] pub fn X_X(this: *mut X, x: ::std::os::raw::c_int); } impl X { diff --git a/bindgen-tests/tests/expectations/tests/dynamic_loading_with_class.rs b/bindgen-tests/tests/expectations/tests/dynamic_loading_with_class.rs index 65ff2b2f72..3a41bc568a 100644 --- a/bindgen-tests/tests/expectations/tests/dynamic_loading_with_class.rs +++ b/bindgen-tests/tests/expectations/tests/dynamic_loading_with_class.rs @@ -11,15 +11,15 @@ const _: () = { ["Offset of field: A::_x"][::std::mem::offset_of!(A, _x) - 0usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN1A13some_functionEv"] + #[link_name = "_ZN1A13some_functionEv"] pub fn A_some_function(this: *mut A); } unsafe extern "C" { - #[link_name = "\u{1}_ZN1A19some_other_functionEv"] + #[link_name = "_ZN1A19some_other_functionEv"] pub fn A_some_other_function(this: *mut A); } unsafe extern "C" { - #[link_name = "\u{1}_ZN1AC1Ei"] + #[link_name = "_ZN1AC1Ei"] pub fn A_A(this: *mut A, x: ::std::os::raw::c_int); } impl A { diff --git a/bindgen-tests/tests/expectations/tests/elaborated.rs b/bindgen-tests/tests/expectations/tests/elaborated.rs index 81c0733089..2d3597508a 100644 --- a/bindgen-tests/tests/expectations/tests/elaborated.rs +++ b/bindgen-tests/tests/expectations/tests/elaborated.rs @@ -1,6 +1,6 @@ #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] pub type whatever_whatever_t = ::std::os::raw::c_int; unsafe extern "C" { - #[link_name = "\u{1}_Z9somethingPKi"] + #[link_name = "_Z9somethingPKi"] pub fn something(wat: *const whatever_whatever_t); } diff --git a/bindgen-tests/tests/expectations/tests/enum_and_vtable_mangling.rs b/bindgen-tests/tests/expectations/tests/enum_and_vtable_mangling.rs index 0a7e16d6dd..9d8ce36aac 100644 --- a/bindgen-tests/tests/expectations/tests/enum_and_vtable_mangling.rs +++ b/bindgen-tests/tests/expectations/tests/enum_and_vtable_mangling.rs @@ -33,6 +33,6 @@ impl Default for C { } } unsafe extern "C" { - #[link_name = "\u{1}_ZN1C5matchEv"] + #[link_name = "_ZN1C5matchEv"] pub fn C_match(this: *mut ::std::os::raw::c_void); } diff --git a/bindgen-tests/tests/expectations/tests/forward_declared_complex_types.rs b/bindgen-tests/tests/expectations/tests/forward_declared_complex_types.rs index 79554d58e4..9fbb00465a 100644 --- a/bindgen-tests/tests/expectations/tests/forward_declared_complex_types.rs +++ b/bindgen-tests/tests/expectations/tests/forward_declared_complex_types.rs @@ -35,7 +35,7 @@ impl Default for Bar { } } unsafe extern "C" { - #[link_name = "\u{1}_Z10baz_structP3Foo"] + #[link_name = "_Z10baz_structP3Foo"] pub fn baz_struct(f: *mut Foo); } #[repr(C)] @@ -44,7 +44,7 @@ pub struct Union { _unused: [u8; 0], } unsafe extern "C" { - #[link_name = "\u{1}_Z9baz_unionP5Union"] + #[link_name = "_Z9baz_unionP5Union"] pub fn baz_union(u: *mut Union); } #[repr(C)] @@ -53,6 +53,6 @@ pub struct Quux { _unused: [u8; 0], } unsafe extern "C" { - #[link_name = "\u{1}_Z9baz_classP4Quux"] + #[link_name = "_Z9baz_classP4Quux"] pub fn baz_class(q: *mut Quux); } diff --git a/bindgen-tests/tests/expectations/tests/gen-constructors.rs b/bindgen-tests/tests/expectations/tests/gen-constructors.rs index 80e6a25d70..34605f0f16 100644 --- a/bindgen-tests/tests/expectations/tests/gen-constructors.rs +++ b/bindgen-tests/tests/expectations/tests/gen-constructors.rs @@ -10,7 +10,7 @@ const _: () = { ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN3FooC1Ei"] + #[link_name = "_ZN3FooC1Ei"] pub fn Foo_Foo(this: *mut Foo, a: ::std::os::raw::c_int); } impl Foo { diff --git a/bindgen-tests/tests/expectations/tests/gen-destructors.rs b/bindgen-tests/tests/expectations/tests/gen-destructors.rs index c860c9985f..4f4b3739f6 100644 --- a/bindgen-tests/tests/expectations/tests/gen-destructors.rs +++ b/bindgen-tests/tests/expectations/tests/gen-destructors.rs @@ -11,7 +11,7 @@ const _: () = { ["Offset of field: Foo::bar"][::std::mem::offset_of!(Foo, bar) - 0usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN3FooD1Ev"] + #[link_name = "_ZN3FooD1Ev"] pub fn Foo_Foo_destructor(this: *mut Foo); } impl Foo { diff --git a/bindgen-tests/tests/expectations/tests/generate-inline.rs b/bindgen-tests/tests/expectations/tests/generate-inline.rs index c100f3936c..a5a1e148bc 100644 --- a/bindgen-tests/tests/expectations/tests/generate-inline.rs +++ b/bindgen-tests/tests/expectations/tests/generate-inline.rs @@ -10,7 +10,7 @@ const _: () = { ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN3Foo3barEv"] + #[link_name = "_ZN3Foo3barEv"] pub fn Foo_bar() -> ::std::os::raw::c_int; } impl Foo { @@ -20,6 +20,6 @@ impl Foo { } } unsafe extern "C" { - #[link_name = "\u{1}_Z3foov"] + #[link_name = "_Z3foov"] pub fn foo() -> ::std::os::raw::c_int; } diff --git a/bindgen-tests/tests/expectations/tests/inner-typedef-gh422.rs b/bindgen-tests/tests/expectations/tests/inner-typedef-gh422.rs index 16b1eb48ea..a0bcd27b21 100644 --- a/bindgen-tests/tests/expectations/tests/inner-typedef-gh422.rs +++ b/bindgen-tests/tests/expectations/tests/inner-typedef-gh422.rs @@ -21,7 +21,7 @@ impl Default for Foo_InnerType { } pub type Bar = InnerType; unsafe extern "C" { - #[link_name = "\u{1}_Z4funcv"] + #[link_name = "_Z4funcv"] pub fn func() -> Bar; } #[repr(C)] diff --git a/bindgen-tests/tests/expectations/tests/inner_const.rs b/bindgen-tests/tests/expectations/tests/inner_const.rs index ad8af7ce35..d3b311e411 100644 --- a/bindgen-tests/tests/expectations/tests/inner_const.rs +++ b/bindgen-tests/tests/expectations/tests/inner_const.rs @@ -5,11 +5,11 @@ pub struct Foo { pub bar: ::std::os::raw::c_int, } unsafe extern "C" { - #[link_name = "\u{1}_ZN3Foo3BOOE"] + #[link_name = "_ZN3Foo3BOOE"] pub static mut Foo_BOO: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}_ZN3Foo8whateverE"] + #[link_name = "_ZN3Foo8whateverE"] pub static mut Foo_whatever: Foo; } #[allow(clippy::unnecessary_operation, clippy::identity_op)] diff --git a/bindgen-tests/tests/expectations/tests/issue-1118-using-forward-decl.rs b/bindgen-tests/tests/expectations/tests/issue-1118-using-forward-decl.rs index 7df1cdb741..de9012d554 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1118-using-forward-decl.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1118-using-forward-decl.rs @@ -59,7 +59,7 @@ impl Default for nsIContent { } } unsafe extern "C" { - #[link_name = "\u{1}_Z35Gecko_GetAnonymousContentForElementv"] + #[link_name = "_Z35Gecko_GetAnonymousContentForElementv"] pub fn Gecko_GetAnonymousContentForElement() -> *mut nsTArray; } #[allow(clippy::unnecessary_operation, clippy::identity_op)] diff --git a/bindgen-tests/tests/expectations/tests/issue-1350-attribute-overloadable.rs b/bindgen-tests/tests/expectations/tests/issue-1350-attribute-overloadable.rs index c033570793..a9e7bda1ec 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1350-attribute-overloadable.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1350-attribute-overloadable.rs @@ -1,9 +1,9 @@ #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] unsafe extern "C" { - #[link_name = "\u{1}_Z11my_functioni"] + #[link_name = "_Z11my_functioni"] pub fn my_function(a: ::std::os::raw::c_int); } unsafe extern "C" { - #[link_name = "\u{1}_Z11my_functionPKc"] + #[link_name = "_Z11my_functionPKc"] pub fn my_function1(a: *const ::std::os::raw::c_char); } diff --git a/bindgen-tests/tests/expectations/tests/issue-1375-prefixed-functions.rs b/bindgen-tests/tests/expectations/tests/issue-1375-prefixed-functions.rs index f5e231ea96..cc5009aa92 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1375-prefixed-functions.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1375-prefixed-functions.rs @@ -1,13 +1,13 @@ #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] unsafe extern "C" { - #[link_name = "\u{1}my_custom_prefix_var_const_name"] + #[link_name = "my_custom_prefix_var_const_name"] pub static var_const_name: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}my_custom_prefix_var_mut_name"] + #[link_name = "my_custom_prefix_var_mut_name"] pub static mut var_mut_name: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}my_custom_prefix_function_name"] + #[link_name = "my_custom_prefix_function_name"] pub fn function_name(x: ::std::os::raw::c_int); } diff --git a/bindgen-tests/tests/expectations/tests/issue-1435.rs b/bindgen-tests/tests/expectations/tests/issue-1435.rs index 7b9bfe8422..2fe67a5626 100644 --- a/bindgen-tests/tests/expectations/tests/issue-1435.rs +++ b/bindgen-tests/tests/expectations/tests/issue-1435.rs @@ -12,7 +12,7 @@ pub mod root { } pub use self::super::root::ns::AB as AB; unsafe extern "C" { - #[link_name = "\u{1}_ZL2kA"] + #[link_name = "_ZL2kA"] pub static kA: root::AB; } } diff --git a/bindgen-tests/tests/expectations/tests/issue-2019.rs b/bindgen-tests/tests/expectations/tests/issue-2019.rs index 4c91cf9972..df2d440007 100644 --- a/bindgen-tests/tests/expectations/tests/issue-2019.rs +++ b/bindgen-tests/tests/expectations/tests/issue-2019.rs @@ -11,7 +11,7 @@ const _: () = { ["Offset of field: A::a"][::std::mem::offset_of!(A, a) - 0usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN1A4makeEv"] + #[link_name = "_ZN1A4makeEv"] pub fn make() -> A; } impl A { @@ -32,7 +32,7 @@ const _: () = { ["Offset of field: B::b"][::std::mem::offset_of!(B, b) - 0usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN1B4makeEv"] + #[link_name = "_ZN1B4makeEv"] pub fn make1() -> B; } impl B { diff --git a/bindgen-tests/tests/expectations/tests/issue-2556.rs b/bindgen-tests/tests/expectations/tests/issue-2556.rs index 92fe5026b8..55c0187f1e 100644 --- a/bindgen-tests/tests/expectations/tests/issue-2556.rs +++ b/bindgen-tests/tests/expectations/tests/issue-2556.rs @@ -24,7 +24,7 @@ pub mod root { #[allow(unused_imports)] use self::super::super::root; unsafe extern "C" { - #[link_name = "\u{1}_ZN3fooL22kFallbackIntrinsicSizeE"] + #[link_name = "_ZN3fooL22kFallbackIntrinsicSizeE"] pub static kFallbackIntrinsicSize: root::nsSize; } } diff --git a/bindgen-tests/tests/expectations/tests/issue-410.rs b/bindgen-tests/tests/expectations/tests/issue-410.rs index cda9b6e338..876ba0d39c 100644 --- a/bindgen-tests/tests/expectations/tests/issue-410.rs +++ b/bindgen-tests/tests/expectations/tests/issue-410.rs @@ -17,7 +17,7 @@ pub mod root { ["Alignment of Value"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN2JS5Value1aE10JSWhyMagic"] + #[link_name = "_ZN2JS5Value1aE10JSWhyMagic"] pub fn Value_a(this: *mut root::JS::Value, arg1: root::JSWhyMagic); } impl Value { diff --git a/bindgen-tests/tests/expectations/tests/issue-447.rs b/bindgen-tests/tests/expectations/tests/issue-447.rs index 8867a359a2..9884581d3b 100644 --- a/bindgen-tests/tests/expectations/tests/issue-447.rs +++ b/bindgen-tests/tests/expectations/tests/issue-447.rs @@ -40,7 +40,7 @@ pub mod root { ][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN17JSAutoCompartmentC1EN7mozilla6detail19GuardObjectNotifierE"] + #[link_name = "_ZN17JSAutoCompartmentC1EN7mozilla6detail19GuardObjectNotifierE"] pub fn JSAutoCompartment_JSAutoCompartment( this: *mut root::JSAutoCompartment, arg1: root::mozilla::detail::GuardObjectNotifier, diff --git a/bindgen-tests/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs b/bindgen-tests/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs index 2a85837e3d..479ecd1e97 100644 --- a/bindgen-tests/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs +++ b/bindgen-tests/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs @@ -68,7 +68,7 @@ impl Default for b { } } unsafe extern "C" { - #[link_name = "\u{1}_Z25Servo_Element_GetSnapshotv"] + #[link_name = "_Z25Servo_Element_GetSnapshotv"] pub fn Servo_Element_GetSnapshot() -> A; } #[allow(clippy::unnecessary_operation, clippy::identity_op)] diff --git a/bindgen-tests/tests/expectations/tests/issue-801-opaque-sloppiness.rs b/bindgen-tests/tests/expectations/tests/issue-801-opaque-sloppiness.rs index 90eb048640..fc39fa232a 100644 --- a/bindgen-tests/tests/expectations/tests/issue-801-opaque-sloppiness.rs +++ b/bindgen-tests/tests/expectations/tests/issue-801-opaque-sloppiness.rs @@ -16,7 +16,7 @@ const _: () = { ["Alignment of B"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN1B1aE"] + #[link_name = "_ZN1B1aE"] pub static mut B_a: A; } #[repr(C)] diff --git a/bindgen-tests/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs b/bindgen-tests/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs index 3d3ee5e590..f090353707 100644 --- a/bindgen-tests/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs +++ b/bindgen-tests/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs @@ -41,11 +41,11 @@ const _: () = { ["Alignment of Opaque"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN6Opaque17eleven_out_of_tenEv"] + #[link_name = "_ZN6Opaque17eleven_out_of_tenEv"] pub fn Opaque_eleven_out_of_ten(this: *mut Opaque) -> SuchWow; } unsafe extern "C" { - #[link_name = "\u{1}_ZN6OpaqueC1E6Pupper"] + #[link_name = "_ZN6OpaqueC1E6Pupper"] pub fn Opaque_Opaque(this: *mut Opaque, pup: Pupper); } impl Opaque { @@ -61,7 +61,7 @@ impl Opaque { } } unsafe extern "C" { - #[link_name = "\u{1}_ZN6Opaque11MAJESTIC_AFE"] + #[link_name = "_ZN6Opaque11MAJESTIC_AFE"] pub static mut Opaque_MAJESTIC_AF: Doggo; } #[repr(C)] diff --git a/bindgen-tests/tests/expectations/tests/issue-888-enum-var-decl-jump.rs b/bindgen-tests/tests/expectations/tests/issue-888-enum-var-decl-jump.rs index 023c8695e3..a00c87b557 100644 --- a/bindgen-tests/tests/expectations/tests/issue-888-enum-var-decl-jump.rs +++ b/bindgen-tests/tests/expectations/tests/issue-888-enum-var-decl-jump.rs @@ -12,7 +12,7 @@ pub mod root { pub _address: u8, } unsafe extern "C" { - #[link_name = "\u{1}_ZN6Halide4Type1bE"] + #[link_name = "_ZN6Halide4Type1bE"] pub static mut Type_b: root::a; } #[allow(clippy::unnecessary_operation, clippy::identity_op)] diff --git a/bindgen-tests/tests/expectations/tests/keywords.rs b/bindgen-tests/tests/expectations/tests/keywords.rs index 0a55ee0463..347342d0ab 100644 --- a/bindgen-tests/tests/expectations/tests/keywords.rs +++ b/bindgen-tests/tests/expectations/tests/keywords.rs @@ -1,225 +1,225 @@ #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] unsafe extern "C" { - #[link_name = "\u{1}u8"] + #[link_name = "u8"] pub static mut u8_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}u16"] + #[link_name = "u16"] pub static mut u16_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}u32"] + #[link_name = "u32"] pub static mut u32_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}u64"] + #[link_name = "u64"] pub static mut u64_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}i8"] + #[link_name = "i8"] pub static mut i8_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}i16"] + #[link_name = "i16"] pub static mut i16_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}i32"] + #[link_name = "i32"] pub static mut i32_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}i64"] + #[link_name = "i64"] pub static mut i64_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}f32"] + #[link_name = "f32"] pub static mut f32_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}f64"] + #[link_name = "f64"] pub static mut f64_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}usize"] + #[link_name = "usize"] pub static mut usize_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}isize"] + #[link_name = "isize"] pub static mut isize_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}bool"] + #[link_name = "bool"] pub static mut bool_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}str"] + #[link_name = "str"] pub static mut str_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}dyn"] + #[link_name = "dyn"] pub static mut dyn_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}as"] + #[link_name = "as"] pub static mut as_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}async"] + #[link_name = "async"] pub static mut async_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}await"] + #[link_name = "await"] pub static mut await_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}box"] + #[link_name = "box"] pub static mut box_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}crate"] + #[link_name = "crate"] pub static mut crate_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}false"] + #[link_name = "false"] pub static mut false_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}fn"] + #[link_name = "fn"] pub static mut fn_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}gen"] + #[link_name = "gen"] pub static mut gen_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}impl"] + #[link_name = "impl"] pub static mut impl_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}in"] + #[link_name = "in"] pub static mut in_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}let"] + #[link_name = "let"] pub static mut let_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}loop"] + #[link_name = "loop"] pub static mut loop_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}match"] + #[link_name = "match"] pub static mut match_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}mod"] + #[link_name = "mod"] pub static mut mod_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}move"] + #[link_name = "move"] pub static mut move_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}mut"] + #[link_name = "mut"] pub static mut mut_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}pub"] + #[link_name = "pub"] pub static mut pub_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}ref"] + #[link_name = "ref"] pub static mut ref_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}self"] + #[link_name = "self"] pub static mut self_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}Self"] + #[link_name = "Self"] pub static mut Self_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}super"] + #[link_name = "super"] pub static mut super_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}trait"] + #[link_name = "trait"] pub static mut trait_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}true"] + #[link_name = "true"] pub static mut true_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}try"] + #[link_name = "try"] pub static mut try_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}type"] + #[link_name = "type"] pub static mut type_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}unsafe"] + #[link_name = "unsafe"] pub static mut unsafe_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}use"] + #[link_name = "use"] pub static mut use_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}where"] + #[link_name = "where"] pub static mut where_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}abstract"] + #[link_name = "abstract"] pub static mut abstract_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}alignof"] + #[link_name = "alignof"] pub static mut alignof_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}become"] + #[link_name = "become"] pub static mut become_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}final"] + #[link_name = "final"] pub static mut final_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}macro"] + #[link_name = "macro"] pub static mut macro_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}offsetof"] + #[link_name = "offsetof"] pub static mut offsetof_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}override"] + #[link_name = "override"] pub static mut override_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}priv"] + #[link_name = "priv"] pub static mut priv_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}proc"] + #[link_name = "proc"] pub static mut proc_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}pure"] + #[link_name = "pure"] pub static mut pure_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}unsized"] + #[link_name = "unsized"] pub static mut unsized_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}virtual"] + #[link_name = "virtual"] pub static mut virtual_: ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}yield"] + #[link_name = "yield"] pub static mut yield_: ::std::os::raw::c_int; } diff --git a/bindgen-tests/tests/expectations/tests/mangling-linux32.rs b/bindgen-tests/tests/expectations/tests/mangling-linux32.rs index b6ed9146da..251487b425 100644 --- a/bindgen-tests/tests/expectations/tests/mangling-linux32.rs +++ b/bindgen-tests/tests/expectations/tests/mangling-linux32.rs @@ -8,7 +8,7 @@ pub struct Foo { pub _address: u8, } unsafe extern "C" { - #[link_name = "\u{1}_ZN3Foo4sBarE"] + #[link_name = "_ZN3Foo4sBarE"] pub static mut Foo_sBar: bool; } #[allow(clippy::unnecessary_operation, clippy::identity_op)] diff --git a/bindgen-tests/tests/expectations/tests/mangling-linux64.rs b/bindgen-tests/tests/expectations/tests/mangling-linux64.rs index b6ed9146da..251487b425 100644 --- a/bindgen-tests/tests/expectations/tests/mangling-linux64.rs +++ b/bindgen-tests/tests/expectations/tests/mangling-linux64.rs @@ -8,7 +8,7 @@ pub struct Foo { pub _address: u8, } unsafe extern "C" { - #[link_name = "\u{1}_ZN3Foo4sBarE"] + #[link_name = "_ZN3Foo4sBarE"] pub static mut Foo_sBar: bool; } #[allow(clippy::unnecessary_operation, clippy::identity_op)] diff --git a/bindgen-tests/tests/expectations/tests/mangling-macos.rs b/bindgen-tests/tests/expectations/tests/mangling-macos.rs index 237859e23b..2f8c37e3cd 100644 --- a/bindgen-tests/tests/expectations/tests/mangling-macos.rs +++ b/bindgen-tests/tests/expectations/tests/mangling-macos.rs @@ -8,7 +8,7 @@ pub struct Foo { pub _address: u8, } unsafe extern "C" { - #[link_name = "\u{1}__ZN3Foo4sBarE"] + #[link_name = "__ZN3Foo4sBarE"] pub static mut Foo_sBar: bool; } #[allow(clippy::unnecessary_operation, clippy::identity_op)] diff --git a/bindgen-tests/tests/expectations/tests/mangling-win32.rs b/bindgen-tests/tests/expectations/tests/mangling-win32.rs index 263f619374..6065b7c459 100644 --- a/bindgen-tests/tests/expectations/tests/mangling-win32.rs +++ b/bindgen-tests/tests/expectations/tests/mangling-win32.rs @@ -18,9 +18,11 @@ const _: () = { ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; }; unsafe extern "fastcall" { + #[link_name = "\u{1}@fast_call_func_no_args@0"] pub fn fast_call_func_no_args() -> ::std::os::raw::c_int; } unsafe extern "fastcall" { + #[link_name = "\u{1}@fast_call_func_many_args@12"] pub fn fast_call_func_many_args( arg1: ::std::os::raw::c_int, arg2: ::std::os::raw::c_int, @@ -28,9 +30,11 @@ unsafe extern "fastcall" { ) -> ::std::os::raw::c_int; } unsafe extern "stdcall" { + #[link_name = "\u{1}_std_call_func_no_args@0"] pub fn std_call_func_no_args() -> ::std::os::raw::c_int; } unsafe extern "stdcall" { + #[link_name = "\u{1}_std_call_func_many_args@12"] pub fn std_call_func_many_args( arg1: ::std::os::raw::c_int, arg2: ::std::os::raw::c_int, diff --git a/bindgen-tests/tests/expectations/tests/merge_extern_blocks_post_1_82.rs b/bindgen-tests/tests/expectations/tests/merge_extern_blocks_post_1_82.rs index 98659f6382..f76c0f6acb 100644 --- a/bindgen-tests/tests/expectations/tests/merge_extern_blocks_post_1_82.rs +++ b/bindgen-tests/tests/expectations/tests/merge_extern_blocks_post_1_82.rs @@ -29,16 +29,16 @@ pub mod root { ["Offset of field: Point::x"][::std::mem::offset_of!(Point, x) - 0usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN2ns3fooEv"] + #[link_name = "_ZN2ns3fooEv"] pub fn foo() -> ::std::os::raw::c_int; - #[link_name = "\u{1}_ZN2ns3barEv"] + #[link_name = "_ZN2ns3barEv"] pub fn bar() -> ::std::os::raw::c_int; } } unsafe extern "C" { - #[link_name = "\u{1}_Z3foov"] + #[link_name = "_Z3foov"] pub fn foo() -> ::std::os::raw::c_int; - #[link_name = "\u{1}_Z3barv"] + #[link_name = "_Z3barv"] pub fn bar() -> ::std::os::raw::c_int; } } diff --git a/bindgen-tests/tests/expectations/tests/merge_extern_blocks_pre_1_82.rs b/bindgen-tests/tests/expectations/tests/merge_extern_blocks_pre_1_82.rs index 595d865af1..402d93eab1 100644 --- a/bindgen-tests/tests/expectations/tests/merge_extern_blocks_pre_1_82.rs +++ b/bindgen-tests/tests/expectations/tests/merge_extern_blocks_pre_1_82.rs @@ -29,16 +29,16 @@ pub mod root { ["Offset of field: Point::x"][::std::mem::offset_of!(Point, x) - 0usize]; }; extern "C" { - #[link_name = "\u{1}_ZN2ns3fooEv"] + #[link_name = "_ZN2ns3fooEv"] pub fn foo() -> ::std::os::raw::c_int; - #[link_name = "\u{1}_ZN2ns3barEv"] + #[link_name = "_ZN2ns3barEv"] pub fn bar() -> ::std::os::raw::c_int; } } extern "C" { - #[link_name = "\u{1}_Z3foov"] + #[link_name = "_Z3foov"] pub fn foo() -> ::std::os::raw::c_int; - #[link_name = "\u{1}_Z3barv"] + #[link_name = "_Z3barv"] pub fn bar() -> ::std::os::raw::c_int; } } diff --git a/bindgen-tests/tests/expectations/tests/method-mangling.rs b/bindgen-tests/tests/expectations/tests/method-mangling.rs index 4c86825cce..e98bf1e411 100644 --- a/bindgen-tests/tests/expectations/tests/method-mangling.rs +++ b/bindgen-tests/tests/expectations/tests/method-mangling.rs @@ -10,7 +10,7 @@ const _: () = { ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN3Foo4typeEv"] + #[link_name = "_ZN3Foo4typeEv"] pub fn Foo_type(this: *mut Foo) -> ::std::os::raw::c_int; } impl Foo { diff --git a/bindgen-tests/tests/expectations/tests/namespace.rs b/bindgen-tests/tests/expectations/tests/namespace.rs index 4e58fa7ab1..6f0331e13f 100644 --- a/bindgen-tests/tests/expectations/tests/namespace.rs +++ b/bindgen-tests/tests/expectations/tests/namespace.rs @@ -4,7 +4,7 @@ pub mod root { #[allow(unused_imports)] use self::super::root; unsafe extern "C" { - #[link_name = "\u{1}_Z9top_levelv"] + #[link_name = "_Z9top_levelv"] pub fn top_level(); } pub mod whatever { @@ -13,7 +13,7 @@ pub mod root { pub type whatever_other_thing_t = whatever_int_t; pub type whatever_int_t = ::std::os::raw::c_int; unsafe extern "C" { - #[link_name = "\u{1}_ZN8whatever11in_whateverEv"] + #[link_name = "_ZN8whatever11in_whateverEv"] pub fn in_whatever(); } } @@ -70,15 +70,15 @@ pub mod root { } } unsafe extern "C" { - #[link_name = "\u{1}_ZN1w3hehEv"] + #[link_name = "_ZN1w3hehEv"] pub fn heh() -> root::w::whatever_int_t; } unsafe extern "C" { - #[link_name = "\u{1}_ZN1w3fooEv"] + #[link_name = "_ZN1w3fooEv"] pub fn foo() -> root::C<::std::os::raw::c_int>; } unsafe extern "C" { - #[link_name = "\u{1}_ZN1w4barrEv"] + #[link_name = "_ZN1w4barrEv"] pub fn barr() -> root::C; } } @@ -86,7 +86,7 @@ pub mod root { #[allow(unused_imports)] use self::super::super::root; unsafe extern "C" { - #[link_name = "\u{1}_ZN6foobar3fooEv"] + #[link_name = "_ZN6foobar3fooEv"] pub fn foo(); } } @@ -94,7 +94,7 @@ pub mod root { #[allow(unused_imports)] use self::super::super::root; unsafe extern "C" { - #[link_name = "\u{1}_ZN7faraway3barEv"] + #[link_name = "_ZN7faraway3barEv"] pub fn bar(); } } diff --git a/bindgen-tests/tests/expectations/tests/nested_vtable.rs b/bindgen-tests/tests/expectations/tests/nested_vtable.rs index 12aa2ea441..cb0e7ab1a3 100644 --- a/bindgen-tests/tests/expectations/tests/nested_vtable.rs +++ b/bindgen-tests/tests/expectations/tests/nested_vtable.rs @@ -25,7 +25,7 @@ impl Default for nsISupports { } } unsafe extern "C" { - #[link_name = "\u{1}_ZN11nsISupports14QueryInterfaceEv"] + #[link_name = "_ZN11nsISupports14QueryInterfaceEv"] pub fn nsISupports_QueryInterface( this: *mut ::std::os::raw::c_void, ) -> *mut nsISupports; diff --git a/bindgen-tests/tests/expectations/tests/noreturn.rs b/bindgen-tests/tests/expectations/tests/noreturn.rs index 0e601b5510..07c3e95fea 100644 --- a/bindgen-tests/tests/expectations/tests/noreturn.rs +++ b/bindgen-tests/tests/expectations/tests/noreturn.rs @@ -1,21 +1,21 @@ #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] unsafe extern "C" { - #[link_name = "\u{1}_Z1fv"] + #[link_name = "_Z1fv"] pub fn f() -> !; } unsafe extern "C" { - #[link_name = "\u{1}_Z1gv"] + #[link_name = "_Z1gv"] pub fn g() -> !; } unsafe extern "C" { - #[link_name = "\u{1}_Z1hv"] + #[link_name = "_Z1hv"] pub fn h() -> !; } unsafe extern "C" { - #[link_name = "\u{1}_Z1iPFvvE"] + #[link_name = "_Z1iPFvvE"] pub fn i(arg: ::std::option::Option !>); } unsafe extern "C" { - #[link_name = "\u{1}_Z1jPFvvE"] + #[link_name = "_Z1jPFvvE"] pub fn j(arg: ::std::option::Option !>) -> !; } diff --git a/bindgen-tests/tests/expectations/tests/opaque-tracing.rs b/bindgen-tests/tests/expectations/tests/opaque-tracing.rs index 60d249a88c..3e7e622546 100644 --- a/bindgen-tests/tests/expectations/tests/opaque-tracing.rs +++ b/bindgen-tests/tests/expectations/tests/opaque-tracing.rs @@ -1,6 +1,6 @@ #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] unsafe extern "C" { - #[link_name = "\u{1}_Z3fooP9Container"] + #[link_name = "_Z3fooP9Container"] pub fn foo(c: *mut Container); } #[repr(C)] diff --git a/bindgen-tests/tests/expectations/tests/operator.rs b/bindgen-tests/tests/expectations/tests/operator.rs index ce5a652d8d..80339a00cd 100644 --- a/bindgen-tests/tests/expectations/tests/operator.rs +++ b/bindgen-tests/tests/expectations/tests/operator.rs @@ -1,6 +1,6 @@ #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] unsafe extern "C" { - #[link_name = "\u{1}_Z20operator_informationv"] + #[link_name = "_Z20operator_informationv"] pub fn operator_information() -> ::std::os::raw::c_int; } #[repr(C)] diff --git a/bindgen-tests/tests/expectations/tests/overloading.rs b/bindgen-tests/tests/expectations/tests/overloading.rs index 96504b38eb..277f346a0b 100644 --- a/bindgen-tests/tests/expectations/tests/overloading.rs +++ b/bindgen-tests/tests/expectations/tests/overloading.rs @@ -1,17 +1,17 @@ #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] unsafe extern "C" { - #[link_name = "\u{1}_Z8Evaluatec"] + #[link_name = "_Z8Evaluatec"] pub fn Evaluate(r: ::std::os::raw::c_char) -> bool; } unsafe extern "C" { - #[link_name = "\u{1}_Z8Evaluateii"] + #[link_name = "_Z8Evaluateii"] pub fn Evaluate1(x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> bool; } unsafe extern "C" { - #[link_name = "\u{1}_ZN3foo10MyFunctionEv"] + #[link_name = "_ZN3foo10MyFunctionEv"] pub fn foo_MyFunction(); } unsafe extern "C" { - #[link_name = "\u{1}_ZN3bar10MyFunctionEv"] + #[link_name = "_ZN3bar10MyFunctionEv"] pub fn bar_MyFunction(); } diff --git a/bindgen-tests/tests/expectations/tests/packed-vtable.rs b/bindgen-tests/tests/expectations/tests/packed-vtable.rs index 362017a233..5a9d9ef1ff 100644 --- a/bindgen-tests/tests/expectations/tests/packed-vtable.rs +++ b/bindgen-tests/tests/expectations/tests/packed-vtable.rs @@ -25,6 +25,6 @@ impl Default for PackedVtable { } } extern "C" { - #[link_name = "\u{1}_ZN12PackedVtableD1Ev"] + #[link_name = "_ZN12PackedVtableD1Ev"] pub fn PackedVtable_PackedVtable_destructor(this: *mut PackedVtable); } diff --git a/bindgen-tests/tests/expectations/tests/parm-union.rs b/bindgen-tests/tests/expectations/tests/parm-union.rs index 6dee4ec7d5..a63aded861 100644 --- a/bindgen-tests/tests/expectations/tests/parm-union.rs +++ b/bindgen-tests/tests/expectations/tests/parm-union.rs @@ -10,7 +10,7 @@ const _: () = { ["Alignment of Struct"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN6Struct8FunctionER5Union"] + #[link_name = "_ZN6Struct8FunctionER5Union"] pub fn Struct_Function(this: *mut Struct, arg1: *mut Union); } impl Struct { diff --git a/bindgen-tests/tests/expectations/tests/partial-specialization-and-inheritance.rs b/bindgen-tests/tests/expectations/tests/partial-specialization-and-inheritance.rs index a4234d2aaa..8e9284fb7d 100644 --- a/bindgen-tests/tests/expectations/tests/partial-specialization-and-inheritance.rs +++ b/bindgen-tests/tests/expectations/tests/partial-specialization-and-inheritance.rs @@ -25,7 +25,7 @@ pub struct Usage { pub _address: u8, } unsafe extern "C" { - #[link_name = "\u{1}_ZN5Usage13static_memberE"] + #[link_name = "_ZN5Usage13static_memberE"] pub static mut Usage_static_member: __BindgenOpaqueArray; } #[allow(clippy::unnecessary_operation, clippy::identity_op)] diff --git a/bindgen-tests/tests/expectations/tests/public-dtor.rs b/bindgen-tests/tests/expectations/tests/public-dtor.rs index 578d3e76a5..70f940ed83 100644 --- a/bindgen-tests/tests/expectations/tests/public-dtor.rs +++ b/bindgen-tests/tests/expectations/tests/public-dtor.rs @@ -10,7 +10,7 @@ const _: () = { ["Alignment of cv_Foo"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN2cv3FooD1Ev"] + #[link_name = "_ZN2cv3FooD1Ev"] pub fn cv_Foo_Foo_destructor(this: *mut cv_Foo); } impl cv_Foo { diff --git a/bindgen-tests/tests/expectations/tests/ref_argument_array.rs b/bindgen-tests/tests/expectations/tests/ref_argument_array.rs index 4928a185fe..73d60d8de2 100644 --- a/bindgen-tests/tests/expectations/tests/ref_argument_array.rs +++ b/bindgen-tests/tests/expectations/tests/ref_argument_array.rs @@ -27,7 +27,7 @@ impl Default for nsID { } } unsafe extern "C" { - #[link_name = "\u{1}_ZN4nsID16ToProvidedStringERA10_c"] + #[link_name = "_ZN4nsID16ToProvidedStringERA10_c"] pub fn nsID_ToProvidedString( this: *mut ::std::os::raw::c_void, aDest: *mut [::std::os::raw::c_char; 10usize], diff --git a/bindgen-tests/tests/expectations/tests/sorted_items.rs b/bindgen-tests/tests/expectations/tests/sorted_items.rs index 1c235fb31d..d8caeb4116 100644 --- a/bindgen-tests/tests/expectations/tests/sorted_items.rs +++ b/bindgen-tests/tests/expectations/tests/sorted_items.rs @@ -61,30 +61,30 @@ pub mod root { #[allow(unused_imports)] use self::super::super::root; unsafe extern "C" { - #[link_name = "\u{1}_ZN2ns3fooEv"] + #[link_name = "_ZN2ns3fooEv"] pub fn foo() -> ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}_ZN2ns3barEi"] + #[link_name = "_ZN2ns3barEi"] pub fn bar(x: root::ns::number) -> ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}_ZN2ns3bazENS_5PointE"] + #[link_name = "_ZN2ns3bazENS_5PointE"] pub fn baz(point: root::ns::Point) -> ::std::os::raw::c_int; } } #[allow(unused_imports)] use self::super::root; unsafe extern "C" { - #[link_name = "\u{1}_Z3foov"] + #[link_name = "_Z3foov"] pub fn foo() -> ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}_Z3bari"] + #[link_name = "_Z3bari"] pub fn bar(x: root::number) -> ::std::os::raw::c_int; } unsafe extern "C" { - #[link_name = "\u{1}_Z3baz5Point"] + #[link_name = "_Z3baz5Point"] pub fn baz(point: root::Point) -> ::std::os::raw::c_int; } } diff --git a/bindgen-tests/tests/expectations/tests/special-members.rs b/bindgen-tests/tests/expectations/tests/special-members.rs index 4f54670c86..6ae1c37a18 100644 --- a/bindgen-tests/tests/expectations/tests/special-members.rs +++ b/bindgen-tests/tests/expectations/tests/special-members.rs @@ -10,19 +10,19 @@ const _: () = { ["Alignment of A"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN1AC1Ev"] + #[link_name = "_ZN1AC1Ev"] pub fn A_A(this: *mut A); } unsafe extern "C" { - #[link_name = "\u{1}_ZN1AC1ERS_"] + #[link_name = "_ZN1AC1ERS_"] pub fn A_A1(this: *mut A, arg1: *mut A); } unsafe extern "C" { - #[link_name = "\u{1}_ZN1AC1EOS_"] + #[link_name = "_ZN1AC1EOS_"] pub fn A_A2(this: *mut A, arg1: *mut A); } unsafe extern "C" { - #[link_name = "\u{1}_ZN1AD1Ev"] + #[link_name = "_ZN1AD1Ev"] pub fn A_A_destructor(this: *mut A); } impl A { diff --git a/bindgen-tests/tests/expectations/tests/specific_receiver.rs b/bindgen-tests/tests/expectations/tests/specific_receiver.rs index ec001b12ad..d2f6ce097b 100644 --- a/bindgen-tests/tests/expectations/tests/specific_receiver.rs +++ b/bindgen-tests/tests/expectations/tests/specific_receiver.rs @@ -23,6 +23,6 @@ impl Default for Fish { } } unsafe extern "C" { - #[link_name = "\u{1}_ZN4Fish4swimEv"] + #[link_name = "_ZN4Fish4swimEv"] pub fn Fish_swim(this: *mut Fish); } diff --git a/bindgen-tests/tests/expectations/tests/template.rs b/bindgen-tests/tests/expectations/tests/template.rs index 94678cb49e..ff7349e664 100644 --- a/bindgen-tests/tests/expectations/tests/template.rs +++ b/bindgen-tests/tests/expectations/tests/template.rs @@ -32,7 +32,7 @@ impl Default for B { } } unsafe extern "C" { - #[link_name = "\u{1}_Z3bar3FooIiiE"] + #[link_name = "_Z3bar3FooIiiE"] pub fn bar(foo: Foo<::std::os::raw::c_int>); } #[repr(C)] diff --git a/bindgen-tests/tests/expectations/tests/template_instantiation_with_fn_local_type.rs b/bindgen-tests/tests/expectations/tests/template_instantiation_with_fn_local_type.rs index 085278e603..b53902a72a 100644 --- a/bindgen-tests/tests/expectations/tests/template_instantiation_with_fn_local_type.rs +++ b/bindgen-tests/tests/expectations/tests/template_instantiation_with_fn_local_type.rs @@ -5,7 +5,7 @@ pub struct Foo { pub _address: u8, } unsafe extern "C" { - #[link_name = "\u{1}_Z1fv"] + #[link_name = "_Z1fv"] pub fn f(); } #[allow(clippy::unnecessary_operation, clippy::identity_op)] diff --git a/bindgen-tests/tests/expectations/tests/union_dtor.rs b/bindgen-tests/tests/expectations/tests/union_dtor.rs index 3b89587098..0e787a16bf 100644 --- a/bindgen-tests/tests/expectations/tests/union_dtor.rs +++ b/bindgen-tests/tests/expectations/tests/union_dtor.rs @@ -16,7 +16,7 @@ const _: () = { ][::std::mem::offset_of!(UnionWithDtor, mBar) - 0usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN13UnionWithDtorD1Ev"] + #[link_name = "_ZN13UnionWithDtorD1Ev"] pub fn UnionWithDtor_UnionWithDtor_destructor(this: *mut UnionWithDtor); } impl Default for UnionWithDtor { diff --git a/bindgen-tests/tests/expectations/tests/var-tracing.rs b/bindgen-tests/tests/expectations/tests/var-tracing.rs index 76ce0c50d6..47cb315477 100644 --- a/bindgen-tests/tests/expectations/tests/var-tracing.rs +++ b/bindgen-tests/tests/expectations/tests/var-tracing.rs @@ -11,7 +11,7 @@ const _: () = { ["Offset of field: Bar::m_baz"][::std::mem::offset_of!(Bar, m_baz) - 0usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN3BarC1Ei"] + #[link_name = "_ZN3BarC1Ei"] pub fn Bar_Bar(this: *mut Bar, baz: ::std::os::raw::c_int); } impl Bar { @@ -28,7 +28,7 @@ pub struct Baz { pub _address: u8, } unsafe extern "C" { - #[link_name = "\u{1}_ZN3Baz3FOOE"] + #[link_name = "_ZN3Baz3FOOE"] pub static Baz_FOO: [Bar; 0usize]; } #[allow(clippy::unnecessary_operation, clippy::identity_op)] diff --git a/bindgen-tests/tests/expectations/tests/variadic-method.rs b/bindgen-tests/tests/expectations/tests/variadic-method.rs index deac5f719e..aaa38d975a 100644 --- a/bindgen-tests/tests/expectations/tests/variadic-method.rs +++ b/bindgen-tests/tests/expectations/tests/variadic-method.rs @@ -1,6 +1,6 @@ #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] unsafe extern "C" { - #[link_name = "\u{1}_Z3fooPKcz"] + #[link_name = "_Z3fooPKcz"] pub fn foo(fmt: *const ::std::os::raw::c_char, ...); } #[repr(C)] @@ -14,6 +14,6 @@ const _: () = { ["Alignment of Bar"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN3Bar3fooEPKcz"] + #[link_name = "_ZN3Bar3fooEPKcz"] pub fn Bar_foo(this: *mut Bar, fmt: *const ::std::os::raw::c_char, ...); } diff --git a/bindgen-tests/tests/expectations/tests/vector.rs b/bindgen-tests/tests/expectations/tests/vector.rs index da53b4a8eb..5d3b99d944 100644 --- a/bindgen-tests/tests/expectations/tests/vector.rs +++ b/bindgen-tests/tests/expectations/tests/vector.rs @@ -14,6 +14,6 @@ pub type __m128 = [f32; 4usize]; pub type __m128d = [f64; 2usize]; pub type __m128i = [::std::os::raw::c_longlong; 2usize]; unsafe extern "C" { - #[link_name = "\u{1}_Z3fooDv2_xDv2_d"] + #[link_name = "_Z3fooDv2_xDv2_d"] pub fn foo(arg1: __m128i, arg2: __m128d) -> __m128; } diff --git a/bindgen-tests/tests/expectations/tests/virtual_dtor.rs b/bindgen-tests/tests/expectations/tests/virtual_dtor.rs index d42be25202..142a77cbd2 100644 --- a/bindgen-tests/tests/expectations/tests/virtual_dtor.rs +++ b/bindgen-tests/tests/expectations/tests/virtual_dtor.rs @@ -21,6 +21,6 @@ impl Default for nsSlots { } } unsafe extern "C" { - #[link_name = "\u{1}_ZN7nsSlotsD1Ev"] + #[link_name = "_ZN7nsSlotsD1Ev"] pub fn nsSlots_nsSlots_destructor(this: *mut nsSlots); } diff --git a/bindgen-tests/tests/expectations/tests/virtual_overloaded.rs b/bindgen-tests/tests/expectations/tests/virtual_overloaded.rs index 4c3702faeb..b0c1c13045 100644 --- a/bindgen-tests/tests/expectations/tests/virtual_overloaded.rs +++ b/bindgen-tests/tests/expectations/tests/virtual_overloaded.rs @@ -24,10 +24,10 @@ impl Default for C { } } unsafe extern "C" { - #[link_name = "\u{1}_ZN1C8do_thingEc"] + #[link_name = "_ZN1C8do_thingEc"] pub fn C_do_thing(this: *mut ::std::os::raw::c_void, arg1: ::std::os::raw::c_char); } unsafe extern "C" { - #[link_name = "\u{1}_ZN1C8do_thingEi"] + #[link_name = "_ZN1C8do_thingEi"] pub fn C_do_thing1(this: *mut ::std::os::raw::c_void, arg1: ::std::os::raw::c_int); } diff --git a/bindgen-tests/tests/expectations/tests/vtable_recursive_sig.rs b/bindgen-tests/tests/expectations/tests/vtable_recursive_sig.rs index 9b9c2467aa..8f1dffd692 100644 --- a/bindgen-tests/tests/expectations/tests/vtable_recursive_sig.rs +++ b/bindgen-tests/tests/expectations/tests/vtable_recursive_sig.rs @@ -23,7 +23,7 @@ impl Default for Base { } } unsafe extern "C" { - #[link_name = "\u{1}_ZN4Base9AsDerivedEv"] + #[link_name = "_ZN4Base9AsDerivedEv"] pub fn Base_AsDerived(this: *mut ::std::os::raw::c_void) -> *mut Derived; } #[repr(C)] diff --git a/bindgen-tests/tests/expectations/tests/wasm-constructor-returns.rs b/bindgen-tests/tests/expectations/tests/wasm-constructor-returns.rs index ee26600a6b..5750f73c65 100644 --- a/bindgen-tests/tests/expectations/tests/wasm-constructor-returns.rs +++ b/bindgen-tests/tests/expectations/tests/wasm-constructor-returns.rs @@ -10,7 +10,7 @@ const _: () = { ["Alignment of Foo"][::std::mem::align_of::() - 1usize]; }; unsafe extern "C" { - #[link_name = "\u{1}_ZN3FooC1Ei"] + #[link_name = "_ZN3FooC1Ei"] pub fn Foo_Foo( this: *mut Foo, var: ::std::os::raw::c_int, diff --git a/bindgen-tests/tests/expectations/tests/wrap_unsafe_ops_class.rs b/bindgen-tests/tests/expectations/tests/wrap_unsafe_ops_class.rs index 617a037631..ef68dd6c0b 100644 --- a/bindgen-tests/tests/expectations/tests/wrap_unsafe_ops_class.rs +++ b/bindgen-tests/tests/expectations/tests/wrap_unsafe_ops_class.rs @@ -167,26 +167,26 @@ pub struct RealAbstractionWithTonsOfMethods { pub _address: u8, } unsafe extern "C" { - #[link_name = "\u{1}_ZNK32RealAbstractionWithTonsOfMethods3barEv"] + #[link_name = "_ZNK32RealAbstractionWithTonsOfMethods3barEv"] pub fn RealAbstractionWithTonsOfMethods_bar( this: *const RealAbstractionWithTonsOfMethods, ); } unsafe extern "C" { - #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEv"] + #[link_name = "_ZN32RealAbstractionWithTonsOfMethods3barEv"] pub fn RealAbstractionWithTonsOfMethods_bar1( this: *mut RealAbstractionWithTonsOfMethods, ); } unsafe extern "C" { - #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3barEi"] + #[link_name = "_ZN32RealAbstractionWithTonsOfMethods3barEi"] pub fn RealAbstractionWithTonsOfMethods_bar2( this: *mut RealAbstractionWithTonsOfMethods, foo: ::std::os::raw::c_int, ); } unsafe extern "C" { - #[link_name = "\u{1}_ZN32RealAbstractionWithTonsOfMethods3staEv"] + #[link_name = "_ZN32RealAbstractionWithTonsOfMethods3staEv"] pub fn RealAbstractionWithTonsOfMethods_sta(); } impl RealAbstractionWithTonsOfMethods { diff --git a/bindgen/codegen/mod.rs b/bindgen/codegen/mod.rs index f5518e432d..4578d6f304 100644 --- a/bindgen/codegen/mod.rs +++ b/bindgen/codegen/mod.rs @@ -789,7 +789,16 @@ impl CodeGenerator for Var { ) { canonical_name.as_str() } else { - attrs.push(attributes::link_name::(link_name)); + if utils::names_will_be_identical_after_mangling( + self.mangled_name().unwrap(), + link_name, + None, + ) { + // If the symbol name doesn't need mangling, don't tell LLVM to not mangle it. + attrs.push(attributes::link_name::(link_name)); + } else { + attrs.push(attributes::link_name::(link_name)); + } link_name } }); @@ -4663,7 +4672,16 @@ impl CodeGenerator for Function { if let Some(link_name) = link_name_attr { if !is_dynamic_function { - attributes.push(attributes::link_name::(link_name)); + if utils::names_will_be_identical_after_mangling( + self.mangled_name().unwrap(), + link_name, + Some(abi), + ) { + // If the symbol name doesn't need mangling, don't tell LLVM to not mangle it. + attributes.push(attributes::link_name::(link_name)); + } else { + attributes.push(attributes::link_name::(link_name)); + } } } @@ -5852,6 +5870,10 @@ pub(crate) mod utils { mangled_name: &str, call_conv: Option, ) -> bool { + if mangled_name.contains('@') || mangled_name.contains('?') { + return false; + } + // If the mangled name and the canonical name are the same then no // mangling can have happened between the two versions. if canonical_name == mangled_name {