]> git.lizzy.rs Git - rust.git/commitdiff
Remove type parameters from ExprField and ExprTupField
authorAdolfo Ochagavía <aochagavia92@gmail.com>
Sun, 23 Nov 2014 11:14:35 +0000 (12:14 +0100)
committerAdolfo Ochagavía <aochagavia92@gmail.com>
Sun, 23 Nov 2014 11:17:43 +0000 (12:17 +0100)
23 files changed:
src/librustc/lint/builtin.rs
src/librustc/middle/cfg/construct.rs
src/librustc/middle/const_eval.rs
src/librustc/middle/dead.rs
src/librustc/middle/expr_use_visitor.rs
src/librustc/middle/liveness.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/privacy.rs
src/librustc/middle/region.rs
src/librustc/middle/resolve.rs
src/librustc/middle/typeck/check/method/confirm.rs
src/librustc/middle/typeck/check/mod.rs
src/librustc_back/svh.rs
src/librustc_trans/save/mod.rs
src/librustc_trans/trans/consts.rs
src/librustc_trans/trans/debuginfo.rs
src/librustc_trans/trans/expr.rs
src/libsyntax/ast.rs
src/libsyntax/ext/build.rs
src/libsyntax/fold.rs
src/libsyntax/parse/parser.rs
src/libsyntax/print/pprust.rs
src/libsyntax/visit.rs

index 00c68f42c3249d4ba8168f3c0468906c6eeecb2b..9fe7a21243f186a8819045cc806353bbe5da856e 100644 (file)
 use util::nodemap::{FnvHashMap, NodeSet};
 use lint::{Context, LintPass, LintArray};
 
-use std::cmp;
+use std::{cmp, slice};
 use std::collections::hash_map::{Occupied, Vacant};
 use std::num::SignedInt;
-use std::slice;
 use std::{i8, i16, i32, i64, u8, u16, u32, u64, f32, f64};
-use syntax::abi;
-use syntax::ast_map;
-use syntax::ast_util::is_shift_binop;
-use syntax::attr::AttrMetaMethods;
-use syntax::attr;
+use syntax::{abi, ast, ast_map};
+use syntax::ast_util::{mod, is_shift_binop};
+use syntax::attr::{mod, AttrMetaMethods};
 use syntax::codemap::{Span, DUMMY_SP};
 use syntax::parse::token;
-use syntax::{ast, ast_util, visit};
 use syntax::ast::{TyI, TyU, TyI8, TyU8, TyI16, TyU16, TyI32, TyU32, TyI64, TyU64};
 use syntax::ptr::P;
-use syntax::visit::Visitor;
+use syntax::visit::{mod, Visitor};
 
 declare_lint!(WHILE_TRUE, Warn,
               "suggest using `loop { }` instead of `while true { }`")
@@ -1112,8 +1108,8 @@ fn contains_exterior_struct_lit(value: &ast::Expr) -> bool {
                 }
                 ast::ExprUnary(_, ref x) |
                 ast::ExprCast(ref x, _) |
