File tree 4 files changed +12
-3
lines changed 4 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ license = "BSD-3-Clause"
12
12
name = " libbindgen"
13
13
readme = " README.md"
14
14
repository = " https://github.com/servo/rust-bindgen"
15
- version = " 0.1.1 "
15
+ version = " 0.1.2 "
16
16
workspace = " .."
17
17
18
18
[dev-dependencies ]
Original file line number Diff line number Diff line change @@ -510,7 +510,7 @@ impl<'ctx> Bindings<'ctx> {
510
510
let span = span. unwrap_or ( DUMMY_SP ) ;
511
511
512
512
let mut context = BindgenContext :: new ( options) ;
513
- parse ( & mut context) ;
513
+ try! ( parse ( & mut context) ) ;
514
514
515
515
let module = ast:: Mod {
516
516
inner : span,
@@ -624,14 +624,20 @@ pub fn parse_one(ctx: &mut BindgenContext,
624
624
}
625
625
626
626
/// Parse the Clang AST into our `Item` internal representation.
627
- fn parse ( context : & mut BindgenContext ) {
627
+ fn parse ( context : & mut BindgenContext ) -> Result < ( ) , ( ) > {
628
628
use clang:: Diagnostic ;
629
629
use clangll:: * ;
630
630
631
+ let mut any_error = false ;
631
632
for d in context. translation_unit ( ) . diags ( ) . iter ( ) {
632
633
let msg = d. format ( Diagnostic :: default_opts ( ) ) ;
633
634
let is_err = d. severity ( ) >= CXDiagnostic_Error ;
634
635
println ! ( "{}, err: {}" , msg, is_err) ;
636
+ any_error |= is_err;
637
+ }
638
+
639
+ if any_error {
640
+ return Err ( ( ) ) ;
635
641
}
636
642
637
643
let cursor = context. translation_unit ( ) . cursor ( ) ;
@@ -646,6 +652,7 @@ fn parse(context: &mut BindgenContext) {
646
652
647
653
assert ! ( context. current_module( ) == context. root_module( ) ,
648
654
"How did this happen?" ) ;
655
+ Ok ( ( ) )
649
656
}
650
657
651
658
/// Extracted Clang version data
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ // bindgen-flags: -- -std=c++11
2
+
1
3
template <typename ...> using __void_t = void ;
2
4
3
5
template <typename _Iterator, typename = __void_t <>>
You can’t perform that action at this time.
0 commit comments