summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/clang.rs2
-rw-r--r--src/clangll.rs2
-rw-r--r--src/gen.rs4
-rw-r--r--src/parser.rs6
4 files changed, 7 insertions, 7 deletions
diff --git a/src/clang.rs b/src/clang.rs
index 46cf2eff..4636389b 100644
--- a/src/clang.rs
+++ b/src/clang.rs
@@ -11,7 +11,7 @@ pub use clangll as ll;
use clangll::*;
// Cursor
-#[derive(Copy)]
+#[derive(Copy, Clone)]
pub struct Cursor {
x: CXCursor
}
diff --git a/src/clangll.rs b/src/clangll.rs
index 7c478b67..2e9cb839 100644
--- a/src/clangll.rs
+++ b/src/clangll.rs
@@ -315,7 +315,7 @@ pub const CXCursor_ModuleImportDecl: ::libc::c_uint = 600;
pub const CXCursor_FirstExtraDecl: ::libc::c_uint = 600;
pub const CXCursor_LastExtraDecl: ::libc::c_uint = 600;
#[repr(C)]
-#[derive(Copy)]
+#[derive(Copy, Clone)]
pub struct CXCursor {
pub kind: Enum_CXCursorKind,
pub xdata: ::libc::c_int,
diff --git a/src/gen.rs b/src/gen.rs
index 86cd1435..6dfe080a 100644
--- a/src/gen.rs
+++ b/src/gen.rs
@@ -226,12 +226,12 @@ pub fn gen_mod(links: &[(String, LinkType)], globs: Vec<Global>, span: Span) ->
let mut map: HashMap<abi::Abi, Vec<_>> = HashMap::new();
for (abi, func) in func_list {
- match map.entry(abi) {
+ match map.entry(&abi) {
Entry::Occupied(mut occ) => {
occ.get_mut().push(func);
}
Entry::Vacant(vac) => {
- vac.set(vec!(func));
+ vac.insert(vec!(func));
}
}
}
diff --git a/src/parser.rs b/src/parser.rs
index 96065969..a68a4318 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -64,7 +64,7 @@ fn decl_name(ctx: &mut ClangParserCtx, cursor: &Cursor) -> Global {
let cursor = &cursor.canonical();
let mut new_decl = false;
let override_enum_ty = ctx.options.override_enum_ty;
- let decl = match ctx.name.entry(*cursor) {
+ let decl = match ctx.name.entry(cursor) {
hash_map::Entry::Occupied(ref e) => e.get().clone(),
hash_map::Entry::Vacant(e) => {
new_decl = true;
@@ -116,7 +116,7 @@ fn decl_name(ctx: &mut ClangParserCtx, cursor: &Cursor) -> Global {
_ => GOther,
};
- e.set(glob_decl.clone());
+ e.insert(glob_decl.clone());
glob_decl
},
};
@@ -333,7 +333,7 @@ fn visit_composite(cursor: &Cursor, parent: &Cursor,
// The field is a continuation of an exising bitfield
(Some(width), Some(&il::CompMember::Field(ref mut field)))
if is_bitfield_continuation(field, &ty, width) => {
-
+
if let Some(ref mut bitfields) = field.bitfields {
bitfields.push((cursor.spelling(), width));
} else { unreachable!() }