-                ast::ExprField(ref x, _, _) |
-                ast::ExprTupField(ref x, _, _) |
+                ast::ExprField(ref x, _) |
+                ast::ExprTupField(ref x, _) |
                 ast::ExprIndex(ref x, _) => {
                     // &X { y: 1 }, X { y: 1 }.y
                     contains_exterior_struct_lit(&**x)
index 42e1ede147e04482c24b17c7b3450a0890d25ba6..61c56cf9ecc51f69af58dd58890367995a42c6c2 100644 (file)
@@ -475,8 +475,8 @@ fn expr(&mut self, expr: &ast::Expr, pred: CFGIndex) -> CFGIndex {
             ast::ExprCast(ref e, _) |
             ast::ExprUnary(_, ref e) |
             ast::ExprParen(ref e) |
-            ast::ExprField(ref e, _, _) |
-            ast::ExprTupField(ref e, _, _) => {
+            ast::ExprField(ref e, _) |
+            ast::ExprTupField(ref e, _) => {
                 self.straightline(expr, pred, Some(&**e).into_iter())
             }
 
index c7c67e8a67b6142b017c9c3995bfecdb50213295..98ac7e413ca7c63213e2a1c9aae7c7f035a03ad3 100644 (file)
 pub use self::constness::*;
 
 use metadata::csearch;
-use middle::astencode;
-use middle::def;
+use middle::{astencode, def};
 use middle::pat_util::def_to_path;
 use middle::ty::{mod, Ty};
-use middle::typeck::astconv;
-use middle::typeck::check;
-use util::nodemap::{DefIdMap};
+use middle::typeck::{astconv, check};
+use util::nodemap::DefIdMap;
 
 use syntax::ast::{mod, Expr};
 use syntax::parse::token::InternedString;
 use syntax::ptr::P;
-use syntax::visit::Visitor;
-use syntax::visit;
+use syntax::visit::{mod, Visitor};
 use syntax::{ast_map, ast_util, codemap};
 
 use std::rc::Rc;
@@ -234,9 +231,9 @@ fn classify(&mut self, e: &Expr) -> constness {
                 }
             }
 
-            ast::ExprField(ref base, _, _) => self.classify(&**base),
+            ast::ExprField(ref base, _) => self.classify(&**base),
 
-            ast::ExprTupField(ref base, _, _) => self.classify(&**base),
+            ast::ExprTupField(ref base, _) => self.classify(&**base),
 
             ast::ExprIndex(ref base, ref idx) =>
                 join(self.classify(&**base), self.classify(&**idx)),
index 62a5d23e3332cb839c69cc3b2daefe3022ca91ce..cf2e9a65859cd93a2c3839516c0b0f692c7c5554 100644 (file)
 // closely. The idea is that all reachable symbols are live, codes called
 // from live codes are live, and everything else is dead.
 
-use middle::def;
-use middle::pat_util;
-use middle::privacy;
-use middle::ty;
-use middle::typeck;
+use middle::{def, pat_util, privacy, ty, typeck};
 use lint;
 use util::nodemap::NodeSet;
 
 use std::collections::HashSet;
-use syntax::ast;
-use syntax::ast_map;
+use syntax::{ast, ast_map, codemap};
 use syntax::ast_util::{local_def, is_local, PostExpansionMethod};
 use syntax::attr::{mod, AttrMetaMethods};
-use syntax::codemap;
 use syntax::visit::{mod, Visitor};
 
 // Any local node that may call something in its body block should be
@@ -277,10 +271,10 @@ fn visit_expr(&mut self, expr: &ast::Expr) {
             ast::ExprMethodCall(..) => {
                 self.lookup_and_handle_method(expr.id, expr.span);
             }
-            ast::ExprField(ref lhs, ref ident, _) => {
+            ast::ExprField(ref lhs, ref ident) => {
                 self.handle_field_access(&**lhs, &ident.node);
             }
-            ast::ExprTupField(ref lhs, idx, _) => {
+            ast::ExprTupField(ref lhs, idx) => {
                 self.handle_tup_field_access(&**lhs, idx.node);
             }
             _ => ()
index 645a1aef3dc73b49acfc32db9f0e67b1b42effd9..fa0f59f68604918db8bcec542bebc63e4cb40792 100644 (file)
 pub use self::MoveReason::*;
 use self::OverloadedCallType::*;
 
+use middle::{def, region, pat_util};
 use middle::mem_categorization as mc;
-use middle::def;
 use middle::mem_categorization::Typer;
-use middle::region;
-use middle::pat_util;
 use middle::ty::{mod, Ty};
 use middle::typeck::{MethodCall, MethodObject, MethodTraitObject};
 use middle::typeck::{MethodOrigin, MethodParam, MethodTypeParam};
@@ -331,11 +329,11 @@ pub fn walk_expr(&mut self, expr: &ast::Expr) {
                 }
             }
 
-            ast::ExprField(ref base, _, _) => {         // base.f
+            ast::ExprField(ref base, _) => {         // base.f
                 self.select_from_expr(&**base);
             }
 
-            ast::ExprTupField(ref base, _, _) => {         // base.<n>
+            ast::ExprTupField(ref base, _) => {         // base.<n>
                 self.select_from_expr(&**base);
             }
 
index 7d13d2e5f9431733f5be8e900a6c3d3e7229c8a2..15d9e87a9d5a34678475a3ef7dd5c4de7ee78aeb 100644 (file)
 
 use middle::def::*;
 use middle::mem_categorization::Typer;
-use middle::pat_util;
-use middle::typeck;
-use middle::ty;
+use middle::{pat_util, typeck, ty};
 use lint;
 use util::nodemap::NodeMap;
 
-use std::fmt;
-use std::io;
+use std::{fmt, io, uint};
 use std::rc::Rc;
-use std::uint;
 use syntax::ast::{mod, NodeId, Expr};
 use syntax::codemap::{BytePos, original_sp, Span};
-use syntax::parse::token::special_idents;
-use syntax::parse::token;
+use syntax::parse::token::{mod, special_idents};
 use syntax::print::pprust::{expr_to_string, block_to_string};
 use syntax::ptr::P;
-use syntax::{visit, ast_util};
-use syntax::visit::{Visitor, FnKind};
+use syntax::ast_util;
+use syntax::visit::{mod, Visitor, FnKind};
 
 /// For use with `propagate_through_loop`.
 enum LoopKind<'a> {
@@ -967,11 +962,11 @@ fn propagate_through_expr(&mut self, expr: &Expr, succ: LiveNode)
               self.access_path(expr, succ, ACC_READ | ACC_USE)
           }
 
-          ast::ExprField(ref e, _, _) => {
+          ast::ExprField(ref e, _) => {
               self.propagate_through_expr(&**e, succ)
           }
 
-          ast::ExprTupField(ref e, _, _) => {
+          ast::ExprTupField(ref e, _) => {
               self.propagate_through_expr(&**e, succ)
           }
 
@@ -1295,8 +1290,8 @@ fn propagate_through_lvalue_components(&mut self,
 
         match expr.node {
             ast::ExprPath(_) => succ,
-            ast::ExprField(ref e, _, _) => self.propagate_through_expr(&**e, succ),
-            ast::ExprTupField(ref e, _, _) => self.propagate_through_expr(&**e, succ),
+            ast::ExprField(ref e, _) => self.propagate_through_expr(&**e, succ),
+            ast::ExprTupField(ref e, _) => self.propagate_through_expr(&**e, succ),
             _ => self.propagate_through_expr(expr, succ)
         }
     }
index 78b6c19874a9f53aed9c0f718eafd6f593e87a94..e9986e47e4a211d9494f5e57e35647a916ee0581 100644 (file)
@@ -477,7 +477,7 @@ pub fn cat_expr_unadjusted(&self, expr: &ast::Expr) -> McResult<cmt<'tcx>> {
             Ok(self.cat_deref(expr, base_cmt, 0, false))
           }
 
-          ast::ExprField(ref base, f_name, _) => {
+          ast::ExprField(ref base, f_name) => {
             let base_cmt = if_ok!(self.cat_expr(&**base));
             debug!("cat_expr(cat_field): id={} expr={} base={}",
                    expr.id,
@@ -486,7 +486,7 @@ pub fn cat_expr_unadjusted(&self, expr: &ast::Expr) -> McResult<cmt<'tcx>> {
             Ok(self.cat_field(expr, base_cmt, f_name.node.name, expr_ty))
           }
 
-          ast::ExprTupField(ref base, idx, _) => {
+          ast::ExprTupField(ref base, idx) => {
             let base_cmt = if_ok!(self.cat_expr(&**base));
             Ok(self.cat_tup_field(expr, base_cmt, idx.node, expr_ty))
           }
index c2835ba5647e8a91ab1c79b20c1c6d2164045899..66c782877f9cac248b4a81b6049a84030d21d94e 100644 (file)
 use std::mem::replace;
 
 use metadata::csearch;
-use middle::def;
-use middle::resolve;
+use middle::{def, resolve};
 use middle::ty::{mod, Ty};
 use middle::typeck::{MethodCall, MethodMap, MethodOrigin, MethodParam, MethodTypeParam};
 use middle::typeck::{MethodStatic, MethodStaticUnboxedClosure, MethodObject, MethodTraitObject};
 use util::nodemap::{NodeMap, NodeSet};
 
-use syntax::ast;
-use syntax::ast_map;
+use syntax::{ast, ast_map};
 use syntax::ast_util::{is_local, local_def, PostExpansionMethod};
 use syntax::codemap::Span;
 use syntax::parse::token;
-use syntax::visit;
-use syntax::visit::Visitor;
+use syntax::visit::{mod, Visitor};
 
 type Context<'a, 'tcx> = (&'a MethodMap<'tcx>, &'a resolve::ExportMap2);
 
@@ -836,20 +833,14 @@ fn visit_item(&mut self, item: &ast::Item) {
 
     fn visit_expr(&mut self, expr: &ast::Expr) {
         match expr.node {
-            ast::ExprField(ref base, ident, _) => {
-                match ty::expr_ty_adjusted(self.tcx, &**base).sty {
-                    ty::ty_struct(id, _) => {
-                        self.check_field(expr.span, id, NamedField(ident.node));
-                    }
-                    _ => {}
+            ast::ExprField(ref base, ident) => {
+                if let ty::ty_struct(id, _) = ty::expr_ty_adjusted(self.tcx, &**base).sty {
+                    self.check_field(expr.span, id, NamedField(ident.node));
                 }
             }
-            ast::ExprTupField(ref base, idx, _) => {
-                match ty::expr_ty_adjusted(self.tcx, &**base).sty {
-                    ty::ty_struct(id, _) => {
-                        self.check_field(expr.span, id, UnnamedField(idx.node));
-                    }
-                    _ => {}
+            ast::ExprTupField(ref base, idx) => {
+                if let ty::ty_struct(id, _) = ty::expr_ty_adjusted(self.tcx, &**base).sty {
+                    self.check_field(expr.span, id, UnnamedField(idx.node));
                 }
             }
             ast::ExprMethodCall(ident, _, _) => {
index 8a50cb4ed4e1b41601d2bf557fde1c689483771b..c5511f995bc689397e7d5e5c74e51f02e0ae58de 100644 (file)
@@ -22,8 +22,7 @@
 
 
 use session::Session;
-use middle::ty::{FreeRegion};
-use middle::ty::{mod, Ty};
+use middle::ty::{mod, Ty, FreeRegion};
 use util::nodemap::{FnvHashMap, FnvHashSet, NodeMap};
 use util::common::can_reach;
 
@@ -33,7 +32,6 @@
 use syntax::{ast, visit};
 use syntax::ast::{Block, Item, FnDecl, NodeId, Arm, Pat, Stmt, Expr, Local};
 use syntax::ast_util::{stmt_id};
-use syntax::ptr::P;
 use syntax::visit::{Visitor, FnKind};
 
 /// CodeExtent represents a statically-describable extent that can be
@@ -824,11 +822,10 @@ fn record_rvalue_scope<'a>(visitor: &mut RegionResolutionVisitor,
             match expr.node {
                 ast::ExprAddrOf(_, ref subexpr) |
                 ast::ExprUnary(ast::UnDeref, ref subexpr) |
-                ast::ExprField(ref subexpr, _, _) |
-                ast::ExprTupField(ref subexpr, _, _) |
+                ast::ExprField(ref subexpr, _) |
+                ast::ExprTupField(ref subexpr, _) |
                 ast::ExprIndex(ref subexpr, _) |
                 ast::ExprParen(ref subexpr) => {
-                    let subexpr: &'a P<Expr> = subexpr; // FIXME(#11586)
                     expr = &**subexpr;
                 }
                 _ => {
index 6ad3d67af0acd2cf79547ff035d28cf5f19cc66c..68a31c83ea4842dd3d65cbf760bdf9a1677df519 100644 (file)
 use syntax::ast::{ViewItemUse, ViewPathGlob, ViewPathList, ViewPathSimple};
 use syntax::ast::{Visibility};
 use syntax::ast;
-use syntax::ast_util::{PostExpansionMethod, local_def, walk_pat};
-use syntax::ast_util;
+use syntax::ast_util::{mod, PostExpansionMethod, local_def, walk_pat};
 use syntax::attr::AttrMetaMethods;
 use syntax::ext::mtwt;
-use syntax::parse::token::special_names;
-use syntax::parse::token::special_idents;
-use syntax::parse::token;
+use syntax::parse::token::{mod, special_names, special_idents};
 use syntax::codemap::{Span, DUMMY_SP, Pos};
 use syntax::owned_slice::OwnedSlice;
-use syntax::visit;
-use syntax::visit::Visitor;
+use syntax::visit::{mod, Visitor};
 
 use std::collections::{HashMap, HashSet};
 use std::collections::hash_map::{Occupied, Vacant};
@@ -5959,7 +5955,7 @@ fn resolve_expr(&mut self, expr: &Expr) {
 
     fn record_candidate_traits_for_expr_if_necessary(&mut self, expr: &Expr) {
         match expr.node {
-            ExprField(_, ident, _) => {
+            ExprField(_, ident) => {
                 // FIXME(#6890): Even though you can't treat a method like a
                 // field, we need to add any trait methods we find that match
                 // the field name so that we can do some nice error reporting
index c53befcc10d6b76a1541ac3f7f5f1826a5a0abfb..5bcd96e66efc2da544ba00a13ba8f09b09c858d9 100644 (file)
 
 use super::probe;
 
-use middle::subst;
-use middle::subst::Subst;
+use middle::subst::{mod, Subst};
 use middle::traits;
 use middle::ty::{mod, Ty};
-use middle::typeck::check;
-use middle::typeck::check::{FnCtxt, NoPreference, PreferMutLvalue};
+use middle::typeck::check::{mod, FnCtxt, NoPreference, PreferMutLvalue};
 use middle::typeck::{MethodCall, MethodCallee, MethodObject, MethodOrigin,
                      MethodParam, MethodStatic, MethodTraitObject, MethodTypeParam};
-use middle::typeck::infer;
-use middle::typeck::infer::InferCtxt;
+use middle::typeck::infer::{mod, InferCtxt};
 use middle::ty_fold::HigherRankedFoldable;
 use syntax::ast;
 use syntax::codemap::Span;
@@ -510,8 +507,8 @@ fn fixup_derefs_on_method_receiver_if_necessary(&self,
             let last = exprs[exprs.len() - 1];
             match last.node {
                 ast::ExprParen(ref expr) |
-                ast::ExprField(ref expr, _, _) |
-                ast::ExprTupField(ref expr, _, _) |
+                ast::ExprField(ref expr, _) |
+                ast::ExprTupField(ref expr, _) |
                 ast::ExprSlice(ref expr, _, _, _) |
                 ast::ExprIndex(ref expr, _) |
                 ast::ExprUnary(ast::UnDeref, ref expr) => exprs.push(&**expr),
index 85d2f573615b7029bc94cc83efe499793e2d2c39..d38c5bc0ca9cf0c737f9619fad63f411feff7e6e 100644 (file)
 use self::TupleArgumentsFlag::*;
 
 use session::Session;
-use middle::const_eval;
-use middle::def;
+use middle::{const_eval, def, traits};
 use middle::lang_items::IteratorItem;
-use middle::mem_categorization::McResult;
-use middle::mem_categorization;
-use middle::pat_util::pat_id_map;
-use middle::pat_util;
+use middle::mem_categorization::{mod, McResult};
+use middle::pat_util::{mod, pat_id_map};
 use middle::region::CodeExtent;
-use middle::subst;
-use middle::subst::{Subst, Substs, VecPerParamSpace, ParamSpace};
-use middle::traits;
-use middle::ty::{FnSig, VariantInfo};
-use middle::ty::{Polytype};
+use middle::subst::{mod, Subst, Substs, VecPerParamSpace, ParamSpace};
+use middle::ty::{FnSig, VariantInfo, Polytype};
 use middle::ty::{Disr, ParamTy, ParameterEnvironment};
 use middle::ty::{mod, Ty};
 use middle::ty::liberate_late_bound_regions;
 use middle::ty_fold::TypeFolder;
-use middle::typeck::astconv::AstConv;
-use middle::typeck::astconv::{ast_region_to_region, ast_ty_to_ty};
-use middle::typeck::astconv;
+use middle::typeck::astconv::{mod, ast_region_to_region, ast_ty_to_ty, AstConv};
 use middle::typeck::check::_match::pat_ctxt;
-use middle::typeck::CrateCtxt;
-use middle::typeck::infer;
 use middle::typeck::rscope::RegionScope;
-use middle::typeck::{lookup_def_ccx};
-use middle::typeck::no_params;
-use middle::typeck::{require_same_types};
-use middle::typeck::{MethodCall, MethodCallee, MethodMap, ObjectCastMap};
-use middle::typeck::{TypeAndSubsts};
-use middle::typeck;
+use middle::typeck::{mod, CrateCtxt, infer, lookup_def_ccx, no_params, require_same_types};
+use middle::typeck::{MethodCall, MethodCallee, MethodMap, ObjectCastMap, TypeAndSubsts};
 use middle::lang_items::TypeIdLangItem;
 use lint;
 use util::common::{block_query, indenter, loop_query};
-use util::ppaux;
-use util::ppaux::{UserString, Repr};
+use util::ppaux::{mod, UserString, Repr};
 use util::nodemap::{DefIdMap, FnvHashMap, NodeMap};
 
 use std::cell::{Cell, Ref, RefCell};
 use std::collections::hash_map::{Occupied, Vacant};
 use std::mem::replace;
 use std::rc::Rc;
-use syntax::abi;
-use syntax::ast::{ProvidedMethod, RequiredMethod, TypeTraitItem};
-use syntax::ast;
-use syntax::ast_util::{local_def, PostExpansionMethod};
-use syntax::ast_util;
-use syntax::attr;
-use syntax::codemap::Span;
-use syntax::codemap;
+use syntax::{mod, abi, attr};
+use syntax::ast::{mod, ProvidedMethod, RequiredMethod, TypeTraitItem};
+use syntax::ast_util::{mod, local_def, PostExpansionMethod};
+use syntax::codemap::{mod, Span};
 use syntax::owned_slice::OwnedSlice;
 use syntax::parse::token;
 use syntax::print::pprust;
 use syntax::ptr::P;
-use syntax::visit;
-use syntax::visit::Visitor;
-use syntax;
+use syntax::visit::{mod, Visitor};
 
 pub mod _match;
 pub mod vtable;
@@ -4405,10 +4384,10 @@ fn check_struct_fields_on_error(fcx: &FnCtxt,
 
         fcx.require_expr_have_sized_type(expr, traits::StructInitializerSized);
       }
-      ast::ExprField(ref base, ref field, _) => {
+      ast::ExprField(ref base, ref field) => {
         check_field(fcx, expr, lvalue_pref, &**base, field);
       }
-      ast::ExprTupField(ref base, idx, _) => {
+      ast::ExprTupField(ref base, idx) => {
         check_tup_field(fcx, expr, lvalue_pref, &**base, idx);
       }
       ast::ExprIndex(ref base, ref idx) => {
index cda8a1b1b5f17b25dcba108d0f78e5880828b78e..549d636e8cb564ac0ee977841f368e38faf2e7b9 100644 (file)
@@ -278,8 +278,8 @@ fn saw_expr<'a>(node: &'a Expr_) -> SawExprComponent<'a> {
             ExprBlock(..)            => SawExprBlock,
             ExprAssign(..)           => SawExprAssign,
             ExprAssignOp(op, _, _)   => SawExprAssignOp(op),
-            ExprField(_, id, _)      => SawExprField(content(id.node)),
-            ExprTupField(_, id, _)   => SawExprTupField(id.node),
+            ExprField(_, id)         => SawExprField(content(id.node)),
+            ExprTupField(_, id)      => SawExprTupField(id.node),
             ExprIndex(..)            => SawExprIndex,
             ExprSlice(..)            => SawExprSlice,
             ExprPath(..)             => SawExprPath,
index 67ed95f83fd37972acb4ef64cf8624da76d5317e..ec228c8aa15d1f62b6b2a87bf81c240d2f9a3a57 100644 (file)
 use driver::driver::CrateAnalysis;
 use session::Session;
 
-use middle::def;
+use middle::{def, typeck};
 use middle::ty::{mod, Ty};
-use middle::typeck;
 
 use std::cell::Cell;
-use std::io;
-use std::io::File;
-use std::io::fs;
+use std::io::{mod, File, fs};
 use std::os;
 
-use syntax::ast;
-use syntax::ast_util;
-use syntax::ast_util::PostExpansionMethod;
-use syntax::ast::{NodeId,DefId};
+use syntax::ast_util::{mod, PostExpansionMethod};
+use syntax::ast::{mod, NodeId, DefId};
 use syntax::ast_map::NodeItem;
 use syntax::attr;
 use syntax::codemap::*;
-use syntax::parse::token;
-use syntax::parse::token::{get_ident,keywords};
+use syntax::parse::token::{mod, get_ident, keywords};
 use syntax::owned_slice::OwnedSlice;
-use syntax::visit;
-use syntax::visit::Visitor;
+use syntax::visit::{mod, Visitor};
 use syntax::print::pprust::{path_to_string,ty_to_string};
 use syntax::ptr::P;
 
 use self::span_utils::SpanUtils;
-use self::recorder::Recorder;
-use self::recorder::FmtStrs;
+use self::recorder::{Recorder, FmtStrs};
 
 use util::ppaux;
 
@@ -1293,7 +1285,7 @@ fn visit_expr(&mut self, ex: &ast::Expr) {
             ast::ExprStruct(ref path, ref fields, ref base) =>
                 self.process_struct_lit(ex, path, fields, base),
             ast::ExprMethodCall(_, _, ref args) => self.process_method_call(ex, args),
-            ast::ExprField(ref sub_ex, ident, _) => {
+            ast::ExprField(ref sub_ex, ident) => {
                 if generated_code(sub_ex.span) {
                     return
                 }
@@ -1319,7 +1311,7 @@ fn visit_expr(&mut self, ex: &ast::Expr) {
                                             "Expected struct type, but not ty_struct"),
                 }
             },
-            ast::ExprTupField(ref sub_ex, idx, _) => {
+            ast::ExprTupField(ref sub_ex, idx) => {
                 if generated_code(sub_ex.span) {
                     return
                 }
index 4213e9417276c8ac447810b58bef2ffd9c774446..c7cdf93704949b59cd566c18f0b0caaea48d72fe 100644 (file)
 use llvm;
 use llvm::{ConstFCmp, ConstICmp, SetLinkage, PrivateLinkage, ValueRef, Bool, True, False};
 use llvm::{IntEQ, IntNE, IntUGT, IntUGE, IntULT, IntULE, IntSGT, IntSGE, IntSLT, IntSLE,
-    RealOEQ, RealOGT, RealOGE, RealOLT, RealOLE, RealONE};
+           RealOEQ, RealOGT, RealOGE, RealOLT, RealOLE, RealONE};
 use metadata::csearch;
-use middle::const_eval;
-use middle::def;
-use trans::adt;
-use trans::base;
-use trans::base::push_ctxt;
-use trans::closure;
+use middle::{const_eval, def};
+use trans::{adt, closure, consts, debuginfo, expr, inline, machine};
+use trans::base::{mod, push_ctxt};
 use trans::common::*;
-use trans::consts;
-use trans::expr;
-use trans::inline;
-use trans::machine;
 use trans::type_::Type;
 use trans::type_of;
-use trans::debuginfo;
 use middle::ty::{mod, Ty};
 use util::ppaux::{Repr, ty_to_string};
 
@@ -418,7 +410,7 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr) -> ValueRef {
               }
             }
           }
-          ast::ExprField(ref base, field, _) => {
+          ast::ExprField(ref base, field) => {
               let (bv, bt) = const_expr(cx, &**base);
               let brepr = adt::represent_type(cx, bt);
               expr::with_field_tys(cx.tcx(), bt, None, |discr, field_tys| {
@@ -426,7 +418,7 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr) -> ValueRef {
                   adt::const_get_field(cx, &*brepr, bv, discr, ix)
               })
           }
-          ast::ExprTupField(ref base, idx, _) => {
+          ast::ExprTupField(ref base, idx) => {
               let (bv, bt) = const_expr(cx, &**base);
               let brepr = adt::represent_type(cx, bt);
               expr::with_field_tys(cx.tcx(), bt, None, |discr, _| {
index 075b6b0dd6e04081c52c5b51233e9577c0daa74f..a3472e194cf588ee0c524b944f8a3c5f3e56d035 100644 (file)
@@ -197,13 +197,10 @@ struct List {
 use llvm::debuginfo::*;
 use metadata::csearch;
 use middle::subst::{mod, Subst, Substs};
-use trans::adt;
+use trans::{mod, adt, machine, type_of};
 use trans::common::*;
-use trans::machine;
 use trans::_match::{BindingInfo, TrByCopy, TrByMove, TrByRef};
-use trans::type_of;
 use trans::type_::Type;
-use trans;
 use middle::ty::{mod, Ty};
 use middle::pat_util;
 use session::config::{mod, FullDebugInfo, LimitedDebugInfo, NoDebugInfo};
@@ -219,8 +216,7 @@ struct List {
 use syntax::codemap::{Span, Pos};
 use syntax::{ast, codemap, ast_util, ast_map};
 use syntax::ast_util::PostExpansionMethod;
-use syntax::parse::token;
-use syntax::parse::token::special_idents;
+use syntax::parse::token::{mod, special_idents};
 
 static DW_LANG_RUST: c_uint = 0x9000;
 
@@ -3456,8 +3452,8 @@ fn walk_expr(cx: &CrateContext,
 
             ast::ExprCast(ref sub_exp, _)     |
             ast::ExprAddrOf(_, ref sub_exp)  |
-            ast::ExprField(ref sub_exp, _, _) |
-            ast::ExprTupField(ref sub_exp, _, _) |
+            ast::ExprField(ref sub_exp, _) |
+            ast::ExprTupField(ref sub_exp, _) |
             ast::ExprParen(ref sub_exp) =>
                 walk_expr(cx, &**sub_exp, scope_stack, scope_map),
 
index 670e893cc0e536e7997546ed3317c88b0c67a1af..9e004b137bbe8130d05d5caeaab248128d906539 100644 (file)
 use self::lazy_binop_ty::*;
 
 use back::abi;
-use llvm;
-use llvm::{ValueRef};
+use llvm::{mod, ValueRef};
 use middle::def;
 use middle::mem_categorization::Typer;
-use middle::subst;
-use middle::subst::Subst;
-use trans::_match;
-use trans::adt;
-use trans::asm;
+use middle::subst::{mod, Subst};
+use trans::{_match, adt, asm, base, callee, closure, consts, controlflow};
+use trans::{debuginfo, glue, machine, meth, inline, tvec, type_of};
 use trans::base::*;
-use trans::base;
 use trans::build::*;
-use trans::callee;
-use trans::cleanup;
-use trans::cleanup::CleanupMethods;
-use trans::closure;
+use trans::cleanup::{mod, CleanupMethods};
 use trans::common::*;
-use trans::consts;
-use trans::controlflow;
 use trans::datum::*;
-use trans::debuginfo;
-use trans::glue;
-use trans::machine;
-use trans::meth;
-use trans::inline;
-use trans::tvec;
-use trans::type_of;
-use middle::ty::{struct_fields, tup_fields};
-use middle::ty::{AdjustDerefRef, AdjustAddEnv, AutoUnsafe};
-use middle::ty::{AutoPtr};
-use middle::ty::{mod, Ty};
-use middle::typeck;
-use middle::typeck::MethodCall;
+use middle::ty::{mod, struct_fields, tup_fields};
+use middle::ty::{AdjustDerefRef, AdjustAddEnv, AutoUnsafe, AutoPtr, Ty};
+use middle::typeck::{mod, MethodCall};
 use util::common::indenter;
 use util::ppaux::Repr;
 use trans::machine::{llsize_of, llsize_of_alloc};
 use trans::type_::Type;
 
-use syntax::ast;
-use syntax::ast_util;
-use syntax::codemap;
+use syntax::{ast, ast_util, codemap};
 use syntax::print::pprust::{expr_to_string};
 use syntax::ptr::P;
 use std::rc::Rc;
@@ -599,10 +578,10 @@ fn trans_datum_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
         ast::ExprPath(_) => {
             trans_def(bcx, expr, bcx.def(expr.id))
         }
-        ast::ExprField(ref base, ident, _) => {
+        ast::ExprField(ref base, ident) => {
             trans_rec_field(bcx, &**base, ident.node)
         }
-        ast::ExprTupField(ref base, idx, _) => {
+        ast::ExprTupField(ref base, idx) => {
             trans_rec_tup_field(bcx, &**base, idx.node)
         }
         ast::ExprIndex(ref base, ref idx) => {
index 5d4fd2704a2e143fb9126500711008a4a5be2666..3d33774aa55e1d922f5dde98082affd89dc9ef3a 100644 (file)
@@ -673,8 +673,8 @@ pub enum Expr_ {
 
     ExprAssign(P<Expr>, P<Expr>),
     ExprAssignOp(BinOp, P<Expr>, P<Expr>),
-    ExprField(P<Expr>, SpannedIdent, Vec<P<Ty>>),
-    ExprTupField(P<Expr>, Spanned<uint>, Vec<P<Ty>>),
+    ExprField(P<Expr>, SpannedIdent),
+    ExprTupField(P<Expr>, Spanned<uint>),
     ExprIndex(P<Expr>, P<Expr>),
     ExprSlice(P<Expr>, Option<P<Expr>>, Option<P<Expr>>, Mutability),
 
index b18a0c8411cb8aabc5878bc42de5305b0a3c689d..2c7f9e889f8b2d4f4aaaeab233ea6a5409bc441e 100644 (file)
@@ -577,7 +577,7 @@ fn expr_field_access(&self, sp: Span, expr: P<ast::Expr>, ident: ast::Ident) ->
         };
 
         let id = Spanned { node: ident, span: field_span };
-        self.expr(sp, ast::ExprField(expr, id, Vec::new()))
+        self.expr(sp, ast::ExprField(expr, id))
     }
     fn expr_tup_field_access(&self, sp: Span, expr: P<ast::Expr>, idx: uint) -> P<ast::Expr> {
         let field_span = Span {
@@ -587,7 +587,7 @@ fn expr_tup_field_access(&self, sp: Span, expr: P<ast::Expr>, idx: uint) -> P<as
         };
 
         let id = Spanned { node: idx, span: field_span };
-        self.expr(sp, ast::ExprTupField(expr, id, Vec::new()))
+        self.expr(sp, ast::ExprTupField(expr, id))
     }
     fn expr_addr_of(&self, sp: Span, e: P<ast::Expr>) -> P<ast::Expr> {
         self.expr(sp, ast::ExprAddrOf(ast::MutImmutable, e))
index 1bdf9ea73df2fff4c5183b6decbc21fd4db210e0..6941c0e9c180053c4bc845603bcfc1c3d6b9c359 100644 (file)
@@ -1345,15 +1345,13 @@ pub fn noop_fold_expr<T: Folder>(Expr {id, node, span}: Expr, folder: &mut T) ->
                             folder.fold_expr(el),
                             folder.fold_expr(er))
             }
-            ExprField(el, ident, tys) => {
+            ExprField(el, ident) => {
                 ExprField(folder.fold_expr(el),
-                          respan(ident.span, folder.fold_ident(ident.node)),
-                          tys.move_map(|x| folder.fold_ty(x)))
+                          respan(ident.span, folder.fold_ident(ident.node)))
             }
-            ExprTupField(el, ident, tys) => {
+            ExprTupField(el, ident) => {
                 ExprTupField(folder.fold_expr(el),
-                             respan(ident.span, folder.fold_uint(ident.node)),
-                             tys.move_map(|x| folder.fold_ty(x)))
+                             respan(ident.span, folder.fold_uint(ident.node)))
             }
             ExprIndex(el, er) => {
                 ExprIndex(folder.fold_expr(el), folder.fold_expr(er))
index e4fa650882029578006312538b2024e0661cb575..a9306c71240ef14eaa972318f9ec7e9579eabcac 100644 (file)
 use parse;
 use parse::attr::ParserAttr;
 use parse::classify;
-use parse::common::{SeqSep, seq_sep_none};
-use parse::common::{seq_sep_trailing_allowed};
-use parse::lexer::Reader;
-use parse::lexer::TokenAndSpan;
+use parse::common::{SeqSep, seq_sep_none, seq_sep_trailing_allowed};
+use parse::lexer::{Reader, TokenAndSpan};
 use parse::obsolete::*;
-use parse::token::{MatchNt, SubstNt, InternedString};
+use parse::token::{mod, MatchNt, SubstNt, InternedString};
 use parse::token::{keywords, special_idents};
-use parse::token;
 use parse::{new_sub_parser_from_file, ParseSess};
 use print::pprust;
 use ptr::P;
@@ -86,7 +83,6 @@
 
 use std::collections::HashSet;
 use std::io::fs::PathExtensions;
-use std::mem::replace;
 use std::mem;
 use std::num::Float;
 use std::rc::Rc;
@@ -912,7 +908,7 @@ pub fn bump(&mut self) {
                 tok: token::Underscore,
                 sp: self.span,
             };
-            replace(&mut self.buffer[buffer_start], placeholder)
+            mem::replace(&mut self.buffer[buffer_start], placeholder)
         };
         self.span = next.sp;
         self.token = next.tok;
@@ -921,7 +917,7 @@ pub fn bump(&mut self) {
 
     /// Advance the parser by one token and return the bumped token.
     pub fn bump_and_get(&mut self) -> token::Token {
-        let old_token = replace(&mut self.token, token::Underscore);
+        let old_token = mem::replace(&mut self.token, token::Underscore);
         self.bump();
         old_token
     }
@@ -2100,14 +2096,12 @@ pub fn mk_slice(&mut self, expr: P<Expr>,
         ExprSlice(expr, start, end, mutbl)
     }
 
-    pub fn mk_field(&mut self, expr: P<Expr>, ident: ast::SpannedIdent,
-                    tys: Vec<P<Ty>>) -> ast::Expr_ {
-        ExprField(expr, ident, tys)
+    pub fn mk_field(&mut self, expr: P<Expr>, ident: ast::SpannedIdent) -> ast::Expr_ {
+        ExprField(expr, ident)
     }
 
-    pub fn mk_tup_field(&mut self, expr: P<Expr>, idx: codemap::Spanned<uint>,
-                    tys: Vec<P<Ty>>) -> ast::Expr_ {
-        ExprTupField(expr, idx, tys)
+    pub fn mk_tup_field(&mut self, expr: P<Expr>, idx: codemap::Spanned<uint>) -> ast::Expr_ {
+        ExprTupField(expr, idx)
     }
 
     pub fn mk_assign_op(&mut self, binop: ast::BinOp,
@@ -2462,7 +2456,7 @@ pub fn parse_dot_or_call_expr_with(&mut self, e0: P<Expr>) -> P<Expr> {
                             }
 
                             let id = spanned(dot, hi, i);
-                            let field = self.mk_field(e, id, tys);
+                            let field = self.mk_field(e, id);
                             e = self.mk_expr(lo, hi, field);
                         }
                     }
@@ -2481,7 +2475,7 @@ pub fn parse_dot_or_call_expr_with(&mut self, e0: P<Expr>) -> P<Expr> {
                     match index {
                         Some(n) => {
                             let id = spanned(dot, hi, n);
-                            let field = self.mk_tup_field(e, id, Vec::new());
+                            let field = self.mk_tup_field(e, id);
                             e = self.mk_expr(lo, hi, field);
                         }
                         None => {
index 4ce0d74bd37f4e965e83cf282c8856a8ddcf2671..2b80be0bf2a7f4d6f2afde007f9ede07c123cb13 100644 (file)
@@ -1734,29 +1734,15 @@ pub fn print_expr(&mut self, expr: &ast::Expr) -> IoResult<()> {
                 try!(self.word_space("="));
                 try!(self.print_expr(&**rhs));
             }
-            ast::ExprField(ref expr, id, ref tys) => {
+            ast::ExprField(ref expr, id) => {
                 try!(self.print_expr(&**expr));
                 try!(word(&mut self.s, "."));
                 try!(self.print_ident(id.node));
-                if tys.len() > 0u {
-                    try!(word(&mut self.s, "::<"));
-                    try!(self.commasep(
-                        Inconsistent, tys.as_slice(),
-                        |s, ty| s.print_type(&**ty)));
-                    try!(word(&mut self.s, ">"));
-                }
             }
-            ast::ExprTupField(ref expr, id, ref tys) => {
+            ast::ExprTupField(ref expr, id) => {
                 try!(self.print_expr(&**expr));
                 try!(word(&mut self.s, "."));
                 try!(self.print_uint(id.node));
-                if tys.len() > 0u {
-                    try!(word(&mut self.s, "::<"));
-                    try!(self.commasep(
-                        Inconsistent, tys.as_slice(),
-                        |s, ty| s.print_type(&**ty)));
-                    try!(word(&mut self.s, ">"));
-                }
             }
             ast::ExprIndex(ref expr, ref index) => {
                 try!(self.print_expr(&**expr));
index a0bdd7391130836ddf3a65b1b63cf8e493c2384c..3f87dbc0740ec6b648b31786c43a43a46c229725 100644 (file)
@@ -838,17 +838,11 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
             visitor.visit_expr(&**right_expression);
             visitor.visit_expr(&**left_expression)
         }
-        ExprField(ref subexpression, _, ref types) => {
+        ExprField(ref subexpression, _) => {
             visitor.visit_expr(&**subexpression);
-            for typ in types.iter() {
-                visitor.visit_ty(&**typ)
-            }
         }
-        ExprTupField(ref subexpression, _, ref types) => {
+        ExprTupField(ref subexpression, _) => {
             visitor.visit_expr(&**subexpression);
-            for typ in types.iter() {
-                visitor.visit_ty(&**typ)
-            }
         }
         ExprIndex(ref main_expression, ref index_expression) => {
             visitor.visit_expr(&**main_expression);