Skip to content

Commit ab8d200

Browse files
committed
rustc: Read 'y' tags from external crates
1 parent ae5ba62 commit ab8d200

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/comp/front/creader.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ fn kind_has_type_params(u8 kind_ch) -> bool {
548548
// FIXME: It'd be great if we had u8 char literals.
549549
if (kind_ch == ('c' as u8)) { ret false; }
550550
else if (kind_ch == ('f' as u8)) { ret true; }
551+
else if (kind_ch == ('y' as u8)) { ret true; }
551552
else if (kind_ch == ('o' as u8)) { ret true; }
552553
else if (kind_ch == ('t' as u8)) { ret true; }
553554
else if (kind_ch == ('m' as u8)) { ret false; }
@@ -582,12 +583,15 @@ fn lookup_def(session.session sess, int cnum, vec[ast.ident] path)
582583

583584
// FIXME: It'd be great if we had u8 char literals.
584585
auto def;
585-
if (kind_ch == ('c' as u8)) { def = ast.def_const(did); }
586-
else if (kind_ch == ('f' as u8)) { def = ast.def_fn(did); }
587-
else if (kind_ch == ('o' as u8)) { def = ast.def_obj(did); }
588-
else if (kind_ch == ('t' as u8)) { def = ast.def_ty(did); }
589-
else if (kind_ch == ('m' as u8)) { def = ast.def_mod(did); }
590-
else if (kind_ch == ('n' as u8)) { def = ast.def_native_mod(did); }
586+
if (kind_ch == ('c' as u8)) { def = ast.def_const(did); }
587+
else if (kind_ch == ('f' as u8)) { def = ast.def_fn(did); }
588+
else if (kind_ch == ('y' as u8)) { def = ast.def_ty(did); }
589+
else if (kind_ch == ('o' as u8)) { def = ast.def_obj(did); }
590+
else if (kind_ch == ('t' as u8)) {
591+
// We treat references to tags as references to types.
592+
def = ast.def_ty(did);
593+
} else if (kind_ch == ('m' as u8)) { def = ast.def_mod(did); }
594+
else if (kind_ch == ('n' as u8)) { def = ast.def_native_mod(did); }
591595
else if (kind_ch == ('v' as u8)) {
592596
auto tid = get_variant_tag_id(ebml_r);
593597
tid = tup(cnum, tid._1);

0 commit comments

Comments
 (0)