]> git.lizzy.rs Git - rust.git/commitdiff
Use a non-ambiguous character for encoding bare functions
authorBrian Anderson <banderson@mozilla.com>
Tue, 11 Oct 2011 21:38:15 +0000 (14:38 -0700)
committerBrian Anderson <banderson@mozilla.com>
Tue, 11 Oct 2011 21:38:15 +0000 (14:38 -0700)
I was using 'R' and that was already used for records.

Issue #1022

src/comp/metadata/tydecode.rs
src/comp/metadata/tyencode.rs

index e1123c3b6232e7b72eba02dc6e023f88ecb1a4f3..77ad79d2ae95d7109975d2726434b6f36c0a9e2b 100644 (file)
@@ -245,6 +245,11 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
         ret ty::mk_fn(st.tcx, ast::proto_fn, func.args, func.ty, func.cf,
                       func.cs);
       }
+      'f' {
+        let func = parse_ty_fn(st, sd);
+        ret ty::mk_fn(st.tcx, ast::proto_fn, func.args, func.ty, func.cf,
+                      func.cs);
+      }
       'W' {
         let func = parse_ty_fn(st, sd);
         ret ty::mk_fn(st.tcx, ast::proto_iter, func.args, func.ty, func.cf,
index ff21919d14c507c9112dfa125de78515e55f0630..14d52137801d8c2fc9c008cee2794e9b998794c9 100644 (file)
@@ -197,7 +197,7 @@ fn enc_proto(w: io::writer, proto: proto) {
       proto_iter. { w.write_char('W'); }
       proto_fn. { w.write_char('F'); }
       proto_block. { w.write_char('B'); }
-      proto_bare. { w.write_char('R'); }
+      proto_bare. { w.write_char('f'); }
     }
 }