about summary refs log tree commit diff
path: root/src/libsyntax/ext/deriving
diff options
context:
space:
mode:
authorMarvin Löbel <loebel.marvin@gmail.com>2013-09-02 03:45:37 +0200
committerMarvin Löbel <loebel.marvin@gmail.com>2013-09-03 14:45:06 +0200
commit74190853373c7963d933e2fb5c2ac2f761fdbc02 (patch)
tree12ffa50679235aab28c7bf26799504d7ac8b8ac6 /src/libsyntax/ext/deriving
parent58decdd7a115f2892d63fa3760fa2125eb784ac8 (diff)
downloadrust-74190853373c7963d933e2fb5c2ac2f761fdbc02.tar.gz
rust-74190853373c7963d933e2fb5c2ac2f761fdbc02.zip
Modernized a few more types in syntax::ast
Diffstat (limited to 'src/libsyntax/ext/deriving')
-rw-r--r--src/libsyntax/ext/deriving/clone.rs4
-rw-r--r--src/libsyntax/ext/deriving/cmp/eq.rs6
-rw-r--r--src/libsyntax/ext/deriving/cmp/ord.rs12
-rw-r--r--src/libsyntax/ext/deriving/cmp/totaleq.rs4
-rw-r--r--src/libsyntax/ext/deriving/cmp/totalord.rs6
-rw-r--r--src/libsyntax/ext/deriving/decodable.rs6
-rw-r--r--src/libsyntax/ext/deriving/encodable.rs8
-rw-r--r--src/libsyntax/ext/deriving/generic.rs118
-rw-r--r--src/libsyntax/ext/deriving/iter_bytes.rs6
-rw-r--r--src/libsyntax/ext/deriving/rand.rs12
-rw-r--r--src/libsyntax/ext/deriving/to_str.rs8
-rw-r--r--src/libsyntax/ext/deriving/ty.rs10
-rw-r--r--src/libsyntax/ext/deriving/zero.rs4
13 files changed, 102 insertions, 102 deletions
diff --git a/src/libsyntax/ext/deriving/clone.rs b/src/libsyntax/ext/deriving/clone.rs
index 01cf61f45a4..9ef995b0d57 100644
--- a/src/libsyntax/ext/deriving/clone.rs
+++ b/src/libsyntax/ext/deriving/clone.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use ast::{MetaItem, item, expr};
+use ast::{MetaItem, item, Expr};
 use codemap::Span;
 use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
