Skip to content

Commit 355422d

Browse files
committed
Implement tydecode::parse_vstore.
1 parent da13059 commit 355422d

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/rustc/metadata/tydecode.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,20 @@ fn parse_proto(c: char) -> ast::proto {
179179
}
180180

181181
fn parse_vstore(st: @pstate) -> ty::vstore {
182-
st.tcx.sess.unimpl("tydecode::parse_vstore");
182+
assert next(st) == '/';
183+
184+
let c = peek(st);
185+
if '0' <= c && c <= '9' {
186+
let n = parse_int(st) as uint;
187+
assert next(st) == '|';
188+
ret ty::vstore_fixed(n);
189+
}
190+
191+
alt check next(st) {
192+
'~' { ty::vstore_uniq }
193+
'@' { ty::vstore_box }
194+
'&' { ty::vstore_slice(parse_region(st)) }
195+
}
183196
}
184197

185198
fn parse_substs(st: @pstate, conv: conv_did) -> ty::substs {

0 commit comments

Comments
 (0)