diff --git a/Cargo.lock b/Cargo.lock index 0acb10e823..0958343507 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ [root] name = "bindgen" -version = "0.21.2" +version = "0.21.3" dependencies = [ "aster 0.38.0 (registry+https://github.com/rust-lang/crates.io-index)", "cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index d108c2c9ad..c88f949ac1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ name = "bindgen" readme = "README.md" repository = "https://github.com/servo/rust-bindgen" documentation = "https://docs.rs/bindgen" -version = "0.21.2" +version = "0.21.3" build = "build.rs" exclude = ["tests/headers", "tests/expectations", "bindgen-integration", "ci"] diff --git a/src/clang.rs b/src/clang.rs index bcb22e06ad..84609ca696 100644 --- a/src/clang.rs +++ b/src/clang.rs @@ -225,6 +225,7 @@ impl Cursor { /// remaining free template arguments? pub fn is_fully_specialized_template(&self) -> bool { self.is_template_specialization() && + self.kind() != CXCursor_ClassTemplatePartialSpecialization && self.num_template_args().unwrap_or(0) > 0 } diff --git a/tests/expectations/tests/template_partial_specification.rs b/tests/expectations/tests/template_partial_specification.rs new file mode 100644 index 0000000000..b4b7b2bcee --- /dev/null +++ b/tests/expectations/tests/template_partial_specification.rs @@ -0,0 +1,7 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(non_snake_case)] + + + diff --git a/tests/headers/template_partial_specification.hpp b/tests/headers/template_partial_specification.hpp new file mode 100644 index 0000000000..fe1be65868 --- /dev/null +++ b/tests/headers/template_partial_specification.hpp @@ -0,0 +1,10 @@ +// bindgen-flags: -- --target=x86_64-pc-win32 + +template +struct nsRunnableMethodTraits; + +template +struct nsRunnableMethodTraits +{ + static const bool can_cancel = Cancelable; +};