summaryrefslogtreecommitdiff
path: root/src/codegen/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r--src/codegen/mod.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index d3e204ce..7469abb9 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -521,7 +521,7 @@ impl CodeGenerator for Type {
TypeKind::Pointer(..) |
TypeKind::BlockPointer |
TypeKind::Reference(..) |
- TypeKind::TemplateRef(..) |
+ TypeKind::TemplateInstantiation(..) |
TypeKind::Function(..) |
TypeKind::ResolvedTypeRef(..) |
TypeKind::Named => {
@@ -1377,9 +1377,10 @@ impl CodeGenerator for CompInfo {
// FIXME when [issue #465](https://github.com/servo/rust-bindgen/issues/465) ready
let too_many_base_vtables = self.base_members()
.iter()
- .filter(|base| ctx.resolve_type(base.ty).has_vtable(ctx))
- .count() >
- 1;
+ .filter(|base| {
+ ctx.resolve_type(base.ty).has_vtable(ctx)
+ })
+ .count() > 1;
let should_skip_field_offset_checks = item.is_opaque(ctx) ||
too_many_base_vtables;
@@ -2180,7 +2181,7 @@ impl ToRustTy for Type {
let path = item.namespace_aware_canonical_path(ctx);
aster::AstBuilder::new().ty().path().ids(path).build()
}
- TypeKind::TemplateRef(inner, ref template_args) => {
+ TypeKind::TemplateInstantiation(inner, ref template_args) => {
// PS: Sorry for the duplication here.
let mut inner_ty = inner.to_rust_ty(ctx).unwrap();
@@ -2189,7 +2190,7 @@ impl ToRustTy for Type {
.map(|arg| arg.to_rust_ty(ctx))
.collect::<Vec<_>>();
- path.segments.last_mut().unwrap().parameters = if
+ path.segments.last_mut().unwrap().parameters = if
template_args.is_empty() {
None
} else {
@@ -2509,8 +2510,8 @@ mod utils {
use super::ItemToRustTy;
use aster;
use ir::context::{BindgenContext, ItemId};
- use ir::item::{Item, ItemCanonicalPath};
use ir::function::FunctionSig;
+ use ir::item::{Item, ItemCanonicalPath};
use ir::ty::TypeKind;
use std::mem;
use syntax::ast;