diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2012-08-10 18:14:27 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2012-08-10 18:14:55 -0700 |
| commit | 7634e2911b6cedd7d06bbfd716922c4a750b47ae (patch) | |
| tree | dd0468a750ab25dc63ba6e8c3e99d5df7fcc3dfd /src/rustc/metadata | |
| parent | 1b32b13c720af3ee654bb72c705909e29eb31a78 (diff) | |
| download | rust-7634e2911b6cedd7d06bbfd716922c4a750b47ae.tar.gz rust-7634e2911b6cedd7d06bbfd716922c4a750b47ae.zip | |
Revert "rustc: Make function types have vstores in them"
This reverts commit 0101125a962abae18525d6014cd26ad10bbb96e6.
Diffstat (limited to 'src/rustc/metadata')
| -rw-r--r-- | src/rustc/metadata/tydecode.rs | 14 | ||||
| -rw-r--r-- | src/rustc/metadata/tyencode.rs | 15 |
2 files changed, 14 insertions, 15 deletions
diff --git a/src/rustc/metadata/tydecode.rs b/src/rustc/metadata/tydecode.rs index 80c64430ec3..e66d0cef71b 100644 --- a/src/rustc/metadata/tydecode.rs +++ b/src/rustc/metadata/tydecode.rs @@ -85,11 +85,13 @@ fn parse_ty_rust_fn(st: @pstate, conv: conv_did) -> ty::t { return ty::mk_fn(st.tcx, parse_ty_fn(st, conv)); } -fn parse_proto(st: @pstate) -> ty::fn_proto { - match next(st) { - 'n' => ty::proto_bare, - 'v' => ty::proto_vstore(parse_vstore(st)), - c => fail ~"illegal proto type kind " + str::from_char(c) +fn parse_proto(c: char) -> ast::proto { + match c { + '~' => ast::proto_uniq, + '@' => ast::proto_box, + '&' => ast::proto_block, + 'n' => ast::proto_bare, + _ => fail ~"illegal fn type kind " + str::from_char(c) } } @@ -358,7 +360,7 @@ fn parse_purity(c: char) -> purity { } fn parse_ty_fn(st: @pstate, conv: conv_did) -> ty::fn_ty { - let proto = parse_proto(st); + let proto = parse_proto(next(st)); let purity = parse_purity(next(st)); let bounds = parse_bounds(st, conv); assert (next(st) == '['); diff --git a/src/rustc/metadata/tyencode.rs b/src/rustc/metadata/tyencode.rs index 30b2a21167a..9e67157b181 100644 --- a/src/rustc/metadata/tyencode.rs +++ b/src/rustc/metadata/tyencode.rs @@ -306,15 +306,12 @@ fn enc_sty(w: io::writer, cx: @ctxt, st: ty::sty) { } } } - -fn enc_proto(w: io::writer, cx: @ctxt, proto: ty::fn_proto) { - w.write_str(&"f"); +fn enc_proto(w: io::writer, proto: proto) { match proto { - ty::proto_bare => w.write_str(&"n"), - ty::proto_vstore(vstore) => { - w.write_str(&"v"); - enc_vstore(w, cx, vstore); - } + proto_uniq => w.write_str(&"f~"), + proto_box => w.write_str(&"f@"), + proto_block => w.write_str(~"f&"), + proto_bare => w.write_str(&"fn") } } @@ -338,7 +335,7 @@ fn enc_purity(w: io::writer, p: purity) { } fn enc_ty_fn(w: io::writer, cx: @ctxt, ft: ty::fn_ty) { - enc_proto(w, cx, ft.proto); + enc_proto(w, ft.proto); enc_purity(w, ft.purity); enc_bounds(w, cx, ft.bounds); w.write_char('['); |