@@ -69,7 +69,7 @@ pub fn expand_deriving_deep_clone(cx: @ExtCtxt,
 fn cs_clone(
     name: &str,
     cx: @ExtCtxt, span: Span,
-    substr: &Substructure) -> @expr {
+    substr: &Substructure) -> @Expr {
     let clone_ident = substr.method_ident;
     let ctor_ident;
     let all_fields;
diff --git a/src/libsyntax/ext/deriving/cmp/eq.rs b/src/libsyntax/ext/deriving/cmp/eq.rs
index ce2b9ba7894..d147875d5e1 100644
--- a/src/libsyntax/ext/deriving/cmp/eq.rs
+++ b/src/libsyntax/ext/deriving/cmp/eq.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use ast::{MetaItem, item, expr};
+use ast::{MetaItem, item, Expr};
 use codemap::Span;
 use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
@@ -20,11 +20,11 @@ pub fn expand_deriving_eq(cx: @ExtCtxt,
                           in_items: ~[@item]) -> ~[@item] {
     // structures are equal if all fields are equal, and non equal, if
     // any fields are not equal or if the enum variants are different
-    fn cs_eq(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @expr {
+    fn cs_eq(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Expr {
         cs_and(|cx, span, _, _| cx.expr_bool(span, false),
                                  cx, span, substr)
     }
-    fn cs_ne(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @expr {
+    fn cs_ne(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Expr {
         cs_or(|cx, span, _, _| cx.expr_bool(span, true),
               cx, span, substr)
     }
diff --git a/src/libsyntax/ext/deriving/cmp/ord.rs b/src/libsyntax/ext/deriving/cmp/ord.rs
index 3f7492bb6b6..33f45d45bdb 100644
--- a/src/libsyntax/ext/deriving/cmp/ord.rs
+++ b/src/libsyntax/ext/deriving/cmp/ord.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 use ast;
-use ast::{MetaItem, item, expr};
+use ast::{MetaItem, item, Expr};
 use codemap::Span;
 use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
@@ -48,8 +48,8 @@ pub fn expand_deriving_ord(cx: @ExtCtxt,
 }
 
 /// Strict inequality.
-fn cs_op(less: bool, equal: bool, cx: @ExtCtxt, span: Span, substr: &Substructure) -> @expr {
-    let op = if less {ast::lt} else {ast::gt};
+fn cs_op(less: bool, equal: bool, cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Expr {
+    let op = if less {ast::BiLt} else {ast::BiGt};
     cs_fold(
         false, // need foldr,
         |cx, span, subexpr, self_f, other_fs| {
@@ -79,13 +79,13 @@ fn cs_op(less: bool, equal: bool, cx: @ExtCtxt, span: Span, substr: &Substructur
                                      cx.expr_deref(span, self_f),
                                      cx.expr_deref(span, other_f));
 
-            let not_cmp = cx.expr_unary(span, ast::not,
+            let not_cmp = cx.expr_unary(span, ast::UnNot,
                                         cx.expr_binary(span, op,
                                                        cx.expr_deref(span, other_f),
                                                        cx.expr_deref(span, self_f)));
 
-            let and = cx.expr_binary(span, ast::and, not_cmp, subexpr);
-            cx.expr_binary(span, ast::or, cmp, and)
+            let and = cx.expr_binary(span, ast::BiAnd, not_cmp, subexpr);
+            cx.expr_binary(span, ast::BiOr, cmp, and)
         },
         cx.expr_bool(span, equal),
         |cx, span, args, _| {
diff --git a/src/libsyntax/ext/deriving/cmp/totaleq.rs b/src/libsyntax/ext/deriving/cmp/totaleq.rs
index 97b7464b3b5..c6123451071 100644
--- a/src/libsyntax/ext/deriving/cmp/totaleq.rs
+++ b/src/libsyntax/ext/deriving/cmp/totaleq.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use ast::{MetaItem, item, expr};
+use ast::{MetaItem, item, Expr};
 use codemap::Span;
 use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
@@ -18,7 +18,7 @@ pub fn expand_deriving_totaleq(cx: @ExtCtxt,
                                span: Span,
                                mitem: @MetaItem,
                                in_items: ~[@item]) -> ~[@item] {
-    fn cs_equals(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @expr {
+    fn cs_equals(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Expr {
         cs_and(|cx, span, _, _| cx.expr_bool(span, false),
                cx, span, substr)
     }
diff --git a/src/libsyntax/ext/deriving/cmp/totalord.rs b/src/libsyntax/ext/deriving/cmp/totalord.rs
index 8f520ff6c33..34c6d1104da 100644
--- a/src/libsyntax/ext/deriving/cmp/totalord.rs
+++ b/src/libsyntax/ext/deriving/cmp/totalord.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 use ast;
-use ast::{MetaItem, item, expr};
+use ast::{MetaItem, item, Expr};
 use codemap::Span;
 use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
@@ -54,7 +54,7 @@ pub fn ordering_const(cx: @ExtCtxt, span: Span, cnst: Ordering) -> ast::Path {
 }
 
 pub fn cs_cmp(cx: @ExtCtxt, span: Span,
-              substr: &Substructure) -> @expr {
+              substr: &Substructure) -> @Expr {
     let test_id = cx.ident_of("__test");
     let equals_path = ordering_const(cx, span, Equal);
 
@@ -89,7 +89,7 @@ pub fn cs_cmp(cx: @ExtCtxt, span: Span,
 
             let assign = cx.stmt_let(span, false, test_id, new);
 
-            let cond = cx.expr_binary(span, ast::eq,
+            let cond = cx.expr_binary(span, ast::BiEq,
                                       cx.expr_ident(span, test_id),
                                       cx.expr_path(equals_path.clone()));
             let if_ = cx.expr_if(span,
diff --git a/src/libsyntax/ext/deriving/decodable.rs b/src/libsyntax/ext/deriving/decodable.rs
index 6a2cddb3583..66cd2d511a8 100644
--- a/src/libsyntax/ext/deriving/decodable.rs
+++ b/src/libsyntax/ext/deriving/decodable.rs
@@ -15,7 +15,7 @@ encodable.rs for more.
 
 use std::vec;
 
-use ast::{MetaItem, item, expr, m_mutbl};
+use ast::{MetaItem, item, Expr, MutMutable};
 use codemap::Span;
 use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
@@ -39,7 +39,7 @@ pub fn expand_deriving_decodable(cx: @ExtCtxt,
                 generics: LifetimeBounds::empty(),
                 explicit_self: None,
                 args: ~[Ptr(~Literal(Path::new_local("__D")),
-                            Borrowed(None, m_mutbl))],
+                            Borrowed(None, MutMutable))],
                 ret_ty: Self,
                 const_nonmatching: true,
                 combine_substructure: decodable_substructure,
@@ -51,7 +51,7 @@ pub fn expand_deriving_decodable(cx: @ExtCtxt,
 }
 
 fn decodable_substructure(cx: @ExtCtxt, span: Span,
-                          substr: &Substructure) -> @expr {
+                          substr: &Substructure) -> @Expr {
     let decoder = substr.nonself_args[0];
     let recurse = ~[cx.ident_of("extra"),
                     cx.ident_of("serialize"),
diff --git a/src/libsyntax/ext/deriving/encodable.rs b/src/libsyntax/ext/deriving/encodable.rs
index ee7863bc270..99b2359232c 100644
--- a/src/libsyntax/ext/deriving/encodable.rs
+++ b/src/libsyntax/ext/deriving/encodable.rs
@@ -75,7 +75,7 @@ would yield functions like:
     }
 */
 
-use ast::{MetaItem, item, expr, m_imm, m_mutbl};
+use ast::{MetaItem, item, Expr, MutImmutable, MutMutable};
 use codemap::Span;
 use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
@@ -97,9 +97,9 @@ pub fn expand_deriving_encodable(cx: @ExtCtxt,
             MethodDef {
                 name: "encode",
                 generics: LifetimeBounds::empty(),
-                explicit_self: Some(Some(Borrowed(None, m_imm))),
+                explicit_self: Some(Some(Borrowed(None, MutImmutable))),
                 args: ~[Ptr(~Literal(Path::new_local("__E")),
-                            Borrowed(None, m_mutbl))],
+                            Borrowed(None, MutMutable))],
                 ret_ty: nil_ty(),
                 const_nonmatching: true,
                 combine_substructure: encodable_substructure,
@@ -111,7 +111,7 @@ pub fn expand_deriving_encodable(cx: @ExtCtxt,
 }
 
 fn encodable_substructure(cx: @ExtCtxt, span: Span,
-                          substr: &Substructure) -> @expr {
+                          substr: &Substructure) -> @Expr {
     let encoder = substr.nonself_args[0];
     // throw an underscore in front to suppress unused variable warnings
     let blkarg = cx.ident_of("_e");
diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs
index eb05f87a8ce..7050cfbedb7 100644
--- a/src/libsyntax/ext/deriving/generic.rs
+++ b/src/libsyntax/ext/deriving/generic.rs
@@ -163,7 +163,7 @@ StaticEnum(<ast::enum_def of C>, ~[(<ident of C0>, Left(1)),
 */
 
 use ast;
-use ast::{enum_def, expr, Ident, Generics, struct_def};
+use ast::{enum_def, Expr, Ident, Generics, struct_def};
 
 use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
@@ -220,9 +220,9 @@ pub struct Substructure<'self> {
     /// ident of the method
     method_ident: Ident,
     /// dereferenced access to any Self or Ptr(Self, _) arguments
-    self_args: &'self [@expr],
+    self_args: &'self [@Expr],
     /// verbatim access to any other arguments
-    nonself_args: &'self [@expr],
+    nonself_args: &'self [@Expr],
     fields: &'self SubstructureFields<'self>
 }
 
@@ -234,21 +234,21 @@ pub enum SubstructureFields<'self> {
     ident is the ident of the current field (`None` for all fields in tuple
     structs).
     */
-    Struct(~[(Option<Ident>, @expr, ~[@expr])]),
+    Struct(~[(Option<Ident>, @Expr, ~[@Expr])]),
 
     /**
     Matching variants of the enum: variant index, ast::variant,
     fields: `(field ident, self, [others])`, where the field ident is
     only non-`None` in the case of a struct variant.
     */
-    EnumMatching(uint, &'self ast::variant, ~[(Option<Ident>, @expr, ~[@expr])]),
+    EnumMatching(uint, &'self ast::variant, ~[(Option<Ident>, @Expr, ~[@Expr])]),
 
     /**
     non-matching variants of the enum, [(variant index, ast::variant,
     [field ident, fields])] (i.e. all fields for self are in the
     first tuple, for other1 are in the second tuple, etc.)
     */
-    EnumNonMatching(&'self [(uint, ast::variant, ~[(Option<Ident>, @expr)])]),
+    EnumNonMatching(&'self [(uint, ast::variant, ~[(Option<Ident>, @Expr)])]),
 
     /// A static method where Self is a struct
     StaticStruct(&'self ast::struct_def, Either<uint, ~[Ident]>),
@@ -263,7 +263,7 @@ Combine the values of all the fields together. The last argument is
 all the fields of all the structures, see above for details.
 */
 pub type CombineSubstructureFunc<'self> =
-    &'self fn(@ExtCtxt, Span, &Substructure) -> @expr;
+    &'self fn(@ExtCtxt, Span, &Substructure) -> @Expr;
 
 /**
 Deal with non-matching enum variants, the arguments are a list
@@ -273,8 +273,8 @@ representing each variant: (variant index, ast::variant instance,
 pub type EnumNonMatchFunc<'self> =
     &'self fn(@ExtCtxt, Span,
               &[(uint, ast::variant,
-                 ~[(Option<Ident>, @expr)])],
-              &[@expr]) -> @expr;
+                 ~[(Option<Ident>, @Expr)])],
+              &[@Expr]) -> @Expr;
 
 
 impl<'self> TraitDef<'self> {
@@ -440,10 +440,10 @@ impl<'self> MethodDef<'self> {
                                 cx: @ExtCtxt,
                                 span: Span,
                                 type_ident: Ident,
-                                self_args: &[@expr],
-                                nonself_args: &[@expr],
+                                self_args: &[@Expr],
+                                nonself_args: &[@Expr],
                                 fields: &SubstructureFields)
-        -> @expr {
+        -> @Expr {
         let substructure = Substructure {
             type_ident: type_ident,
             method_ident: cx.ident_of(self.name),
@@ -466,7 +466,7 @@ impl<'self> MethodDef<'self> {
 
     fn split_self_nonself_args(&self, cx: @ExtCtxt, span: Span,
                              type_ident: Ident, generics: &Generics)
-        -> (ast::explicit_self, ~[@expr], ~[@expr], ~[(Ident, ast::Ty)]) {
+        -> (ast::explicit_self, ~[@Expr], ~[@Expr], ~[(Ident, ast::Ty)]) {
 
         let mut self_args = ~[];
         let mut nonself_args = ~[];
@@ -515,7 +515,7 @@ impl<'self> MethodDef<'self> {
                      generics: &Generics,
                      explicit_self: ast::explicit_self,
                      arg_types: ~[(Ident, ast::Ty)],
-                     body: @expr) -> @ast::method {
+                     body: @Expr) -> @ast::method {
         // create the generics that aren't for Self
         let fn_generics = self.generics.to_generics(cx, span, type_ident, generics);
 
@@ -572,9 +572,9 @@ impl<'self> MethodDef<'self> {
                                  span: Span,
                                  struct_def: &struct_def,
                                  type_ident: Ident,
-                                 self_args: &[@expr],
-                                 nonself_args: &[@expr])
-        -> @expr {
+                                 self_args: &[@Expr],
+                                 nonself_args: &[@Expr])
+        -> @Expr {
 
         let mut raw_fields = ~[]; // ~[[fields of self],
                                  // [fields of next Self arg], [etc]]
@@ -582,7 +582,7 @@ impl<'self> MethodDef<'self> {
         for i in range(0u, self_args.len()) {
             let (pat, ident_expr) = create_struct_pattern(cx, span,
                                                           type_ident, struct_def,
-                                                          fmt!("__self_%u", i), ast::m_imm);
+                                                          fmt!("__self_%u", i), ast::MutImmutable);
             patterns.push(pat);
             raw_fields.push(ident_expr);
         }
@@ -626,9 +626,9 @@ impl<'self> MethodDef<'self> {
                                         span: Span,
                                         struct_def: &struct_def,
                                         type_ident: Ident,
-                                        self_args: &[@expr],
-                                        nonself_args: &[@expr])
-        -> @expr {
+                                        self_args: &[@Expr],
+                                        nonself_args: &[@Expr])
+        -> @Expr {
         let summary = summarise_struct(cx, span, struct_def);
 
         self.call_substructure_method(cx, span,
@@ -668,9 +668,9 @@ impl<'self> MethodDef<'self> {
                                span: Span,
                                enum_def: &enum_def,
                                type_ident: Ident,
-                               self_args: &[@expr],
-                               nonself_args: &[@expr])
-        -> @expr {
+                               self_args: &[@Expr],
+                               nonself_args: &[@Expr])
+        -> @Expr {
         let mut matches = ~[];
         self.build_enum_match(cx, span, enum_def, type_ident,
                               self_args, nonself_args,
@@ -703,12 +703,12 @@ impl<'self> MethodDef<'self> {
                         cx: @ExtCtxt, span: Span,
                         enum_def: &enum_def,
                         type_ident: Ident,
-                        self_args: &[@expr],
-                        nonself_args: &[@expr],
+                        self_args: &[@Expr],
+                        nonself_args: &[@Expr],
                         matching: Option<uint>,
                         matches_so_far: &mut ~[(uint, ast::variant,
-                                              ~[(Option<Ident>, @expr)])],
-                        match_count: uint) -> @expr {
+                                              ~[(Option<Ident>, @Expr)])],
+                        match_count: uint) -> @Expr {
         if match_count == self_args.len() {
             // we've matched against all arguments, so make the final
             // expression at the bottom of the match tree
@@ -787,7 +787,7 @@ impl<'self> MethodDef<'self> {
                 let (pattern, idents) = create_enum_variant_pattern(cx, span,
                                                                     variant,
                                                                     current_match_str,
-                                                                    ast::m_imm);
+                                                                    ast::MutImmutable);
 
                 matches_so_far.push((index,
                                      /*bad*/ (*variant).clone(),
@@ -818,7 +818,7 @@ impl<'self> MethodDef<'self> {
                     let (pattern, idents) = create_enum_variant_pattern(cx, span,
                                                                        variant,
                                                                        current_match_str,
-                                                                       ast::m_imm);
+                                                                       ast::MutImmutable);
 
                     matches_so_far.push((index,
                                          /*bad*/ (*variant).clone(),
@@ -853,9 +853,9 @@ impl<'self> MethodDef<'self> {
                                span: Span,
                                enum_def: &enum_def,
                                type_ident: Ident,
-                               self_args: &[@expr],
-                               nonself_args: &[@expr])
-        -> @expr {
+                               self_args: &[@Expr],
+                               nonself_args: &[@Expr])
+        -> @Expr {
         let summary = do enum_def.variants.map |v| {
             let ident = v.node.name;
             let summary = match v.node.kind {
@@ -898,11 +898,11 @@ fn summarise_struct(cx: @ExtCtxt, span: Span,
 pub fn create_subpatterns(cx: @ExtCtxt,
                           span: Span,
                           field_paths: ~[ast::Path],
-                          mutbl: ast::mutability)
-                   -> ~[@ast::pat] {
+                          mutbl: ast::Mutability)
+                   -> ~[@ast::Pat] {
     do field_paths.map |path| {
         cx.pat(span,
-               ast::pat_ident(ast::bind_by_ref(mutbl), (*path).clone(), None))
+               ast::PatIdent(ast::BindByRef(mutbl), (*path).clone(), None))
     }
 }
 
@@ -916,12 +916,12 @@ fn create_struct_pattern(cx: @ExtCtxt,
                              struct_ident: Ident,
                              struct_def: &struct_def,
                              prefix: &str,
-                             mutbl: ast::mutability)
-    -> (@ast::pat, ~[(Option<Ident>, @expr)]) {
+                             mutbl: ast::Mutability)
+    -> (@ast::Pat, ~[(Option<Ident>, @Expr)]) {
     if struct_def.fields.is_empty() {
         return (
             cx.pat_ident_binding_mode(
-                span, struct_ident, ast::bind_infer),
+                span, struct_ident, ast::BindInfer),
             ~[]);
     }
 
@@ -961,7 +961,7 @@ fn create_struct_pattern(cx: @ExtCtxt,
         let field_pats = do vec::build |push| {
             for (&pat, &(id, _)) in subpats.iter().zip(ident_expr.iter()) {
                 // id is guaranteed to be Some
-                push(ast::field_pat { ident: id.unwrap(), pat: pat })
+                push(ast::FieldPat { ident: id.unwrap(), pat: pat })
             }
         };
         cx.pat_struct(span, matching_path, field_pats)
@@ -976,15 +976,15 @@ fn create_enum_variant_pattern(cx: @ExtCtxt,
                                    span: Span,
                                    variant: &ast::variant,
                                    prefix: &str,
-                                   mutbl: ast::mutability)
-    -> (@ast::pat, ~[(Option<Ident>, @expr)]) {
+                                   mutbl: ast::Mutability)
+    -> (@ast::Pat, ~[(Option<Ident>, @Expr)]) {
 
     let variant_ident = variant.node.name;
     match variant.node.kind {
         ast::tuple_variant_kind(ref variant_args) => {
             if variant_args.is_empty() {
                 return (cx.pat_ident_binding_mode(
-                    span, variant_ident, ast::bind_infer), ~[]);
+                    span, variant_ident, ast::BindInfer), ~[]);
             }
 
             let matching_path = cx.path_ident(span, variant_ident);
@@ -1023,13 +1023,13 @@ left-to-right (`true`) or right-to-left (`false`).
 */
 pub fn cs_fold(use_foldl: bool,
                f: &fn(@ExtCtxt, Span,
-                      old: @expr,
-                      self_f: @expr,
-                      other_fs: &[@expr]) -> @expr,
-               base: @expr,
+                      old: @Expr,
+                      self_f: @Expr,
+                      other_fs: &[@Expr]) -> @Expr,
+               base: @Expr,
                enum_nonmatch_f: EnumNonMatchFunc,
                cx: @ExtCtxt, span: Span,
-               substructure: &Substructure) -> @expr {
+               substructure: &Substructure) -> @Expr {
     match *substructure.fields {
         EnumMatching(_, _, ref all_fields) | Struct(ref all_fields) => {
             if use_foldl {
@@ -1064,10 +1064,10 @@ f(cx, span, ~[self_1.method(__arg_1_1, __arg_2_1),
 ~~~
 */
 #[inline]
-pub fn cs_same_method(f: &fn(@ExtCtxt, Span, ~[@expr]) -> @expr,
+pub fn cs_same_method(f: &fn(@ExtCtxt, Span, ~[@Expr]) -> @Expr,
                       enum_nonmatch_f: EnumNonMatchFunc,
                       cx: @ExtCtxt, span: Span,
-                      substructure: &Substructure) -> @expr {
+                      substructure: &Substructure) -> @Expr {
     match *substructure.fields {
         EnumMatching(_, _, ref all_fields) | Struct(ref all_fields) => {
             // call self_n.method(other_1_n, other_2_n, ...)
@@ -1097,11 +1097,11 @@ fields. `use_foldl` controls whether this is done left-to-right
 */
 #[inline]
 pub fn cs_same_method_fold(use_foldl: bool,
-                           f: &fn(@ExtCtxt, Span, @expr, @expr) -> @expr,
-                           base: @expr,
+                           f: &fn(@ExtCtxt, Span, @Expr, @Expr) -> @Expr,
+                           base: @Expr,
                            enum_nonmatch_f: EnumNonMatchFunc,
                            cx: @ExtCtxt, span: Span,
-                           substructure: &Substructure) -> @expr {
+                           substructure: &Substructure) -> @Expr {
     cs_same_method(
         |cx, span, vals| {
             if use_foldl {
@@ -1124,10 +1124,10 @@ Use a given binop to combine the result of calling the derived method
 on all the fields.
 */
 #[inline]
-pub fn cs_binop(binop: ast::binop, base: @expr,
+pub fn cs_binop(binop: ast::BinOp, base: @Expr,
                 enum_nonmatch_f: EnumNonMatchFunc,
                 cx: @ExtCtxt, span: Span,
-                substructure: &Substructure) -> @expr {
+                substructure: &Substructure) -> @Expr {
     cs_same_method_fold(
         true, // foldl is good enough
         |cx, span, old, new| {
@@ -1145,8 +1145,8 @@ pub fn cs_binop(binop: ast::binop, base: @expr,
 #[inline]
 pub fn cs_or(enum_nonmatch_f: EnumNonMatchFunc,
              cx: @ExtCtxt, span: Span,
-             substructure: &Substructure) -> @expr {
-    cs_binop(ast::or, cx.expr_bool(span, false),
+             substructure: &Substructure) -> @Expr {
+    cs_binop(ast::BiOr, cx.expr_bool(span, false),
              enum_nonmatch_f,
              cx, span, substructure)
 }
@@ -1154,8 +1154,8 @@ pub fn cs_or(enum_nonmatch_f: EnumNonMatchFunc,
 #[inline]
 pub fn cs_and(enum_nonmatch_f: EnumNonMatchFunc,
               cx: @ExtCtxt, span: Span,
-              substructure: &Substructure) -> @expr {
-    cs_binop(ast::and, cx.expr_bool(span, true),
+              substructure: &Substructure) -> @Expr {
+    cs_binop(ast::BiAnd, cx.expr_bool(span, true),
              enum_nonmatch_f,
              cx, span, substructure)
 }
diff --git a/src/libsyntax/ext/deriving/iter_bytes.rs b/src/libsyntax/ext/deriving/iter_bytes.rs
index 4dd628ca7b0..0f4e57b0889 100644
--- a/src/libsyntax/ext/deriving/iter_bytes.rs
+++ b/src/libsyntax/ext/deriving/iter_bytes.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use ast::{MetaItem, item, expr, and};
+use ast::{MetaItem, item, Expr, BiAnd};
 use codemap::Span;
 use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
@@ -42,7 +42,7 @@ pub fn expand_deriving_iter_bytes(cx: @ExtCtxt,
     trait_def.expand(cx, span, mitem, in_items)
 }
 
-fn iter_bytes_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @expr {
+fn iter_bytes_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Expr {
     let (lsb0, f)= match substr.nonself_args {
         [l, f] => (l, f),
         _ => cx.span_bug(span, "Incorrect number of arguments in `deriving(IterBytes)`")
@@ -90,6 +90,6 @@ fn iter_bytes_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @
     }
 
     do exprs.slice(1, exprs.len()).iter().fold(exprs[0]) |prev, me| {
-        cx.expr_binary(span, and, prev, *me)
+        cx.expr_binary(span, BiAnd, prev, *me)
     }
 }
diff --git a/src/libsyntax/ext/deriving/rand.rs b/src/libsyntax/ext/deriving/rand.rs
index b24c8eb84ab..8afd99e80af 100644
--- a/src/libsyntax/ext/deriving/rand.rs
+++ b/src/libsyntax/ext/deriving/rand.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 use ast;
-use ast::{MetaItem, item, expr, Ident};
+use ast::{MetaItem, item, Expr, Ident};
 use codemap::Span;
 use ext::base::ExtCtxt;
 use ext::build::{AstBuilder, Duplicate};
@@ -37,7 +37,7 @@ pub fn expand_deriving_rand(cx: @ExtCtxt,
                 explicit_self: None,
                 args: ~[
                     Ptr(~Literal(Path::new_local("R")),
-                        Borrowed(None, ast::m_mutbl))
+                        Borrowed(None, ast::MutMutable))
                 ],
                 ret_ty: Self,
                 const_nonmatching: false,
@@ -48,7 +48,7 @@ pub fn expand_deriving_rand(cx: @ExtCtxt,
     trait_def.expand(cx, span, mitem, in_items)
 }
 
-fn rand_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @expr {
+fn rand_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Expr {
     let rng = match substr.nonself_args {
         [rng] => ~[ rng ],
         _ => cx.bug("Incorrect number of arguments to `rand` in `deriving(Rand)`")
@@ -100,7 +100,7 @@ fn rand_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @expr {
             // rand() % variants.len()
             let value_ref = cx.expr_ident(span, value_ident);
             let rand_variant = cx.expr_binary(span,
-                                              ast::rem,
+                                              ast::BiRem,
                                               value_ref,
                                               variant_count);
 
@@ -115,7 +115,7 @@ fn rand_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @expr {
                                rand_thing(cx, span, ident, summary, || rand_call()))
                     }
                 }
-            }.collect::<~[ast::arm]>();
+            }.collect::<~[ast::Arm]>();
 
             // _ => {} at the end. Should never occur
             arms.push(cx.arm_unreachable(span));
@@ -131,7 +131,7 @@ fn rand_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @expr {
     fn rand_thing(cx: @ExtCtxt, span: Span,
                   ctor_ident: Ident,
                   summary: &Either<uint, ~[Ident]>,
-                  rand_call: &fn() -> @expr) -> @expr {
+                  rand_call: &fn() -> @Expr) -> @Expr {
         match *summary {
             Left(count) => {
                 if count == 0 {
diff --git a/src/libsyntax/ext/deriving/to_str.rs b/src/libsyntax/ext/deriving/to_str.rs
index eecce06f69f..fa13f78d0f9 100644
--- a/src/libsyntax/ext/deriving/to_str.rs
+++ b/src/libsyntax/ext/deriving/to_str.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 use ast;
-use ast::{MetaItem, item, expr};
+use ast::{MetaItem, item, Expr};
 use codemap::Span;
 use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
@@ -44,11 +44,11 @@ pub fn expand_deriving_to_str(cx: @ExtCtxt,
 // to_str() method on each field. Hence we mirror the logic of the log_str()
 // method, but with tweaks to call to_str() on sub-fields.
 fn to_str_substructure(cx: @ExtCtxt, span: Span,
-                       substr: &Substructure) -> @expr {
+                       substr: &Substructure) -> @Expr {
     let to_str = cx.ident_of("to_str");
 
     let doit = |start: &str, end: @str, name: ast::Ident,
-                fields: &[(Option<ast::Ident>, @expr, ~[@expr])]| {
+                fields: &[(Option<ast::Ident>, @Expr, ~[@Expr])]| {
         if fields.len() == 0 {
             cx.expr_str_uniq(span, cx.str_of(name))
         } else {
@@ -58,7 +58,7 @@ fn to_str_substructure(cx: @ExtCtxt, span: Span,
             let mut stmts = ~[cx.stmt_let(span, true, buf, init)];
             let push_str = cx.ident_of("push_str");
 
-            let push = |s: @expr| {
+            let push = |s: @Expr| {
                 let ebuf = cx.expr_ident(span, buf);
                 let call = cx.expr_method_call(span, ebuf, push_str, ~[s]);
                 stmts.push(cx.stmt_expr(call));
diff --git a/src/libsyntax/ext/deriving/ty.rs b/src/libsyntax/ext/deriving/ty.rs
index 6c1b8100f42..d6f5e2df5a4 100644
--- a/src/libsyntax/ext/deriving/ty.rs
+++ b/src/libsyntax/ext/deriving/ty.rs
@@ -14,7 +14,7 @@ explicit `Self` type to use when specifying impls to be derived.
 */
 
 use ast;
-use ast::{expr,Generics,Ident};
+use ast::{Expr,Generics,Ident};
 use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
 use codemap::{Span,respan};
@@ -23,8 +23,8 @@ use opt_vec;
 /// The types of pointers
 pub enum PtrTy<'self> {
     Send, // ~
-    Managed(ast::mutability), // @[mut]
-    Borrowed(Option<&'self str>, ast::mutability), // &['lifetime] [mut]
+    Managed(ast::Mutability), // @[mut]
+    Borrowed(Option<&'self str>, ast::Mutability), // &['lifetime] [mut]
 }
 
 /// A path, e.g. `::std::option::Option::<int>` (global). Has support
@@ -91,7 +91,7 @@ pub enum Ty<'self> {
 }
 
 pub fn borrowed_ptrty<'r>() -> PtrTy<'r> {
-    Borrowed(None, ast::m_imm)
+    Borrowed(None, ast::MutImmutable)
 }
 pub fn borrowed<'r>(ty: ~Ty<'r>) -> Ty<'r> {
     Ptr(ty, borrowed_ptrty())
@@ -236,7 +236,7 @@ impl<'self> LifetimeBounds<'self> {
 
 
 pub fn get_explicit_self(cx: @ExtCtxt, span: Span, self_ptr: &Option<PtrTy>)
-    -> (@expr, ast::explicit_self) {
+    -> (@Expr, ast::explicit_self) {
     let self_path = cx.expr_self(span);
     match *self_ptr {
         None => {
diff --git a/src/libsyntax/ext/deriving/zero.rs b/src/libsyntax/ext/deriving/zero.rs
index f9cd1b4b35b..fc527d44b53 100644
--- a/src/libsyntax/ext/deriving/zero.rs
+++ b/src/libsyntax/ext/deriving/zero.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use ast::{MetaItem, item, expr};
+use ast::{MetaItem, item, Expr};
 use codemap::Span;
 use ext::base::ExtCtxt;
 use ext::build::AstBuilder;
@@ -55,7 +55,7 @@ pub fn expand_deriving_zero(cx: @ExtCtxt,
     trait_def.expand(cx, span, mitem, in_items)
 }
 
-fn zero_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @expr {
+fn zero_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Expr {
     let zero_ident = ~[
         cx.ident_of("std"),
         cx.ident_of("num"),