Skip to content

Commit 0397c05

Browse files
committed
Support for passing native types through metadata/creader.
1 parent 2a2ea63 commit 0397c05

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/comp/front/creader.rs

+2
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ fn kind_has_type_params(u8 kind_ch) -> bool {
524524
else if (kind_ch == ('y' as u8)) { ret true; }
525525
else if (kind_ch == ('o' as u8)) { ret true; }
526526
else if (kind_ch == ('t' as u8)) { ret true; }
527+
else if (kind_ch == ('T' as u8)) { ret false; }
527528
else if (kind_ch == ('m' as u8)) { ret false; }
528529
else if (kind_ch == ('n' as u8)) { ret false; }
529530
else if (kind_ch == ('v' as u8)) { ret true; }
@@ -561,6 +562,7 @@ fn lookup_def(session.session sess, int cnum, vec[ast.ident] path)
561562
else if (kind_ch == ('F' as u8)) { def = ast.def_native_fn(did); }
562563
else if (kind_ch == ('y' as u8)) { def = ast.def_ty(did); }
563564
else if (kind_ch == ('o' as u8)) { def = ast.def_obj(did); }
565+
else if (kind_ch == ('T' as u8)) { def = ast.def_native_ty(did); }
564566
else if (kind_ch == ('t' as u8)) {
565567
// We treat references to tags as references to types.
566568
def = ast.def_ty(did);

src/comp/middle/trans.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -6211,7 +6211,9 @@ fn collect_native_item(&@crate_ctxt cx, @ast.native_item i) -> @crate_ctxt {
62116211
decl_native_fn_and_pair(cx, name, ann, fid);
62126212
}
62136213
}
6214-
case (_) { /* fall through */ }
6214+
case (ast.native_item_ty(_, ?tid)) {
6215+
cx.native_items.insert(tid, i);
6216+
}
62156217
}
62166218
ret cx;
62176219
}

0 commit comments

Comments
 (0)