about summary refs log tree commit diff
path: root/src/comp/front
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2011-03-30 18:28:33 -0700
committerPatrick Walton <pcwalton@mimiga.net>2011-03-30 18:28:33 -0700
commitab8d200fb0d7e3dbd9fad4a87201908658dfc700 (patch)
tree4d0c2d3669f30626ff53871bf18d901d7461f3c4 /src/comp/front
parentae5ba62b240a4b3d1dacc062ba2f57d62b89d4f5 (diff)
downloadrust-ab8d200fb0d7e3dbd9fad4a87201908658dfc700.tar.gz
rust-ab8d200fb0d7e3dbd9fad4a87201908658dfc700.zip
rustc: Read 'y' tags from external crates
Diffstat (limited to 'src/comp/front')
-rw-r--r--src/comp/front/creader.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/comp/front/creader.rs b/src/comp/front/creader.rs
index ea6581e0bb1..4e7c2193602 100644
--- a/src/comp/front/creader.rs
+++ b/src/comp/front/creader.rs
@@ -548,6 +548,7 @@ fn kind_has_type_params(u8 kind_ch) -> bool {
     // FIXME: It'd be great if we had u8 char literals.
     if (kind_ch == ('c' as u8))      { ret false; }
     else if (kind_ch == ('f' as u8)) { ret true;  }
+    else if (kind_ch == ('y' as u8)) { ret true;  }
     else if (kind_ch == ('o' as u8)) { ret true;  }
     else if (kind_ch == ('t' as u8)) { ret true;  }
     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)
 
     // FIXME: It'd be great if we had u8 char literals.
     auto def;
-    if (kind_ch == ('c' as u8))      { def = ast.def_const(did);        }
-    else if (kind_ch == ('f' as u8)) { def = ast.def_fn(did);           }
-    else if (kind_ch == ('o' as u8)) { def = ast.def_obj(did);          }
-    else if (kind_ch == ('t' as u8)) { def = ast.def_ty(did);           }
-    else if (kind_ch == ('m' as u8)) { def = ast.def_mod(did);          }
-    else if (kind_ch == ('n' as u8)) { def = ast.def_native_mod(did);   }
+    if (kind_ch == ('c' as u8))         { def = ast.def_const(did);      }
+    else if (kind_ch == ('f' as u8))    { def = ast.def_fn(did);         }
+    else if (kind_ch == ('y' as u8))    { def = ast.def_ty(did);         }
+    else if (kind_ch == ('o' as u8))    { def = ast.def_obj(did);        }
+    else if (kind_ch == ('t' as u8)) {
+        // We treat references to tags as references to types.
+        def = ast.def_ty(did);
+    } else if (kind_ch == ('m' as u8))  { def = ast.def_mod(did);        }
+    else if (kind_ch == ('n' as u8))    { def = ast.def_native_mod(did); }
     else if (kind_ch == ('v' as u8)) {
         auto tid = get_variant_tag_id(ebml_r);
         tid = tup(cnum, tid._1);