diff options
-rw-r--r-- | src/clang.rs | 2 | ||||
-rw-r--r-- | src/gen.rs | 12 | ||||
-rw-r--r-- | src/macro.rs | 7 |
3 files changed, 10 insertions, 11 deletions
diff --git a/src/clang.rs b/src/clang.rs index c4343b4a..f25edd80 100644 --- a/src/clang.rs +++ b/src/clang.rs @@ -247,7 +247,7 @@ pub struct SourceLocation { impl SourceLocation { pub fn location(&self) -> (File, uint, uint, uint) { unsafe { - let mut file = ptr::mut_null(); + let mut file = ptr::null_mut(); let mut line = 0; let mut col = 0; let mut off = 0; @@ -4,7 +4,7 @@ use std::cell::RefCell; use std::option; use std::iter; use std::vec::Vec; -use std::gc::{Gc, GC}; +use std::gc::GC; use syntax::abi; use syntax::ast; @@ -137,7 +137,7 @@ pub fn gen_mod(abi: &str, links: &[(String, Option<String>)], globs: Vec<Global> let mut fs = vec!(); let mut vs = vec!(); let mut gs = vec!(); - for g in uniq_globs.move_iter() { + for g in uniq_globs.into_iter() { match g { GOther => {} GFunc(_) => fs.push(g), @@ -149,7 +149,7 @@ pub fn gen_mod(abi: &str, links: &[(String, Option<String>)], globs: Vec<Global> let mut defs = vec!(); gs = remove_redundant_decl(gs); - for g in gs.move_iter() { + for g in gs.into_iter() { match g { GType(ti) => { let t = ti.borrow().clone(); @@ -204,7 +204,7 @@ pub fn gen_mod(abi: &str, links: &[(String, Option<String>)], globs: Vec<Global> } } - let vars = vs.move_iter().map(|v| { + let vars = vs.into_iter().map(|v| { match v { GVar(vi) => { let v = vi.borrow(); @@ -214,7 +214,7 @@ pub fn gen_mod(abi: &str, links: &[(String, Option<String>)], globs: Vec<Global> } }).collect(); - let funcs = fs.move_iter().map(|f| { + let funcs = fs.into_iter().map(|f| { match f { GFunc(vi) => { let v = vi.borrow(); @@ -317,7 +317,7 @@ fn remove_redundant_decl(gs: Vec<Global>) -> Vec<Global> { } ).collect(); - return gs.move_iter().filter(|g| + return gs.into_iter().filter(|g| !typedefs.iter().any(|t| check_decl(g, t)) ).collect(); } diff --git a/src/macro.rs b/src/macro.rs index c75c3f0b..9941a67e 100644 --- a/src/macro.rs +++ b/src/macro.rs @@ -1,11 +1,10 @@ -use std::cell::RefCell; use std::default::Default; use std::os; use syntax::ast; use syntax::codemap; use syntax::ext::base; -use syntax::parse; +use syntax::fold::Folder; use syntax::parse::token; use syntax::ptr::P; use syntax::util::small_vector::SmallVector; @@ -107,7 +106,7 @@ impl MacroArgsVisitor for BindgenArgsVisitor { // Parses macro invocations in the form [ident=|:]value where value is an ident or literal // e.g. bindgen!(module_name, "header.h", emit_builtins=false, clang_args:"-I /usr/local/include") fn parse_macro_opts(cx: &mut base::ExtCtxt, tts: &[ast::TokenTree], visit: &mut MacroArgsVisitor) -> bool { - let mut parser = parse::new_parser_from_tts(cx.parse_sess(), cx.cfg(), Vec::from_slice(tts)); + let mut parser = cx.new_parser_from_tts(tts); let mut args_good = true; loop { @@ -149,7 +148,7 @@ fn parse_macro_opts(cx: &mut base::ExtCtxt, tts: &[ast::TokenTree], visit: &mut } // Match [literal] and parse as an expression so we can expand macros _ => { - let expr = cx.expand_expr(parser.parse_expr()); + let expr = cx.expander().fold_expr(parser.parse_expr()); span.hi = expr.span.hi; match expr.node { ast::ExprLit(ref lit) => { |