diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-02-03 09:59:22 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-03 09:59:22 -0800 |
commit | eede09e5b3d77adde2c25721e376eb387c43592e (patch) | |
tree | 6f7c201675ea3dd851e92f209788b0dd3e406d16 | |
parent | 4c45407aba15f81bc5fb19650bb8c14e51548519 (diff) | |
parent | 439d89dd62b8f2c6f5f124c4d4feb4cabce53339 (diff) |
Auto merge of #470 - emilio:template-fun-ty, r=fitzgen
Fix a recent template-specialization-related regression.
r? @upsuper
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/clang.rs | 14 | ||||
-rw-r--r-- | src/ir/ty.rs | 3 |
4 files changed, 12 insertions, 9 deletions
@@ -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)", @@ -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"); |