Skip to content

Commit cfa2346

Browse files
committed
Use a non-ambiguous character for encoding bare functions
I was using 'R' and that was already used for records. Issue #1022
1 parent 8c77d06 commit cfa2346

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/comp/metadata/tydecode.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,11 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
245245
ret ty::mk_fn(st.tcx, ast::proto_fn, func.args, func.ty, func.cf,
246246
func.cs);
247247
}
248+
'f' {
249+
let func = parse_ty_fn(st, sd);
250+
ret ty::mk_fn(st.tcx, ast::proto_fn, func.args, func.ty, func.cf,
251+
func.cs);
252+
}
248253
'W' {
249254
let func = parse_ty_fn(st, sd);
250255
ret ty::mk_fn(st.tcx, ast::proto_iter, func.args, func.ty, func.cf,

src/comp/metadata/tyencode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ fn enc_proto(w: io::writer, proto: proto) {
197197
proto_iter. { w.write_char('W'); }
198198
proto_fn. { w.write_char('F'); }
199199
proto_block. { w.write_char('B'); }
200-
proto_bare. { w.write_char('R'); }
200+
proto_bare. { w.write_char('f'); }
201201
}
202202
}
203203

0 commit comments

Comments
 (0)