-
Notifications
You must be signed in to change notification settings - Fork 717
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test for dupe enums and namespaces.
I feared that this might fail, but it doesn't! :)
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
tests/expectations/tests/dupe-enum-variant-in-namespace.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,30 @@ | ||
/* automatically generated by rust-bindgen */ | ||
|
||
#![allow( | ||
dead_code, | ||
non_snake_case, | ||
non_camel_case_types, | ||
non_upper_case_globals | ||
)] | ||
|
||
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] | ||
pub mod root { | ||
#[allow(unused_imports)] | ||
use self::super::root; | ||
pub mod foo { | ||
#[allow(unused_imports)] | ||
use self::super::super::root; | ||
impl root::foo::Bar { | ||
pub const Foo1: root::foo::Bar = Bar::Foo; | ||
} | ||
impl root::foo::Bar { | ||
pub const Foo3: root::foo::Bar = Bar::Foo2; | ||
} | ||
#[repr(u32)] | ||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] | ||
pub enum Bar { | ||
Foo = 0, | ||
Foo2 = 1, | ||
} | ||
} | ||
} |
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,10 @@ | ||
// bindgen-flags: --rustified-enum ".*" --enable-cxx-namespaces -- -x c++ | ||
|
||
namespace foo { | ||
enum class Bar : unsigned { | ||
Foo = 0, | ||
Foo1 = 0, | ||
Foo2, | ||
Foo3 = Foo2, | ||
}; | ||
} |