-
Notifications
You must be signed in to change notification settings - Fork 707
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
seemyvest
committed
Oct 27, 2017
1 parent
208b98a
commit 5d27156
Showing
10 changed files
with
176 additions
and
0 deletions.
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
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
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
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
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,24 @@ | ||
/* automatically generated by rust-bindgen */ | ||
|
||
|
||
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] | ||
|
||
|
||
#[repr(C)] | ||
#[derive(Debug, Default, Copy, Clone)] | ||
pub struct NoHash { | ||
pub _bindgen_opaque_blob: u32, | ||
} | ||
#[test] | ||
fn bindgen_test_layout_NoHash() { | ||
assert_eq!( | ||
::std::mem::size_of::<NoHash>(), | ||
4usize, | ||
concat!("Size of: ", stringify!(NoHash)) | ||
); | ||
assert_eq!( | ||
::std::mem::align_of::<NoHash>(), | ||
4usize, | ||
concat!("Alignment of ", stringify!(NoHash)) | ||
); | ||
} |
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, Default, Copy, Clone)] | ||
pub struct NoHash { | ||
pub i: ::std::os::raw::c_int, | ||
} | ||
#[test] | ||
fn bindgen_test_layout_NoHash() { | ||
assert_eq!( | ||
::std::mem::size_of::<NoHash>(), | ||
4usize, | ||
concat!("Size of: ", stringify!(NoHash)) | ||
); | ||
assert_eq!( | ||
::std::mem::align_of::<NoHash>(), | ||
4usize, | ||
concat!("Alignment of ", stringify!(NoHash)) | ||
); | ||
assert_eq!( | ||
unsafe { &(*(0 as *const NoHash)).i as *const _ as usize }, | ||
0usize, | ||
concat!( | ||
"Alignment of field: ", | ||
stringify!(NoHash), | ||
"::", | ||
stringify!(i) | ||
) | ||
); | ||
} |
52 changes: 52 additions & 0 deletions
52
tests/expectations/tests/whitelisted-item-references-no-hash.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,52 @@ | ||
/* automatically generated by rust-bindgen */ | ||
|
||
|
||
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] | ||
|
||
|
||
#[repr(C)] | ||
#[derive(Debug, Default, Copy, Clone)] | ||
pub struct NoHash { | ||
pub _address: u8, | ||
} | ||
#[test] | ||
fn bindgen_test_layout_NoHash() { | ||
assert_eq!( | ||
::std::mem::size_of::<NoHash>(), | ||
1usize, | ||
concat!("Size of: ", stringify!(NoHash)) | ||
); | ||
assert_eq!( | ||
::std::mem::align_of::<NoHash>(), | ||
1usize, | ||
concat!("Alignment of ", stringify!(NoHash)) | ||
); | ||
} | ||
#[repr(C)] | ||
#[derive(Debug, Default, Copy, Clone)] | ||
pub struct WhitelistMe { | ||
pub a: NoHash, | ||
} | ||
#[test] | ||
fn bindgen_test_layout_WhitelistMe() { | ||
assert_eq!( | ||
::std::mem::size_of::<WhitelistMe>(), | ||
1usize, | ||
concat!("Size of: ", stringify!(WhitelistMe)) | ||
); | ||
assert_eq!( | ||
::std::mem::align_of::<WhitelistMe>(), | ||
1usize, | ||
concat!("Alignment of ", stringify!(WhitelistMe)) | ||
); | ||
assert_eq!( | ||
unsafe { &(*(0 as *const WhitelistMe)).a as *const _ as usize }, | ||
0usize, | ||
concat!( | ||
"Alignment of field: ", | ||
stringify!(WhitelistMe), | ||
"::", | ||
stringify!(a) | ||
) | ||
); | ||
} |
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,5 @@ | ||
// bindgen-flags: --with-derive-hash --opaque-type "NoHash" --no-hash "NoHash" | ||
|
||
class NoHash { | ||
int i; | ||
}; |
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,5 @@ | ||
// bindgen-flags: --with-derive-hash --whitelist-type "NoHash" --no-hash "NoHash" | ||
|
||
class NoHash { | ||
int i; | ||
}; |
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,7 @@ | ||
// bindgen-flags: --with-derive-hash --whitelist-type "WhitelistMe" --no-hash "NoHash" | ||
|
||
struct NoHash {}; | ||
|
||
class WhitelistMe { | ||
NoHash a; | ||
}; |