summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ir/comp.rs2
-rw-r--r--src/ir/context.rs3
-rw-r--r--src/ir/function.rs2
-rw-r--r--src/ir/item.rs2
-rw-r--r--src/ir/mod.rs1
-rw-r--r--src/ir/traversal.rs16
-rw-r--r--src/ir/ty.rs2
-rw-r--r--src/ir/type_collector.rs19
8 files changed, 20 insertions, 27 deletions
diff --git a/src/ir/comp.rs b/src/ir/comp.rs
index 2ca25479..e829b912 100644
--- a/src/ir/comp.rs
+++ b/src/ir/comp.rs
@@ -6,7 +6,7 @@ use super::derive::{CanDeriveCopy, CanDeriveDebug, CanDeriveDefault};
use super::item::{Item, ItemSet};
use super::layout::Layout;
use super::ty::{TemplateDeclaration, Type};
-use super::type_collector::TypeCollector;
+use super::traversal::TypeCollector;
use clang;
use parse::{ClangItemParser, ParseError};
use std::cell::Cell;
diff --git a/src/ir/context.rs b/src/ir/context.rs
index e251f0c3..cc2ee560 100644
--- a/src/ir/context.rs
+++ b/src/ir/context.rs
@@ -5,9 +5,8 @@ use super::int::IntKind;
use super::item::{Item, ItemSet, ItemCanonicalPath};
use super::item_kind::ItemKind;
use super::module::{Module, ModuleKind};
-use super::traversal::ItemTraversal;
+use super::traversal::{ItemTraversal, TypeCollector};
use super::ty::{FloatKind, TemplateDeclaration, Type, TypeKind};
-use super::type_collector::TypeCollector;
use BindgenOptions;
use cexpr;
use chooser::TypeChooser;
diff --git a/src/ir/function.rs b/src/ir/function.rs
index be8c49d5..17d03532 100644
--- a/src/ir/function.rs
+++ b/src/ir/function.rs
@@ -3,7 +3,7 @@
use super::context::{BindgenContext, ItemId};
use super::item::{Item, ItemSet};
use super::ty::TypeKind;
-use super::type_collector::TypeCollector;
+use super::traversal::TypeCollector;
use clang;
use clang_sys::CXCallingConv;
use parse::{ClangItemParser, ClangSubItemParser, ParseError, ParseResult};
diff --git a/src/ir/item.rs b/src/ir/item.rs
index 2717c792..86fe6525 100644
--- a/src/ir/item.rs
+++ b/src/ir/item.rs
@@ -7,7 +7,7 @@ use super::function::Function;
use super::item_kind::ItemKind;
use super::module::Module;
use super::ty::{TemplateDeclaration, Type, TypeKind};
-use super::type_collector::TypeCollector;
+use super::traversal::TypeCollector;
use clang;
use clang_sys;
use parse::{ClangItemParser, ClangSubItemParser, ParseError, ParseResult};
diff --git a/src/ir/mod.rs b/src/ir/mod.rs
index 9e53c184..9fe0beb5 100644
--- a/src/ir/mod.rs
+++ b/src/ir/mod.rs
@@ -16,6 +16,5 @@ pub mod layout;
pub mod module;
pub mod traversal;
pub mod ty;
-pub mod type_collector;
pub mod var;
pub mod objc;
diff --git a/src/ir/traversal.rs b/src/ir/traversal.rs
index d8e9a6e2..442c5449 100644
--- a/src/ir/traversal.rs
+++ b/src/ir/traversal.rs
@@ -2,7 +2,21 @@
use super::context::{BindgenContext, ItemId};
use super::item::ItemSet;
-use super::type_collector::TypeCollector;
+
+/// Collect all the type items referenced by this item.
+pub trait TypeCollector {
+ /// If a particular type needs extra information beyond what it has in
+ /// `self` and `context` to find its referenced type items, its
+ /// implementation can define this associated type, forcing callers to pass
+ /// the needed information through.
+ type Extra;
+
+ /// Add each type item referenced by `self` into the `types` set.
+ fn collect_types(&self,
+ context: &BindgenContext,
+ types: &mut ItemSet,
+ extra: &Self::Extra);
+}
/// An graph traversal of the transitive closure of references between items.
///
diff --git a/src/ir/ty.rs b/src/ir/ty.rs
index b51054b7..c9ee453c 100644
--- a/src/ir/ty.rs
+++ b/src/ir/ty.rs
@@ -9,7 +9,7 @@ use super::int::IntKind;
use super::item::{Item, ItemSet};
use super::layout::Layout;
use super::objc::ObjCInterface;
-use super::type_collector::TypeCollector;
+use super::traversal::TypeCollector;
use clang::{self, Cursor};
use parse::{ClangItemParser, ParseError, ParseResult};
use std::mem;
diff --git a/src/ir/type_collector.rs b/src/ir/type_collector.rs
deleted file mode 100644
index 424007a1..00000000
--- a/src/ir/type_collector.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-//! Collecting type items.
-
-use super::context::BindgenContext;
-use super::item::ItemSet;
-
-/// Collect all the type items referenced by this item.
-pub trait TypeCollector {
- /// If a particular type needs extra information beyond what it has in
- /// `self` and `context` to find its referenced type items, its
- /// implementation can define this associated type, forcing callers to pass
- /// the needed information through.
- type Extra;
-
- /// Add each type item referenced by `self` into the `types` set.
- fn collect_types(&self,
- context: &BindgenContext,
- types: &mut ItemSet,
- extra: &Self::Extra);
-}