Skip to content

Commit

Permalink
Auto merge of #1444 - scoopr:fix_noisy, r=emilio
Browse files Browse the repository at this point in the history
Fix noisy errors

This silences errors from template functions and dependant types.
  • Loading branch information
bors-servo authored Nov 13, 2018
2 parents d6ca28d + c4a006d commit af44a14
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ir/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,8 @@ impl ClangItemParser for Item {
CXCursor_UsingDeclaration |
CXCursor_UsingDirective |
CXCursor_StaticAssert |
CXCursor_InclusionDirective => {
CXCursor_InclusionDirective |
CXCursor_FunctionTemplate => {
debug!(
"Unhandled cursor kind {:?}: {:?}",
cursor.kind(),
Expand Down
3 changes: 3 additions & 0 deletions src/ir/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,9 @@ impl Type {
name = interface.rust_name();
TypeKind::ObjCInterface(interface)
}
CXType_Dependent => {
return Err(ParseError::Continue);
}
_ => {
error!(
"unsupported type: kind = {:?}; ty = {:?}; at {:?}",
Expand Down
17 changes: 17 additions & 0 deletions tests/expectations/tests/enum_in_template.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* 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 Foo {
pub _address: u8,
}
pub const Foo_Bar_A: Foo_Bar = 0;
pub const Foo_Bar_B: Foo_Bar = 0;
pub type Foo_Bar = i32;
8 changes: 8 additions & 0 deletions tests/expectations/tests/template_fun.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* automatically generated by rust-bindgen */

#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
10 changes: 10 additions & 0 deletions tests/headers/enum_in_template.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

template <class T>
class Foo
{
enum Bar
{
A,
B
};
};
3 changes: 3 additions & 0 deletions tests/headers/template_fun.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// this will be ignored
template <class T>
void foo() {}

0 comments on commit af44a14

Please sign in to comment.