Preparation for kind system overhaul

This goes before a snapshot, so that subsequenct patches can make the
transition without breaking the build. Disables kind checking pass, makes
parser accept both new and old-style kind annotation.

Issue #1177
This commit is contained in:
Marijn Haverbeke 2011-11-15 16:45:14 +01:00
parent eff7fae7b9
commit 9cf48d3753
26 changed files with 78 additions and 58 deletions

View file

@ -116,9 +116,9 @@ fn item_ty_param_kinds(item: ebml::doc) -> [ast::kind] {
while i < vi.val {
let k =
alt dat[vi.next + i] as char {
'u' { ast::kind_unique }
's' { ast::kind_shared }
'p' { ast::kind_pinned }
's' { ast::kind_sendable }
'c' { ast::kind_copyable }
'a' { ast::kind_noncopyable }
};
ks += [k];
i += 1u;

View file

@ -170,9 +170,9 @@ fn encode_type_param_kinds(ebml_w: ebml::writer, tps: [ty_param]) {
ebml::write_vint(ebml_w.writer, vec::len::<ty_param>(tps));
for tp: ty_param in tps {
let c = alt ast_util::ty_param_kind(tp) {
kind_unique. { 'u' }
kind_shared. { 's' }
kind_pinned. { 'p' }
kind_sendable. { 's' }
kind_copyable. { 'c' }
kind_noncopyable. { 'a' }
};
ebml_w.writer.write([c as u8]);
}

View file

@ -204,9 +204,9 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
'p' {
let k =
alt next(st) as char {
'u' { kind_unique }
's' { kind_shared }
'p' { kind_pinned }
's' { kind_sendable }
'c' { kind_copyable }
'a' { kind_noncopyable }
c {
log_err "unexpected char in encoded type param: ";
log_err c;

View file

@ -172,9 +172,9 @@ fn enc_sty(w: io::writer, cx: @ctxt, st: ty::sty) {
}
ty::ty_param(id, k) {
alt k {
kind_unique. { w.write_str("pu"); }
kind_shared. { w.write_str("ps"); }
kind_pinned. { w.write_str("pp"); }
kind_sendable. { w.write_str("ps"); }
kind_copyable. { w.write_str("pc"); }
kind_noncopyable. { w.write_str("pa"); }
}
w.write_str(uint::str(id));
}