summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-02-03 09:59:22 -0800
committerGitHub <noreply@github.com>2017-02-03 09:59:22 -0800
commiteede09e5b3d77adde2c25721e376eb387c43592e (patch)
tree6f7c201675ea3dd851e92f209788b0dd3e406d16
parent4c45407aba15f81bc5fb19650bb8c14e51548519 (diff)
parent439d89dd62b8f2c6f5f124c4d4feb4cabce53339 (diff)
Auto merge of #470 - emilio:template-fun-ty, r=fitzgen
Fix a recent template-specialization-related regression. r? @upsuper
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--src/clang.rs14
-rw-r--r--src/ir/ty.rs3
4 files changed, 12 insertions, 9 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 47601996..30584cd7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,6 +1,6 @@
[root]
name = "bindgen"
-version = "0.20.5"
+version = "0.21.0"
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 8ee91b04..7d90a96c 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.20.5"
+version = "0.21.0"
build = "build.rs"
[badges]
diff --git a/src/clang.rs b/src/clang.rs
index 63f9123e..85e1ba1f 100644
--- a/src/clang.rs
+++ b/src/clang.rs
@@ -787,12 +787,14 @@ impl Type {
// Yep, the spelling of this containing type-parameter is extremely
// nasty... But can happen in <type_traits>. Unfortunately I couldn't
// reduce it enough :(
- !self.spelling().contains("type-parameter") &&
- self.template_args()
- .map_or(false, |mut args| {
- args.len() > 0 &&
- !args.any(|t| t.spelling().contains("type-parameter"))
- })
+ self.template_args().map_or(false, |args| {
+ args.len() > 0
+ }) && match self.declaration().kind() {
+ CXCursor_ClassTemplatePartialSpecialization |
+ CXCursor_TypeAliasTemplateDecl |
+ CXCursor_TemplateTemplateParameter => false,
+ _ => true,
+ }
}
}
diff --git a/src/ir/ty.rs b/src/ir/ty.rs
index 1246057b..e3f7c8ef 100644
--- a/src/ir/ty.rs
+++ b/src/ir/ty.rs
@@ -622,7 +622,8 @@ impl Type {
// Same here, with template specialisations we can safely
// assume this is a Comp(..)
} else if ty.is_fully_specialized_template() {
- debug!("Template specialization: {:?}", ty);
+ debug!("Template specialization: {:?}, {:?} {:?}",
+ ty, location, canonical_ty);
let complex =
CompInfo::from_ty(potential_id, ty, location, ctx)
.expect("C'mon");