Skip to content

Commit c64f84c

Browse files
committed
---
yaml --- r: 15621 b: refs/heads/try c: b04b415 h: refs/heads/master i: 15619: 688f49b v: v3
1 parent 32d8285 commit c64f84c

File tree

6 files changed

+31
-2
lines changed

6 files changed

+31
-2
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: 7d05bea7b90a6963b48f761390fc6bc7ae2bb527
5+
refs/heads/try: b04b415e0d6c8b069fd2ee9ed2b5aba097413229
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rustc/metadata/astencode.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,12 @@ fn encode_side_tables_for_id(ecx: @e::encode_ctxt,
844844
}
845845
}
846846
}
847+
848+
option::iter(tcx.borrowings.find(id)) {|_i|
849+
ebml_w.tag(c::tag_table_borrowings) {||
850+
ebml_w.id(id);
851+
}
852+
}
847853
}
848854

849855
impl decoder for ebml::doc {
@@ -914,6 +920,8 @@ fn decode_side_tables(xcx: extended_decode_ctxt,
914920
dcx.maps.copy_map.insert(id, ());
915921
} else if tag == (c::tag_table_spill as uint) {
916922
dcx.maps.spill_map.insert(id, ());
923+
} else if tag == (c::tag_table_borrowings as uint) {
924+
dcx.tcx.borrowings.insert(id, ());
917925
} else {
918926
let val_doc = entry_doc[c::tag_table_val];
919927
let val_dsr = ebml::ebml_deserializer(val_doc);

branches/try/src/rustc/metadata/common.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ enum astencode_tag { // Reserves 0x50 -- 0x6f
109109
tag_table_last_use,
110110
tag_table_spill,
111111
tag_table_method_map,
112-
tag_table_vtable_map
112+
tag_table_vtable_map,
113+
tag_table_borrowings
113114
}
114115

115116
// djb's cdb hashes.

branches/try/src/rustc/metadata/tydecode.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,11 @@ fn parse_ty(st: @pstate, conv: conv_did) -> ty::t {
307307
'@' { ret ty::mk_box(st.tcx, parse_mt(st, conv)); }
308308
'~' { ret ty::mk_uniq(st.tcx, parse_mt(st, conv)); }
309309
'*' { ret ty::mk_ptr(st.tcx, parse_mt(st, conv)); }
310+
'&' {
311+
let r = parse_region(st);
312+
let mt = parse_mt(st, conv);
313+
ret ty::mk_rptr(st.tcx, r, mt);
314+
}
310315
'I' { ret ty::mk_vec(st.tcx, parse_mt(st, conv)); }
311316
'V' {
312317
let mt = parse_mt(st, conv);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn foo(x: &uint) -> uint {
2+
*x
3+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// xfail-fast - check-fast doesn't understand aux-build
2+
// aux-build:cci_borrow_lib.rs
3+
4+
use cci_borrow_lib;
5+
import cci_borrow_lib::foo;
6+
7+
fn main() {
8+
let p = @22u;
9+
let r = foo(p);
10+
#debug["r=%u", r];
11+
assert r == 22u;
12+
}

0 commit comments

Comments
 (0)