forked from rust-lang/rust-bindgen
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ir: Properly skip inline namespaces when building names.
Fixes rust-lang#789
- Loading branch information
Showing
3 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
tests/expectations/tests/inline_namespace_no_ns_enabled.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* automatically generated by rust-bindgen */ | ||
|
||
|
||
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] | ||
|
||
|
||
#[repr(C)] | ||
#[derive(Debug)] | ||
pub struct std_basic_string<CharT> { | ||
pub hider: std_basic_string_Alloc_hider, | ||
pub length: ::std::os::raw::c_ulong, | ||
pub __bindgen_anon_1: std_basic_string__bindgen_ty_1<CharT>, | ||
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<CharT>>, | ||
} | ||
#[repr(C)] | ||
#[derive(Debug, Copy, Clone)] | ||
pub struct std_basic_string_Alloc_hider { | ||
pub storage: *mut ::std::os::raw::c_void, | ||
} | ||
impl Default for std_basic_string_Alloc_hider { | ||
fn default() -> Self { unsafe { ::std::mem::zeroed() } } | ||
} | ||
#[repr(C)] | ||
#[derive(Debug)] | ||
pub struct std_basic_string__bindgen_ty_1<CharT> { | ||
pub inline_storage: [CharT; 4usize], | ||
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<CharT>>, | ||
} | ||
impl <CharT> Default for std_basic_string__bindgen_ty_1<CharT> { | ||
fn default() -> Self { unsafe { ::std::mem::zeroed() } } | ||
} | ||
impl <CharT> Default for std_basic_string<CharT> { | ||
fn default() -> Self { unsafe { ::std::mem::zeroed() } } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// bindgen-flags: -- -std=c++11 | ||
|
||
namespace std { | ||
inline namespace __cxx11 { | ||
|
||
template<typename CharT> | ||
class basic_string { | ||
struct Alloc_hider { | ||
void* storage; | ||
} hider; | ||
unsigned long length; | ||
struct { | ||
CharT inline_storage[4]; | ||
}; | ||
}; | ||
|
||
} | ||
} |