File tree Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -1235,10 +1235,14 @@ impl ItemCanonicalPath for Item {
1235
1235
fn namespace_aware_canonical_path ( & self ,
1236
1236
ctx : & BindgenContext )
1237
1237
-> Vec < String > {
1238
+ let path = self . canonical_path ( ctx) ;
1238
1239
if ctx. options ( ) . enable_cxx_namespaces {
1239
- return self . canonical_path ( ctx ) ;
1240
+ return path ;
1240
1241
}
1241
- return vec ! [ self . canonical_path( ctx) [ 1 ..] . join( "_" ) ] ;
1242
+ if ctx. options ( ) . disable_name_namespacing {
1243
+ return vec ! [ path. last( ) . unwrap( ) . clone( ) ] ;
1244
+ }
1245
+ return vec ! [ path[ 1 ..] . join( "_" ) ] ;
1242
1246
}
1243
1247
1244
1248
fn canonical_path ( & self , ctx : & BindgenContext ) -> Vec < String > {
Original file line number Diff line number Diff line change
1
+ /* automatically generated by rust-bindgen */
2
+
3
+
4
+ #![ allow( non_snake_case) ]
5
+
6
+
7
+ #[ repr( C ) ]
8
+ #[ derive( Debug , Copy ) ]
9
+ pub struct Bar {
10
+ pub _address : u8 ,
11
+ }
12
+ #[ test]
13
+ fn bindgen_test_layout_Bar ( ) {
14
+ assert_eq ! ( :: std:: mem:: size_of:: <Bar >( ) , 1usize ) ;
15
+ assert_eq ! ( :: std:: mem:: align_of:: <Bar >( ) , 1usize ) ;
16
+ }
17
+ impl Clone for Bar {
18
+ fn clone ( & self ) -> Self { * self }
19
+ }
20
+ extern "C" {
21
+ #[ link_name = "_Z3bazPN3foo3BarE" ]
22
+ pub fn baz ( arg1 : * mut Bar ) ;
23
+ }
Original file line number Diff line number Diff line change
1
+ // bindgen-flags: --disable-name-namespacing
2
+
3
+ namespace foo {
4
+ struct Bar {};
5
+ }
6
+
7
+ void baz (foo::Bar*);
You can’t perform that action at this time.
0 commit comments