Skip to content

Commit 623a279

Browse files
committed
---
yaml --- r: 14288 b: refs/heads/try c: c4c89dd h: refs/heads/master v: v3
1 parent 3f47d04 commit 623a279

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 0a503228f6b7a831418f0a247944e20c01c1b84e
5+
refs/heads/try: c4c89dd68475a0f2fb227abdda854760a2cd8459
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/comp/middle/trans/base.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,6 +2338,19 @@ fn lval_static_fn(bcx: @block_ctxt, fn_id: ast::def_id, id: ast::node_id,
23382338
// External reference.
23392339
trans_external_path(bcx, fn_id, tpt)
23402340
};
2341+
2342+
// FIXME: Need to support external crust functions
2343+
if fn_id.crate == ast::local_crate {
2344+
alt bcx_tcx(bcx).def_map.find(id) {
2345+
some(ast::def_fn(_, ast::crust_fn)) {
2346+
// Crust functions are just opaque pointers
2347+
let val = PointerCast(bcx, val, T_ptr(T_i8()));
2348+
ret lval_no_env(bcx, val, owned_imm);
2349+
}
2350+
_ { }
2351+
}
2352+
}
2353+
23412354
let gen = generic_none, bcx = bcx;
23422355
if tys.len() > 0u {
23432356
let tydescs = [], tis = [];
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
crust fn f() {
22
}
33

4+
crust fn g() {
5+
}
6+
47
fn main() {
58
// Crust functions are *u8 types
6-
let _x: *u8 = f;
7-
}
9+
let a: *u8 = f;
10+
let b: *u8 = f;
11+
let c: *u8 = g;
12+
13+
assert a == b;
14+
assert a != c;
15+
}

0 commit comments

Comments
 (0)