Skip to content

Commit 5ae225e

Browse files
author
Jorge Aparicio
committed
fix: update to rust nightly
1 parent f70cf42 commit 5ae225e

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/bgmacro.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::default::Default;
22
use std::env;
3+
use std::path::Path;
34

45
use syntax::ast;
56
use syntax::codemap;
@@ -28,7 +29,8 @@ pub fn bindgen_macro(cx: &mut base::ExtCtxt, sp: codemap::Span, tts: &[ast::Toke
2829

2930
// Set the working dir to the directory containing the invoking rs file so
3031
// that clang searches for headers relative to it rather than the crate root
31-
let mod_dir = Path::new(cx.codemap().span_to_filename(sp)).dirname().to_vec();
32+
let filename = cx.codemap().span_to_filename(sp);
33+
let mod_dir = Path::new(&filename).parent().unwrap();
3234
let cwd = match env::current_dir() {
3335
Ok(d) => d,
3436
Err(e) => panic!("Invalid current working directory: {}", e),
@@ -52,7 +54,7 @@ pub fn bindgen_macro(cx: &mut base::ExtCtxt, sp: codemap::Span, tts: &[ast::Toke
5254
Err(_) => base::DummyResult::any(sp)
5355
};
5456

55-
let p = Path::new(cwd);
57+
let p = Path::new(&cwd);
5658
if let Err(e) = env::set_current_dir(&p) {
5759
panic!("Failed to return to directory {}: {}", p.display(), e);
5860
}

src/clang.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ pub fn ast_dump(c: &Cursor, depth: isize)-> Enum_CXVisitorResult {
708708
c.spelling().as_slice(),
709709
type_to_str(ct)).as_slice()
710710
);
711-
c.visit(|&: s, _: &Cursor| {
711+
c.visit(| s, _: &Cursor| {
712712
ast_dump(s, depth + 1)
713713
});
714714
print_indent(depth, ")");

src/gen.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ fn gen_comp_methods(ctx: &mut GenCtx, data_field: &str, data_offset: usize,
681681
extra: &mut Vec<P<ast::Item>>) -> Vec<ast::ImplItem> {
682682
let data_ident = ctx.ext_cx.ident_of(data_field);
683683

684-
let mk_field_method = |&: ctx: &mut GenCtx, f: &FieldInfo, offset: usize| {
684+
let mk_field_method = |ctx: &mut GenCtx, f: &FieldInfo, offset: usize| {
685685
// TODO: Implement bitfield accessors
686686
if f.bitfields.is_some() { return None; }
687687

@@ -984,6 +984,7 @@ fn cty_to_rs(ctx: &mut GenCtx, ty: &Type) -> ast::Ty {
984984

985985
fn mk_ty(ctx: &GenCtx, global: bool, segments: Vec<String>) -> ast::Ty {
986986
let ty = ast::TyPath(
987+
None,
987988
ast::Path {
988989
span: ctx.span,
989990
global: global,
@@ -998,7 +999,6 @@ fn mk_ty(ctx: &GenCtx, global: bool, segments: Vec<String>) -> ast::Ty {
998999
}
9991000
}).collect()
10001001
},
1001-
ast::DUMMY_NODE_ID
10021002
);
10031003

10041004
return ast::Ty {
@@ -1100,12 +1100,12 @@ fn mk_fnty(ctx: &mut GenCtx, decl: &ast::FnDecl, abi: abi::Abi) -> ast::Ty {
11001100
return ast::Ty {
11011101
id: ast::DUMMY_NODE_ID,
11021102
node: ast::TyPath(
1103+
None,
11031104
ast::Path {
11041105
span: ctx.span,
11051106
global: true,
11061107
segments: segs
11071108
},
1108-
ast::DUMMY_NODE_ID
11091109
),
11101110
span: ctx.span
11111111
};

0 commit comments

Comments
 (0)