diff options
author | Francois Bernier <frankbernier@gmail.com> | 2015-01-05 20:42:40 -0500 |
---|---|---|
committer | Francois Bernier <frankbernier@gmail.com> | 2015-01-05 20:42:40 -0500 |
commit | cb9d2880369bca0bbb2ba7e82c9d626127cda5b3 (patch) | |
tree | 1de0d088c05e6b192f6a86e2705d3c13235fe3b1 | |
parent | a78f887c3db5907e6f3cd16066f139a970d21d8f (diff) |
Fixes after entry api modifications
-rw-r--r-- | src/clang.rs | 2 | ||||
-rw-r--r-- | src/clangll.rs | 2 | ||||
-rw-r--r-- | src/gen.rs | 4 | ||||
-rw-r--r-- | src/parser.rs | 6 |
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, @@ -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!() } |