]> git.lizzy.rs Git - rust.git/commitdiff
Rename AstBuilder::expr_int -> AstBuilder::expr_isize
authorManish Goregaokar <manishsmail@gmail.com>
Fri, 1 May 2015 10:22:38 +0000 (15:52 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Sat, 2 May 2015 08:27:58 +0000 (13:57 +0530)
src/libsyntax/ext/build.rs
src/libsyntax/ext/deriving/generic/mod.rs
src/test/auxiliary/custom_derive_plugin.rs
src/test/auxiliary/custom_derive_plugin_attr.rs

index cde16d25412e5c52f42051ac7f632ed687e7723b..354a0bff74998bbcc3c21d93f7d379d0db0f41d3 100644 (file)
@@ -146,7 +146,7 @@ fn expr_struct_ident(&self, span: Span, id: ast::Ident,
     fn expr_lit(&self, sp: Span, lit: ast::Lit_) -> P<ast::Expr>;
 
     fn expr_usize(&self, span: Span, i: usize) -> P<ast::Expr>;
-    fn expr_int(&self, sp: Span, i: isize) -> P<ast::Expr>;
+    fn expr_isize(&self, sp: Span, i: isize) -> P<ast::Expr>;
     fn expr_u8(&self, sp: Span, u: u8) -> P<ast::Expr>;
     fn expr_u32(&self, sp: Span, u: u32) -> P<ast::Expr>;
     fn expr_bool(&self, sp: Span, value: bool) -> P<ast::Expr>;
@@ -698,7 +698,7 @@ fn expr_lit(&self, sp: Span, lit: ast::Lit_) -> P<ast::Expr> {
     fn expr_usize(&self, span: Span, i: usize) -> P<ast::Expr> {
         self.expr_lit(span, ast::LitInt(i as u64, ast::UnsignedIntLit(ast::TyUs)))
     }
-    fn expr_int(&self, sp: Span, i: isize) -> P<ast::Expr> {
+    fn expr_isize(&self, sp: Span, i: isize) -> P<ast::Expr> {
         self.expr_lit(sp, ast::LitInt(i as u64, ast::SignedIntLit(ast::TyIs,
                                                                   ast::Sign::new(i))))
     }
index 22f62d9efa07d6c8f3e427088326fef1cafa96c6..339e535cdcd9f9de9b41b0aa25a29b31c591db48 100644 (file)
@@ -380,7 +380,7 @@ impl<'a> TraitDef<'a> {
     pub fn expand(&self,
                   cx: &mut ExtCtxt,
                   mitem: &ast::MetaItem,
-                  item: &'a     ast::Item,
+                  item: &'a ast::Item,
                   push: &mut FnMut(P<ast::Item>))
     {
         let newitem = match item.node {
@@ -1407,7 +1407,9 @@ fn create_struct_pattern(&self,
                              struct_def: &'a StructDef,
                              prefix: &str,
                              mutbl: ast::Mutability)
-                             -> (P<ast::Pat>, Vec<(Span, Option<Ident>, P<Expr>, &'a [ast::Attribute])>) {
+                             -> (P<ast::Pat>, Vec<(Span, Option<Ident>,
+                                                   P<Expr>,
+                                                   &'a [ast::Attribute])>) {
         if struct_def.fields.is_empty() {
             return (cx.pat_enum(self.span, struct_path, vec![]), vec![]);
         }
@@ -1445,7 +1447,8 @@ fn create_struct_pattern(&self,
         // struct_type is definitely not Unknown, since struct_def.fields
         // must be nonempty to reach here
         let pattern = if struct_type == Record {
-            let field_pats = subpats.into_iter().zip(ident_expr.iter()).map(|(pat, &(_, id, _, _))| {
+            let field_pats = subpats.into_iter().zip(ident_expr.iter())
+                                    .map(|(pat, &(_, id, _, _))| {
                 // id is guaranteed to be Some
                 codemap::Spanned {
                     span: pat.span,
index 17d3f6a46ef57162b10132a2810caec04f7a616b..78381395dc92c0963e3782082a24fc47469ecaab 100644 (file)
@@ -55,7 +55,7 @@ fn expand(cx: &mut ExtCtxt,
                 ret_ty: Literal(Path::new_local("isize")),
                 attributes: vec![],
                 combine_substructure: combine_substructure(box |cx, span, substr| {
-                    let zero = cx.expr_int(span, 0);
+                    let zero = cx.expr_isize(span, 0);
                     cs_fold(false,
                             |cx, span, subexpr, field, _| {
                                 cx.expr_binary(span, ast::BiAdd, subexpr,
index 631645ec0c0c744d09d90e4b0af4ab267f059efa..445aa743a77feb7f3f40fa5850ef42846feec4ad 100644 (file)
@@ -66,13 +66,14 @@ fn expand(cx: &mut ExtCtxt,
 
 // Mostly copied from syntax::ext::deriving::hash
 /// Defines how the implementation for `trace()` is to be generated
-fn totalsum_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) -> P<ast::Expr> {
+fn totalsum_substructure(cx: &mut ExtCtxt, trait_span: Span,
+                         substr: &Substructure) -> P<ast::Expr> {
     let fields = match *substr.fields {
         Struct(ref fs) | EnumMatching(_, _, ref fs) => fs,
         _ => cx.span_bug(trait_span, "impossible substructure")
     };
 
-    fields.iter().fold(cx.expr_int(trait_span, 0), |acc, ref item| {
+    fields.iter().fold(cx.expr_isize(trait_span, 0), |acc, ref item| {
         if item.attrs.iter().find(|a| a.check_name("ignore")).is_some() {
             acc
         } else {