about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorRafael Ávila de Espíndola <respindola@mozilla.com>2011-06-06 16:33:42 -0400
committerRafael Ávila de Espíndola <respindola@mozilla.com>2011-06-06 16:36:01 -0400
commitee54fa5c7d4c670ee379e75cbd434bd524f8a3cb (patch)
tree1120f4671cafd8304ac29634b26f79bda0edcaf2 /src/comp
parent4bd5f834b0a259a3ca39c881f81f01f16c65e066 (diff)
downloadrust-ee54fa5c7d4c670ee379e75cbd434bd524f8a3cb.tar.gz
rust-ee54fa5c7d4c670ee379e75cbd434bd524f8a3cb.zip
Implement enough support for pointer to get an identity function working.
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/middle/ty.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs
index 3b7061bb987..9095f9e9c52 100644
--- a/src/comp/middle/ty.rs
+++ b/src/comp/middle/ty.rs
@@ -615,6 +615,7 @@ fn ty_to_str(&ctxt cx, &t typ) -> str {
         case (ty_char)         { s += "char";                           }
         case (ty_str)          { s += "str";                            }
         case (ty_box(?tm))     { s += "@" + mt_to_str(cx, tm);          }
+        case (ty_ptr(?tm))     { s += "*" + mt_to_str(cx, tm);          }
         case (ty_vec(?tm))     { s += "vec[" + mt_to_str(cx, tm) + "]"; }
         case (ty_port(?t))     { s += "port[" + ty_to_str(cx, t) + "]"; }
         case (ty_chan(?t))     { s += "chan[" + ty_to_str(cx, t) + "]"; }
@@ -781,6 +782,10 @@ fn fold_ty(&ctxt cx, ty_fold fld, t ty_0) -> t {
             ty = copy_cname(cx, mk_box(cx, rec(ty=fold_ty(cx, fld, tm.ty),
                                                mut=tm.mut)), ty);
         }
+        case (ty_ptr(?tm)) {
+            ty = copy_cname(cx, mk_ptr(cx, rec(ty=fold_ty(cx, fld, tm.ty),
+                                               mut=tm.mut)), ty);
+        }
         case (ty_vec(?tm)) {
             ty = copy_cname(cx, mk_vec(cx, rec(ty=fold_ty(cx, fld, tm.ty),
                                                           mut=tm.mut)), ty);
@@ -978,6 +983,7 @@ fn type_is_scalar(&ctxt cx, &t ty) -> bool {
         case (ty_char) { ret true; }
         case (ty_type) { ret true; }
         case (ty_native) { ret true; }
+        case (ty_ptr(_)) { ret true; }
         case (_) { ret false; }
     }
 }