about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-03-05 18:06:53 -0800
committerPatrick Walton <pcwalton@mimiga.net>2013-03-07 22:32:54 -0800
commit4e3dbfe05257b4f5862e7b57777cba6d179d9cc0 (patch)
tree62d9b6044fa74d11807e0f69dd56680e1747830e /src/libsyntax
parent239e64242c2f35b223403be611ad6a25ce8e76c2 (diff)
downloadrust-4e3dbfe05257b4f5862e7b57777cba6d179d9cc0.tar.gz
rust-4e3dbfe05257b4f5862e7b57777cba6d179d9cc0.zip
librustc: Remove structural record types from the compiler
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs1
-rw-r--r--src/libsyntax/fold.rs1
-rw-r--r--src/libsyntax/parse/parser.rs4
-rw-r--r--src/libsyntax/print/pprust.rs14
-rw-r--r--src/libsyntax/visit.rs5
5 files changed, 2 insertions, 23 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index e75bff3fec2..256e48a69b3 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -935,7 +935,6 @@ pub enum ty_ {
     ty_fixed_length_vec(mt, uint),
     ty_ptr(mt),
     ty_rptr(@region, mt),
-    ty_rec(~[ty_field]),
     ty_closure(@TyClosure),
     ty_bare_fn(@TyBareFn),
     ty_tup(~[@Ty]),
diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs
index 464bec505e3..3fbc1571c1b 100644
--- a/src/libsyntax/fold.rs
+++ b/src/libsyntax/fold.rs
@@ -613,7 +613,6 @@ pub fn noop_fold_ty(t: &ty_, fld: @ast_fold) -> ty_ {
         ty_vec(ref mt) => ty_vec(fold_mt(mt, fld)),
         ty_ptr(ref mt) => ty_ptr(fold_mt(mt, fld)),
         ty_rptr(region, ref mt) => ty_rptr(region, fold_mt(mt, fld)),
-        ty_rec(ref fields) => ty_rec(fields.map(|f| fold_field(*f, fld))),
         ty_closure(ref f) => {
             ty_closure(@TyClosure {
                 sigil: f.sigil,
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index cb4a2ce6920..b159e79a09c 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -51,7 +51,7 @@ use ast::{token_tree, trait_method, trait_ref, tt_delim, tt_seq, tt_tok};
 use ast::{tt_nonterminal, tuple_variant_kind, Ty, ty_, ty_bot, ty_box};
 use ast::{ty_field, ty_fixed_length_vec, ty_closure, ty_bare_fn};
 use ast::{ty_infer, ty_mac, ty_method};
-use ast::{ty_nil, TyParam, TyParamBound, ty_path, ty_ptr, ty_rec, ty_rptr};
+use ast::{ty_nil, TyParam, TyParamBound, ty_path, ty_ptr, ty_rptr};
 use ast::{ty_tup, ty_u32, ty_uniq, ty_vec, type_value_ns, uniq};
 use ast::{unnamed_field, unsafe_blk, unsafe_fn, variant, view_item};
 use ast::{view_item_, view_item_extern_mod, view_item_use};
@@ -659,7 +659,7 @@ pub impl Parser {
                 self.unexpected_last(&token::RBRACE);
             }
             self.obsolete(*self.last_span, ObsoleteRecordType);
-            ty_rec(elems)
+            ty_nil
         } else if *self.token == token::LBRACKET {
             self.expect(&token::LBRACKET);
             let mt = self.parse_mt();
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 2b85a918364..1d7d4d0d65f 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -402,20 +402,6 @@ pub fn print_type_ex(s: @ps, &&ty: @ast::Ty, print_colons: bool) {
           print_region(s, ~"&", region, ~"/");
           print_mt(s, mt);
       }
-      ast::ty_rec(ref fields) => {
-        word(s.s, ~"{");
-        fn print_field(s: @ps, f: ast::ty_field) {
-            cbox(s, indent_unit);
-            print_mutability(s, f.node.mt.mutbl);
-            print_ident(s, f.node.ident);
-            word_space(s, ~":");
-            print_type(s, f.node.mt.ty);
-            end(s);
-        }
-        fn get_span(f: ast::ty_field) -> codemap::span { return f.span; }
-        commasep_cmnt(s, consistent, (*fields), print_field, get_span);
-        word(s.s, ~",}");
-      }
       ast::ty_tup(elts) => {
         popen(s);
         commasep(s, inconsistent, elts, print_type);
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs
index 5e97793b480..47fe1b5ba0b 100644
--- a/src/libsyntax/visit.rs
+++ b/src/libsyntax/visit.rs
@@ -232,11 +232,6 @@ pub fn visit_ty<E>(t: @Ty, e: E, v: vt<E>) {
         ty_vec(mt) | ty_ptr(mt) | ty_rptr(_, mt) => {
             (v.visit_ty)(mt.ty, e, v);
         },
-        ty_rec(ref flds) => {
-            for flds.each |f| {
-                (v.visit_ty)(f.node.mt.ty, e, v);
-            }
-        },
         ty_tup(ref ts) => {
             for ts.each |tt| {
                 (v.visit_ty)(*tt, e, v);