diff options
author | Nick Fitzgerald <fitzgen@gmail.com> | 2017-09-29 17:08:59 -0700 |
---|---|---|
committer | Nick Fitzgerald <fitzgen@gmail.com> | 2017-10-02 11:33:26 -0700 |
commit | d83e732f20296aed45968606bc6cd020f25cb450 (patch) | |
tree | d8184194e9381f1be3c7f76367cce3632c0b5a05 | |
parent | c2e94bea0a8c569fe3f41c654f3ab4ecfb6ff62e (diff) |
`instantiate_template` should take a `TypeId` for the template definition
-rw-r--r-- | src/ir/context.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ir/context.rs b/src/ir/context.rs index 5c3530a6..2f2a6346 100644 --- a/src/ir/context.rs +++ b/src/ir/context.rs @@ -1425,13 +1425,13 @@ impl BindgenContext { fn instantiate_template( &mut self, with_id: ItemId, - template: ItemId, + template: TypeId, ty: &clang::Type, location: clang::Cursor, ) -> Option<ItemId> { use clang_sys; - let num_expected_args = match self.resolve_type(template.as_type_id_unchecked()) + let num_expected_args = match self.resolve_type(template) .num_self_template_params(self) { Some(n) => n, None => { @@ -1485,7 +1485,7 @@ impl BindgenContext { let ty = Item::from_ty_or_ref( child.cur_type(), *child, - Some(template), + Some(template.into()), self, ); args.push(ty); @@ -1507,7 +1507,7 @@ impl BindgenContext { let ty = Item::from_ty_or_ref( child.cur_type(), *child, - Some(template), + Some(template.into()), self, ); args.push(ty); @@ -1601,7 +1601,7 @@ impl BindgenContext { args.reverse(); let type_kind = TypeKind::TemplateInstantiation( - TemplateInstantiation::new(template.as_type_id_unchecked(), args), + TemplateInstantiation::new(template, args), ); let name = ty.spelling(); let name = if name.is_empty() { None } else { Some(name) }; @@ -1699,7 +1699,7 @@ impl BindgenContext { return None; } - return self.instantiate_template(with_id, id, ty, location) + return self.instantiate_template(with_id, id.as_type_id_unchecked(), ty, location) .or_else(|| Some(id)); } |