summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xci/deploy-book.sh2
-rwxr-xr-xci/test-book.sh2
-rw-r--r--src/ir/ty.rs19
3 files changed, 4 insertions, 19 deletions
diff --git a/ci/deploy-book.sh b/ci/deploy-book.sh
index 0c2a2b5f..ba38697e 100755
--- a/ci/deploy-book.sh
+++ b/ci/deploy-book.sh
@@ -4,7 +4,7 @@ set -xeu
cd "$(dirname "$0")/../book"
# Ensure mdbook is installed.
-cargo install mdbook || true
+cargo install mdbook --vers "^0.0.22" || true
export PATH="$PATH:~/.cargo/bin"
# Get the git revision we are on.
diff --git a/ci/test-book.sh b/ci/test-book.sh
index 30b23318..b2007e7c 100755
--- a/ci/test-book.sh
+++ b/ci/test-book.sh
@@ -3,7 +3,7 @@
set -xeu
cd "$(dirname "$0")/../book"
-cargo install mdbook || true
+cargo install mdbook --vers "^0.0.22" || true
export PATH="$PATH:~/.cargo/bin"
mdbook build
diff --git a/src/ir/ty.rs b/src/ir/ty.rs
index d19a4889..5ab7cf08 100644
--- a/src/ir/ty.rs
+++ b/src/ir/ty.rs
@@ -14,7 +14,6 @@ use super::template::{AsTemplateParam, TemplateInstantiation, TemplateParameters
use super::traversal::{EdgeKind, Trace, Tracer};
use clang::{self, Cursor};
use parse::{ClangItemParser, ParseError, ParseResult};
-use std::cell::Cell;
use std::io;
use std::mem;
@@ -33,9 +32,6 @@ pub struct Type {
kind: TypeKind,
/// Whether this type is const-qualified.
is_const: bool,
- /// Don't go into an infinite loop when detecting if we have a vtable or
- /// not.
- detect_has_vtable_cycle: Cell<bool>,
}
/// The maximum number of items in an array for which Rust implements common
@@ -75,7 +71,6 @@ impl Type {
layout: layout,
kind: kind,
is_const: is_const,
- detect_has_vtable_cycle: Cell::new(false),
}
}
@@ -244,25 +239,15 @@ impl Type {
/// Whether this type has a vtable.
pub fn has_vtable(&self, ctx: &BindgenContext) -> bool {
- if self.detect_has_vtable_cycle.get() {
- return false;
- }
-
- self.detect_has_vtable_cycle.set(true);
-
// FIXME: Can we do something about template parameters? Huh...
- let result = match self.kind {
+ match self.kind {
TypeKind::TemplateAlias(t, _) |
TypeKind::Alias(t) |
TypeKind::ResolvedTypeRef(t) => ctx.resolve_type(t).has_vtable(ctx),
TypeKind::Comp(ref info) => info.has_vtable(ctx),
TypeKind::TemplateInstantiation(ref inst) => inst.has_vtable(ctx),
_ => false,
- };
-
- self.detect_has_vtable_cycle.set(false);
-
- result
+ }
}
/// Returns whether this type has a destructor.