diff options
-rw-r--r-- | .github/ISSUE_TEMPLATE.md | 9 | ||||
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/ir/ty.rs | 19 |
4 files changed, 12 insertions, 20 deletions
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index c10fab0f..02fe3cde 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,7 +1,14 @@ ### Input C/C++ Header ```C++ -// Insert your (minimal) C/C++ header here. +// Insert your minimal C or C++ header here. +// +// It should *NOT* have any `#include`s! Not all systems have the same header +// files, and therefore any `#include` harms reproducibility. Additionally, +// the test case isn't minimal since the included file almost assuredly +// contains things that aren't necessary to reproduce the bug, and makes +// tracking it down much more difficult. If necessary, see +// https://github.com/servo/rust-bindgen/blob/master/CONTRIBUTING.md#using-creduce-to-minimize-test-cases ``` ### Bindgen Invocation @@ -1,6 +1,6 @@ [root] name = "bindgen" -version = "0.26.2" +version = "0.26.3" dependencies = [ "aster 0.41.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.26.2" +version = "0.26.3" build = "build.rs" exclude = [ 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. |