summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2013-01-14 21:36:27 -0800
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2013-01-14 21:36:27 -0800
commit293cd3480c10855de68503db36c6cc3ce8988b54 (patch)
tree34ded4b28bd49ec489bb7499b1fb02fd8767dcad /src/libsyntax/ext
parent4bcd19f6be51d7fb26b0930c8a3354b9222143ff (diff)
downloadrust-293cd3480c10855de68503db36c6cc3ce8988b54.tar.gz
rust-293cd3480c10855de68503db36c6cc3ce8988b54.zip
convert ast::{field_,capture_item_,mt} and middle::ty::mt into structs
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/auto_encode.rs10
-rw-r--r--src/libsyntax/ext/build.rs6
-rw-r--r--src/libsyntax/ext/deriving.rs5
-rw-r--r--src/libsyntax/ext/pipes/ast_builder.rs15
4 files changed, 26 insertions, 10 deletions
diff --git a/src/libsyntax/ext/auto_encode.rs b/src/libsyntax/ext/auto_encode.rs
index fcb11f42647..e241f6435d3 100644
--- a/src/libsyntax/ext/auto_encode.rs
+++ b/src/libsyntax/ext/auto_encode.rs
@@ -571,7 +571,7 @@ fn mk_ser_method(
                 id: cx.next_id(),
                 node: ast::re_anon,
             },
-            {
+            ast::mt {
                 ty: cx.ty_path(span, ~[cx.ident_of(~"__S")], ~[]),
                 mutbl: ast::m_imm
             }
@@ -634,7 +634,7 @@ fn mk_deser_method(
                 id: cx.next_id(),
                 node: ast::re_anon,
             },
-            {
+            ast::mt {
                 ty: cx.ty_path(span, ~[cx.ident_of(~"__D")], ~[]),
                 mutbl: ast::m_imm
             }
@@ -908,7 +908,11 @@ fn mk_deser_fields(
         );
 
         ast::spanned {
-            node: { mutbl: field.mutbl, ident: field.ident, expr: expr },
+            node: ast::field_ {
+                mutbl: field.mutbl,
+                ident: field.ident,
+                expr: expr,
+            },
             span: span,
         }
     }
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs
index 72c13747bf1..cc4c58f3504 100644
--- a/src/libsyntax/ext/build.rs
+++ b/src/libsyntax/ext/build.rs
@@ -145,8 +145,10 @@ fn mk_uniq_str(cx: ext_ctxt, sp: span, s: ~str) -> @ast::expr {
 }
 fn mk_field(sp: span, f: &{ident: ast::ident, ex: @ast::expr})
     -> ast::field {
-    ast::spanned { node: {mutbl: ast::m_imm, ident: f.ident, expr: f.ex},
-                   span: sp }
+    ast::spanned {
+        node: ast::field_ { mutbl: ast::m_imm, ident: f.ident, expr: f.ex },
+        span: sp,
+    }
 }
 fn mk_fields(sp: span, fields: ~[{ident: ast::ident, ex: @ast::expr}]) ->
     ~[ast::field] {
diff --git a/src/libsyntax/ext/deriving.rs b/src/libsyntax/ext/deriving.rs
index 2148ad0cdb6..83d968bb2ac 100644
--- a/src/libsyntax/ext/deriving.rs
+++ b/src/libsyntax/ext/deriving.rs
@@ -136,7 +136,10 @@ fn create_eq_method(cx: ext_ctxt,
                                                      type_ident,
                                                      ty_params);
     let arg_region = @{ id: cx.next_id(), node: re_anon };
-    let arg_type = ty_rptr(arg_region, { ty: arg_path_type, mutbl: m_imm });
+    let arg_type = ty_rptr(
+        arg_region,
+        ast::mt { ty: arg_path_type, mutbl: m_imm }
+    );
     let arg_type = @{ id: cx.next_id(), node: move arg_type, span: span };
 
     // Create the `other` parameter.
diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs
index 29d27e53d68..19cbf833c0f 100644
--- a/src/libsyntax/ext/pipes/ast_builder.rs
+++ b/src/libsyntax/ext/pipes/ast_builder.rs
@@ -146,8 +146,10 @@ impl ext_ctxt: ext_ctxt_ast_builder {
     }
 
     fn field_imm(name: ident, e: @ast::expr) -> ast::field {
-        spanned { node: { mutbl: ast::m_imm, ident: name, expr: e },
-                  span: dummy_sp()}
+        spanned {
+            node: ast::field_ { mutbl: ast::m_imm, ident: name, expr: e },
+            span: dummy_sp(),
+        }
     }
 
     fn rec(+fields: ~[ast::field]) -> @ast::expr {
@@ -158,8 +160,13 @@ impl ext_ctxt: ext_ctxt_ast_builder {
     }
 
     fn ty_field_imm(name: ident, ty: @ast::Ty) -> ast::ty_field {
-        spanned { node: { ident: name, mt: { ty: ty, mutbl: ast::m_imm } },
-                  span: dummy_sp() }
+        spanned {
+            node: {
+                ident: name,
+                mt: ast::mt { ty: ty, mutbl: ast::m_imm },
+            },
+            span: dummy_sp(),
+        }
     }
 
     fn ty_rec(+fields: ~[ast::ty_field]) -> @ast::Ty {