@@ -249,7 +249,6 @@ fn println_trait<'a, W: std::io::Write>(w: &mut W, t: &'a syn::ItemTrait, module
249
249
match export_status ( & t. attrs ) {
250
250
ExportStatus :: Export => { } ,
251
251
ExportStatus :: NoExport |ExportStatus :: TestOnly => return ,
252
- ExportStatus :: Rename ( _) => unimplemented ! ( ) ,
253
252
}
254
253
println_docs ( w, & t. attrs , "" ) ;
255
254
@@ -300,7 +299,6 @@ fn println_trait<'a, W: std::io::Write>(w: &mut W, t: &'a syn::ItemTrait, module
300
299
} ,
301
300
ExportStatus :: Export => { } ,
302
301
ExportStatus :: TestOnly => continue ,
303
- ExportStatus :: Rename ( _) => unimplemented ! ( ) ,
304
302
}
305
303
if m. default . is_some ( ) { unimplemented ! ( ) ; }
306
304
println_docs ( w, & m. attrs , "\t " ) ;
@@ -461,12 +459,11 @@ fn println_opaque<W: std::io::Write>(w: &mut W, ident: &syn::Ident, struct_name:
461
459
}
462
460
463
461
fn println_struct < W : std:: io:: Write > ( w : & mut W , s : & syn:: ItemStruct , module_path : & str , types : & mut TypeResolver , extra_headers : & mut File ) {
464
- let mut struct_name = & format ! ( "{}" , s. ident) ;
462
+ let struct_name = & format ! ( "{}" , s. ident) ;
465
463
let export = export_status ( & s. attrs ) ;
466
464
match export {
467
465
ExportStatus :: Export => { } ,
468
466
ExportStatus :: NoExport |ExportStatus :: TestOnly => return ,
469
- ExportStatus :: Rename ( ref name) => { struct_name = & name; } ,
470
467
}
471
468
472
469
//XXX: Stupid hack:
@@ -492,7 +489,6 @@ fn println_struct<W: std::io::Write>(w: &mut W, s: &syn::ItemStruct, module_path
492
489
all_fields_settable = false ;
493
490
continue
494
491
} ,
495
- ExportStatus :: Rename ( _) => { unimplemented ! ( ) ; } ,
496
492
}
497
493
498
494
if let Some ( ident) = & field. ident {
@@ -553,7 +549,6 @@ fn println_struct<W: std::io::Write>(w: &mut W, s: &syn::ItemStruct, module_path
553
549
}
554
550
}
555
551
556
-
557
552
types. struct_imported ( & s. ident , struct_name. clone ( ) ) ;
558
553
}
559
554
@@ -583,7 +578,6 @@ eprintln!("WIP: IMPL {:?} FOR {}", trait_path.1, ident);
583
578
match export_status ( & m. attrs ) {
584
579
ExportStatus :: Export => { } ,
585
580
ExportStatus :: NoExport |ExportStatus :: TestOnly => continue ,
586
- ExportStatus :: Rename ( _) => unimplemented ! ( ) ,
587
581
}
588
582
if m. defaultness . is_some ( ) { unimplemented ! ( ) ; }
589
583
println_docs ( w, & m. attrs , "" ) ;
@@ -626,7 +620,6 @@ fn println_enum<W: std::io::Write>(w: &mut W, e: &syn::ItemEnum, module_path: &s
626
620
match export_status ( & e. attrs ) {
627
621
ExportStatus :: Export => { } ,
628
622
ExportStatus :: NoExport |ExportStatus :: TestOnly => return ,
629
- ExportStatus :: Rename ( _) => { unimplemented ! ( ) ; } ,
630
623
}
631
624
632
625
for var in e. variants . iter ( ) {
@@ -743,14 +736,12 @@ fn convert_file(path: &str, out_path: &str, orig_crate: &str, module: &str, head
743
736
match export_status ( & m. attrs ) {
744
737
ExportStatus :: Export => { } ,
745
738
ExportStatus :: NoExport |ExportStatus :: TestOnly => continue ,
746
- ExportStatus :: Rename ( _) => unimplemented ! ( ) ,
747
739
}
748
740
749
741
if m. content . is_some ( ) { unimplemented ! ( ) ; } // Probably mod tests {}
750
742
let f_path = format ! ( "{}/{}.rs" , ( path. as_ref( ) as & Path ) . parent( ) . unwrap( ) . display( ) , m. ident) ;
751
743
let new_mod = if module. is_empty ( ) { format ! ( "{}" , m. ident) } else { format ! ( "{}::{}" , module, m. ident) } ;
752
744
if let Ok ( _) = File :: open ( & f_path) {
753
-
754
745
if should_export ( & f_path) {
755
746
println_docs ( & mut out, & m. attrs , "" ) ;
756
747
write ! ( out, "pub mod {};\n " , m. ident) . unwrap ( ) ;
@@ -776,7 +767,6 @@ fn convert_file(path: &str, out_path: &str, orig_crate: &str, module: &str, head
776
767
match export_status ( & t. attrs ) {
777
768
ExportStatus :: Export => { } ,
778
769
ExportStatus :: NoExport |ExportStatus :: TestOnly => continue ,
779
- ExportStatus :: Rename ( _) => unimplemented ! ( ) ,
780
770
}
781
771
if t. generics . lt_token . is_none ( ) {
782
772
println_opaque ( & mut out, & t. ident , & format ! ( "{}" , t. ident) , & t. generics , & t. attrs , & orig_module, & type_resolver, header_file) ;
@@ -797,15 +787,15 @@ fn convert_file(path: &str, out_path: &str, orig_crate: &str, module: &str, head
797
787
798
788
fn main ( ) {
799
789
let args: Vec < String > = env:: args ( ) . collect ( ) ;
800
- if args. len ( ) != 6 {
801
- eprintln ! ( "Usage: source/dir our/dir orig_crate module::path extra/includes.h" ) ;
790
+ if args. len ( ) != 5 {
791
+ eprintln ! ( "Usage: source/dir our/dir orig_crate extra/includes.h" ) ;
802
792
process:: exit ( 1 ) ;
803
793
}
804
794
805
795
let mut header_file = std:: fs:: OpenOptions :: new ( ) . write ( true ) . append ( true )
806
- . open ( & args[ 5 ] ) . expect ( "Unable to open new header file" ) ;
796
+ . open ( & args[ 4 ] ) . expect ( "Unable to open new header file" ) ;
807
797
808
- convert_file ( & ( args[ 1 ] . clone ( ) + "/lib.rs" ) , & ( args[ 2 ] . clone ( ) + "lib.rs" ) , & args[ 3 ] , & args [ 4 ] , & mut header_file) ;
798
+ convert_file ( & ( args[ 1 ] . clone ( ) + "/lib.rs" ) , & ( args[ 2 ] . clone ( ) + "lib.rs" ) , & args[ 3 ] , "" , & mut header_file) ;
809
799
810
800
header_file. flush ( ) . unwrap ( ) ;
811
801
}
0 commit comments