summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-11-13 18:07:23 -0500
committerGitHub <noreply@github.com>2018-11-13 18:07:23 -0500
commitaf44a14cc6da0953604a37439b2a8daa70d14d57 (patch)
tree6513f1da8e980ec24b1086957a880694bb9d7a8a
parentd6ca28d7f4d5e72f06e2bf62336f0913fcd0a760 (diff)
parentc4a006dbdf1c7d0ee331a87affff14c4b5dd83f1 (diff)
Auto merge of #1444 - scoopr:fix_noisy, r=emilio
Fix noisy errors This silences errors from template functions and dependant types.
-rw-r--r--src/ir/item.rs3
-rw-r--r--src/ir/ty.rs3
-rw-r--r--tests/expectations/tests/enum_in_template.rs17
-rw-r--r--tests/expectations/tests/template_fun.rs8
-rw-r--r--tests/headers/enum_in_template.hpp10
-rw-r--r--tests/headers/template_fun.hpp3
6 files changed, 43 insertions, 1 deletions
diff --git a/src/ir/item.rs b/src/ir/item.rs
index a6ee4ff3..380313e7 100644
--- a/src/ir/item.rs
+++ b/src/ir/item.rs
@@ -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(),
diff --git a/src/ir/ty.rs b/src/ir/ty.rs
index 75d5960d..922146ea 100644
--- a/src/ir/ty.rs
+++ b/src/ir/ty.rs
@@ -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 {:?}",
diff --git a/tests/expectations/tests/enum_in_template.rs b/tests/expectations/tests/enum_in_template.rs
new file mode 100644
index 00000000..24be7a71
--- /dev/null
+++ b/tests/expectations/tests/enum_in_template.rs
@@ -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;
diff --git a/tests/expectations/tests/template_fun.rs b/tests/expectations/tests/template_fun.rs
new file mode 100644
index 00000000..d6776794
--- /dev/null
+++ b/tests/expectations/tests/template_fun.rs
@@ -0,0 +1,8 @@
+/* automatically generated by rust-bindgen */
+
+#![allow(
+ dead_code,
+ non_snake_case,
+ non_camel_case_types,
+ non_upper_case_globals
+)]
diff --git a/tests/headers/enum_in_template.hpp b/tests/headers/enum_in_template.hpp
new file mode 100644
index 00000000..41c017c4
--- /dev/null
+++ b/tests/headers/enum_in_template.hpp
@@ -0,0 +1,10 @@
+
+template <class T>
+class Foo
+{
+ enum Bar
+ {
+ A,
+ B
+ };
+};
diff --git a/tests/headers/template_fun.hpp b/tests/headers/template_fun.hpp
new file mode 100644
index 00000000..17b1383b
--- /dev/null
+++ b/tests/headers/template_fun.hpp
@@ -0,0 +1,3 @@
+// this will be ignored
+template <class T>
+void foo() {}