]> git.lizzy.rs Git - rust.git/commitdiff
rustc: middle: remove obsolete ty::get.
authorEduard Burtescu <edy.burt@gmail.com>
Fri, 31 Oct 2014 08:51:16 +0000 (10:51 +0200)
committerEduard Burtescu <edy.burt@gmail.com>
Wed, 19 Nov 2014 04:24:35 +0000 (06:24 +0200)
65 files changed:
src/librustc/lint/builtin.rs
src/librustc/metadata/decoder.rs
src/librustc/metadata/tyencode.rs
src/librustc/middle/borrowck/gather_loans/gather_moves.rs
src/librustc/middle/borrowck/gather_loans/move_error.rs
src/librustc/middle/borrowck/mod.rs
src/librustc/middle/check_match.rs
src/librustc/middle/check_static.rs
src/librustc/middle/const_eval.rs
src/librustc/middle/dead.rs
src/librustc/middle/effect.rs
src/librustc/middle/expr_use_visitor.rs
src/librustc/middle/fast_reject.rs
src/librustc/middle/intrinsicck.rs
src/librustc/middle/liveness.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/privacy.rs
src/librustc/middle/subst.rs
src/librustc/middle/traits/coherence.rs
src/librustc/middle/traits/select.rs
src/librustc/middle/ty.rs
src/librustc/middle/ty_fold.rs
src/librustc/middle/typeck/astconv.rs
src/librustc/middle/typeck/check/_match.rs
src/librustc/middle/typeck/check/method/confirm.rs
src/librustc/middle/typeck/check/method/mod.rs
src/librustc/middle/typeck/check/method/probe.rs
src/librustc/middle/typeck/check/mod.rs
src/librustc/middle/typeck/check/regionck.rs
src/librustc/middle/typeck/check/regionmanip.rs
src/librustc/middle/typeck/check/vtable.rs
src/librustc/middle/typeck/check/wf.rs
src/librustc/middle/typeck/coherence/mod.rs
src/librustc/middle/typeck/coherence/orphan.rs
src/librustc/middle/typeck/collect.rs
src/librustc/middle/typeck/infer/coercion.rs
src/librustc/middle/typeck/infer/combine.rs
src/librustc/middle/typeck/infer/equate.rs
src/librustc/middle/typeck/infer/lattice.rs
src/librustc/middle/typeck/infer/mod.rs
src/librustc/middle/typeck/infer/resolve.rs
src/librustc/middle/typeck/infer/skolemize.rs
src/librustc/middle/typeck/infer/sub.rs
src/librustc/middle/typeck/infer/type_variable.rs
src/librustc/middle/typeck/mod.rs
src/librustc/middle/typeck/variance.rs
src/librustc_trans/save/mod.rs
src/librustc_trans/trans/_match.rs
src/librustc_trans/trans/adt.rs
src/librustc_trans/trans/base.rs
src/librustc_trans/trans/callee.rs
src/librustc_trans/trans/closure.rs
src/librustc_trans/trans/common.rs
src/librustc_trans/trans/consts.rs
src/librustc_trans/trans/datum.rs
src/librustc_trans/trans/debuginfo.rs
src/librustc_trans/trans/expr.rs
src/librustc_trans/trans/foreign.rs
src/librustc_trans/trans/glue.rs
src/librustc_trans/trans/intrinsic.rs
src/librustc_trans/trans/meth.rs
src/librustc_trans/trans/tvec.rs
src/librustc_trans/trans/type_of.rs
src/librustdoc/clean/inline.rs
src/librustdoc/clean/mod.rs

index e805868274ab2dd1d1ae7e92e820289b65c5907c..fce8627e226738b7b08e4e174a30b6e33f3b6d3d 100644 (file)
@@ -100,7 +100,7 @@ fn check_expr(&mut self, cx: &Context, e: &ast::Expr) {
         match e.node {
             ast::ExprCast(ref expr, ref ty) => {
                 let t_t = ast_ty_to_ty(cx, &infer::new_infer_ctxt(cx.tcx), &**ty);
-                if ty::get(ty::expr_ty(cx.tcx, &**expr)).sty == ty::get(t_t).sty {
+                if ty::expr_ty(cx.tcx, &**expr) == t_t {
                     cx.span_lint(UNUSED_TYPECASTS, ty.span, "unnecessary type cast");
                 }
             }
@@ -156,7 +156,7 @@ fn check_expr(&mut self, cx: &Context, e: &ast::Expr) {
                     },
                     _ => {
                         let t = ty::expr_ty(cx.tcx, &**expr);
-                        match ty::get(t).sty {
+                        match t.sty {
                             ty::ty_uint(_) => {
                                 cx.span_lint(UNSIGNED_NEGATION, e.span,
                                              "negation of unsigned int variable may \
@@ -181,7 +181,7 @@ fn check_expr(&mut self, cx: &Context, e: &ast::Expr) {
                 }
 
                 if is_shift_binop(binop) {
-                    let opt_ty_bits = match ty::get(ty::expr_ty(cx.tcx, &**l)).sty {
+                    let opt_ty_bits = match ty::expr_ty(cx.tcx, &**l).sty {
                         ty::ty_int(t) => Some(int_ty_bits(t, cx.sess().target.int_type)),
                         ty::ty_uint(t) => Some(uint_ty_bits(t, cx.sess().target.uint_type)),
                         _ => None
@@ -206,7 +206,7 @@ fn check_expr(&mut self, cx: &Context, e: &ast::Expr) {
                 }
             },
             ast::ExprLit(ref lit) => {
-                match ty::get(ty::expr_ty(cx.tcx, e)).sty {
+                match ty::expr_ty(cx.tcx, e).sty {
                     ty::ty_int(t) => {
                         match lit.node {
                             ast::LitInt(v, ast::SignedIntLit(_, ast::Plus)) |
@@ -344,7 +344,7 @@ fn check_limits(tcx: &ty::ctxt, binop: ast::BinOp,
             // Normalize the binop so that the literal is always on the RHS in
             // the comparison
             let norm_binop = if swap { rev_binop(binop) } else { binop };
-            match ty::get(ty::expr_ty(tcx, expr)).sty {
+            match ty::expr_ty(tcx, expr).sty {
                 ty::ty_int(int_ty) => {
                     let (min, max) = int_ty_range(int_ty);
                     let lit_val: i64 = match lit.node {
@@ -478,7 +478,7 @@ fn check_heap_type<'a, 'tcx>(&self, cx: &Context<'a, 'tcx>,
                                  span: Span, ty: Ty<'tcx>) {
         let mut n_uniq = 0i;
         ty::fold_ty(cx.tcx, ty, |t| {
-            match ty::get(t).sty {
+            match t.sty {
                 ty::ty_uniq(_) |
                 ty::ty_closure(box ty::ClosureTy {
                     store: ty::UniqTraitStore,
@@ -578,7 +578,7 @@ fn check_item(&mut self, cx: &Context, item: &ast::Item) {
         }
         let did = match item.node {
             ast::ItemImpl(..) => {
-                match ty::get(ty::node_id_to_type(cx.tcx, item.id)).sty {
+                match ty::node_id_to_type(cx.tcx, item.id).sty {
                     ty::ty_enum(did, _) => did,
                     ty::ty_struct(did, _) => did,
                     _ => return,
@@ -740,7 +740,7 @@ fn check_stmt(&mut self, cx: &Context, s: &ast::Stmt) {
 
         let t = ty::expr_ty(cx.tcx, expr);
         let mut warned = false;
-        match ty::get(t).sty {
+        match t.sty {
             ty::ty_tup(ref tys) if tys.is_empty() => return,
             ty::ty_bool => return,
             ty::ty_struct(did, _) |
index ffb847db1893302deba89a79907d64e0c323cc2a..209e78682b418b3c5f77207c58c975770ae5a361 100644 (file)
@@ -699,7 +699,7 @@ pub fn get_enum_variants<'tcx>(intr: Rc<IdentInterner>, cdata: Cmd, id: ast::Nod
         let ctor_ty = item_type(ast::DefId { krate: cdata.cnum, node: id},
                                 item, tcx, cdata);
         let name = item_name(&*intr, item);
-        let (ctor_ty, arg_tys) = match ty::get(ctor_ty).sty {
+        let (ctor_ty, arg_tys) = match ctor_ty.sty {
             ty::ty_bare_fn(ref f) =>
                 (Some(ctor_ty), f.sig.inputs.clone()),
             _ => // Nullary or struct enum variant.
index 2a445e17b203b6fc0b5d5caddbc904218fedf68c..ea778d07e1c9d2b75b07258640ec1a0ddc7c8572 100644 (file)
@@ -54,7 +54,7 @@ pub fn enc_ty<'a, 'tcx>(w: &mut SeekableMemWriter, cx: &ctxt<'a, 'tcx>, t: Ty<'t
         None => {}
     }
     let pos = w.tell().unwrap();
-    enc_sty(w, cx, &ty::get(t).sty);
+    enc_sty(w, cx, &t.sty);
     let end = w.tell().unwrap();
     let len = end - pos;
     fn estimate_sz(u: u64) -> u64 {
index 2ca42a42a0255c5b8ddf95616e143587c20124f3..4caea5ae423bd096d3f87a4829dd369ce129ac13 100644 (file)
@@ -146,7 +146,7 @@ fn check_and_get_illegal_move_origin<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
 
         mc::cat_downcast(ref b) |
         mc::cat_interior(ref b, _) => {
-            match ty::get(b.ty).sty {
+            match b.ty.sty {
                 ty::ty_struct(did, _) | ty::ty_enum(did, _) => {
                     if ty::has_dtor(bccx.tcx, did) {
                         Some(cmt.clone())
index a8440507949f41497d808a35b9ceb3a2b75de0bb..c7ffcc3ac1d1506078f4e30c7904fdc7127036a3 100644 (file)
@@ -126,7 +126,7 @@ fn report_cannot_move_out_of<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
 
         mc::cat_downcast(ref b) |
         mc::cat_interior(ref b, _) => {
-            match ty::get(b.ty).sty {
+            match b.ty.sty {
                 ty::ty_struct(did, _)
                 | ty::ty_enum(did, _) if ty::has_dtor(bccx.tcx, did) => {
                     bccx.span_err(
index dff70b92031a94c1d88a33cf9f65960903443f16..fbb0a87cf3f873a02cfc657975fb325642a549dc 100644 (file)
@@ -589,7 +589,7 @@ pub fn report_use_of_moved_value(&self,
         fn move_suggestion<'tcx>(tcx: &ty::ctxt<'tcx>, ty: Ty<'tcx>,
                                  default_msgs: (&'static str, &'static str))
                                  -> (&'static str, &'static str) {
-            match ty::get(ty).sty {
+            match ty.sty {
                 ty::ty_closure(box ty::ClosureTy {
                         store: ty::RegionTraitStore(..),
                         ..
index c161bf6b34877218535bf56f038fc890bee3348c..edc4e4ac7758b9b0060a4fb8b321e4f94b46b7b6 100644 (file)
@@ -406,7 +406,7 @@ fn construct_witness(cx: &MatchCheckCtxt, ctor: &Constructor,
                      pats: Vec<&Pat>, left_ty: Ty) -> P<Pat> {
     let pats_len = pats.len();
     let mut pats = pats.into_iter().map(|p| P((*p).clone()));
-    let pat = match ty::get(left_ty).sty {
+    let pat = match left_ty.sty {
         ty::ty_tup(_) => ast::PatTup(pats.collect()),
 
         ty::ty_enum(cid, _) | ty::ty_struct(cid, _)  => {
@@ -438,7 +438,7 @@ fn construct_witness(cx: &MatchCheckCtxt, ctor: &Constructor,
         }
 
         ty::ty_rptr(_, ty::mt { ty, .. }) => {
-            match ty::get(ty).sty {
+            match ty.sty {
                ty::ty_vec(_, Some(n)) => match ctor {
                     &Single => {
                         assert_eq!(pats_len, n);
@@ -498,11 +498,11 @@ fn missing_constructor(cx: &MatchCheckCtxt, &Matrix(ref rows): &Matrix,
 /// the column of patterns being analyzed.
 fn all_constructors(cx: &MatchCheckCtxt, left_ty: Ty,
                     max_slice_length: uint) -> Vec<Constructor> {
-    match ty::get(left_ty).sty {
+    match left_ty.sty {
         ty::ty_bool =>
             [true, false].iter().map(|b| ConstantValue(const_bool(*b))).collect(),
 
-        ty::ty_rptr(_, ty::mt { ty, .. }) => match ty::get(ty).sty {
+        ty::ty_rptr(_, ty::mt { ty, .. }) => match ty.sty {
             ty::ty_vec(_, None) =>
                 range_inclusive(0, max_slice_length).map(|length| Slice(length)).collect(),
             _ => vec!(Single)
@@ -671,7 +671,7 @@ fn pat_constructors(cx: &MatchCheckCtxt, p: &Pat,
         ast::PatRange(ref lo, ref hi) =>
             vec!(ConstantRange(eval_const_expr(cx.tcx, &**lo), eval_const_expr(cx.tcx, &**hi))),
         ast::PatVec(ref before, ref slice, ref after) =>
-            match ty::get(left_ty).sty {
+            match left_ty.sty {
                 ty::ty_vec(_, Some(_)) => vec!(Single),
                 _                      => if slice.is_some() {
                     range_inclusive(before.len() + after.len(), max_slice_length)
@@ -696,10 +696,10 @@ fn pat_constructors(cx: &MatchCheckCtxt, p: &Pat,
 /// For instance, a tuple pattern (_, 42u, Some([])) has the arity of 3.
 /// A struct pattern's arity is the number of fields it contains, etc.
 pub fn constructor_arity(cx: &MatchCheckCtxt, ctor: &Constructor, ty: Ty) -> uint {
-    match ty::get(ty).sty {
+    match ty.sty {
         ty::ty_tup(ref fs) => fs.len(),
         ty::ty_uniq(_) => 1u,
-        ty::ty_rptr(_, ty::mt { ty, .. }) => match ty::get(ty).sty {
+        ty::ty_rptr(_, ty::mt { ty, .. }) => match ty.sty {
             ty::ty_vec(_, None) => match *ctor {
                 Slice(length) => length,
                 ConstantValue(_) => 0u,
index dab6339ad533758a9eafb445fc818c4125305c31..afba72cea99a20de4b8ae118fe2a323dc244ed59 100644 (file)
@@ -162,7 +162,7 @@ fn visit_expr(&mut self, e: &ast::Expr) {
 
         let node_ty = ty::node_id_to_type(self.tcx, e.id);
 
-        match ty::get(node_ty).sty {
+        match node_ty.sty {
             ty::ty_struct(did, _) |
             ty::ty_enum(did, _) if ty::has_dtor(self.tcx, did) => {
                 self.tcx.sess.span_err(e.span,
index fe52e85142f9b6d003fbfeba0772ea01c80b13f9..c7c67e8a67b6142b017c9c3995bfecdb50213295 100644 (file)
@@ -524,7 +524,7 @@ macro_rules! define_casts(
                     $const_type:ident,
                     $target_ty:ty
                 )),*
-            }) => (match ty::get(ety).sty {
+            }) => (match ety.sty {
                 $($ty_pat => {
                     match $val {
                         const_bool(b) => Ok($const_type(b as $intermediate_ty as $target_ty)),
index 8186ebccdad41400b35ba155ea72cc26b46290cb..62a5d23e3332cb839c69cc3b2daefe3022ca91ce 100644 (file)
@@ -140,7 +140,7 @@ fn lookup_and_handle_method(&mut self, id: ast::NodeId,
     }
 
     fn handle_field_access(&mut self, lhs: &ast::Expr, name: &ast::Ident) {
-        match ty::get(ty::expr_ty_adjusted(self.tcx, lhs)).sty {
+        match ty::expr_ty_adjusted(self.tcx, lhs).sty {
             ty::ty_struct(id, _) => {
                 let fields = ty::lookup_struct_fields(self.tcx, id);
                 let field_id = fields.iter()
@@ -152,7 +152,7 @@ fn handle_field_access(&mut self, lhs: &ast::Expr, name: &ast::Ident) {
     }
 
     fn handle_tup_field_access(&mut self, lhs: &ast::Expr, idx: uint) {
-        match ty::get(ty::expr_ty_adjusted(self.tcx, lhs)).sty {
+        match ty::expr_ty_adjusted(self.tcx, lhs).sty {
             ty::ty_struct(id, _) => {
                 let fields = ty::lookup_struct_fields(self.tcx, id);
                 let field_id = fields[idx].id;
index 54dcc845fef375d99ec0deb3d93073e3409d0682..71885a769f580e452cc3a69fee7a86a25e98c42e 100644 (file)
@@ -31,7 +31,7 @@ enum UnsafeContext {
 }
 
 fn type_is_unsafe_function(ty: Ty) -> bool {
-    match ty::get(ty).sty {
+    match ty.sty {
         ty::ty_bare_fn(ref f) => f.fn_style == ast::UnsafeFn,
         ty::ty_closure(ref f) => f.fn_style == ast::UnsafeFn,
         _ => false,
@@ -70,8 +70,8 @@ fn check_str_index(&mut self, e: &ast::Expr) {
         };
         debug!("effect: checking index with base type {}",
                 ppaux::ty_to_string(self.tcx, base_type));
-        match ty::get(base_type).sty {
-            ty::ty_uniq(ty) | ty::ty_rptr(_, ty::mt{ty, ..}) => match ty::get(ty).sty {
+        match base_type.sty {
+            ty::ty_uniq(ty) | ty::ty_rptr(_, ty::mt{ty, ..}) => match ty.sty {
                 ty::ty_str => {
                     span_err!(self.tcx.sess, e.span, E0134,
                               "modification of string types is not allowed");
@@ -166,7 +166,7 @@ fn visit_expr(&mut self, expr: &ast::Expr) {
                 let base_type = ty::node_id_to_type(self.tcx, base.id);
                 debug!("effect: unary case, base type is {}",
                         ppaux::ty_to_string(self.tcx, base_type));
-                match ty::get(base_type).sty {
+                match base_type.sty {
                     ty::ty_ptr(_) => {
                         self.require_unsafe(expr.span,
                                             "dereference of unsafe pointer")
index e86fb18259c79dac36abe6cc15d29acfc804a182..f4c22c571639001b2dd89b338202d6d9e49bef59 100644 (file)
@@ -519,7 +519,7 @@ fn walk_callee(&mut self, call: &ast::Expr, callee: &ast::Expr) {
         let callee_ty = ty::expr_ty_adjusted(self.tcx(), callee);
         debug!("walk_callee: callee={} callee_ty={}",
                callee.repr(self.tcx()), callee_ty.repr(self.tcx()));
-        match ty::get(callee_ty).sty {
+        match callee_ty.sty {
             ty::ty_bare_fn(..) => {
                 self.consume_expr(callee);
             }
@@ -656,7 +656,7 @@ fn walk_struct_expr(&mut self,
 
         // Select just those fields of the `with`
         // expression that will actually be used
-        let with_fields = match ty::get(with_cmt.ty).sty {
+        let with_fields = match with_cmt.ty.sty {
             ty::ty_struct(did, ref substs) => {
                 ty::struct_fields(self.tcx(), did, substs)
             }
@@ -745,7 +745,7 @@ fn walk_autoderefs(&mut self,
                 Some(method_ty) => {
                     let cmt = return_if_err!(self.mc.cat_expr_autoderefd(expr, i));
                     let self_ty = ty::ty_fn_args(method_ty)[0];
-                    let (m, r) = match ty::get(self_ty).sty {
+                    let (m, r) = match self_ty.sty {
                         ty::ty_rptr(r, ref m) => (m.mutbl, r),
                         _ => self.tcx().sess.span_bug(expr.span,
                                 format!("bad overloaded deref type {}",
index 2f451bfa4e0081ebb08ea97284ed02e7f0cf04be..7514a63c7fa58f5bfd1186da8c6fde92e521eed0 100644 (file)
@@ -53,7 +53,7 @@ pub fn simplify_type(tcx: &ty::ctxt,
      * are to be considered bound.
      */
 
-    match ty::get(ty).sty {
+    match ty.sty {
         ty::ty_bool => Some(BoolSimplifiedType),
         ty::ty_char => Some(CharSimplifiedType),
         ty::ty_int(int_type) => Some(IntSimplifiedType(int_type)),
index 1880a8fce8426ff91268c6d142d16d8e80ede27e..68d0ac932164a4272b55cd302cb3a43e378e207c 100644 (file)
@@ -27,7 +27,7 @@ fn type_size_is_affected_by_type_parameters<'tcx>(tcx: &ty::ctxt<'tcx>, typ: Ty<
                                                   -> bool {
     let mut result = false;
     ty::maybe_walk_ty(typ, |typ| {
-        match ty::get(typ).sty {
+        match typ.sty {
             ty::ty_uniq(_) | ty::ty_ptr(_) | ty::ty_rptr(..) |
             ty::ty_bare_fn(..) | ty::ty_closure(..) => {
                 false
@@ -73,7 +73,7 @@ struct IntrinsicCheckingVisitor<'a, 'tcx: 'a> {
 
 impl<'a, 'tcx> IntrinsicCheckingVisitor<'a, 'tcx> {
     fn def_id_is_transmute(&self, def_id: DefId) -> bool {
-        let intrinsic = match ty::get(ty::lookup_item_type(self.tcx, def_id).ty).sty {
+        let intrinsic = match ty::lookup_item_type(self.tcx, def_id).ty.sty {
             ty::ty_bare_fn(ref bfty) => bfty.abi == RustIntrinsic,
             _ => return false
         };
@@ -123,7 +123,7 @@ fn visit_expr(&mut self, expr: &ast::Expr) {
                 match ty::resolve_expr(self.tcx, expr) {
                     DefFn(did, _) if self.def_id_is_transmute(did) => {
                         let typ = ty::node_id_to_type(self.tcx, expr.id);
-                        match ty::get(typ).sty {
+                        match typ.sty {
                             ty_bare_fn(ref bare_fn_ty)
                                     if bare_fn_ty.abi == RustIntrinsic => {
                                 if let ty::FnConverging(to) = bare_fn_ty.sig.output {
index 320cdae826ccb21d4507010d952a01564815eafc..82edfdf146eaefa70de2e0fb45ad1dc1d831fd44 100644 (file)
@@ -1520,7 +1520,7 @@ fn check_fn(_v: &Liveness,
 impl<'a, 'tcx> Liveness<'a, 'tcx> {
     fn fn_ret(&self, id: NodeId) -> ty::FnOutput<'tcx> {
         let fn_ty = ty::node_id_to_type(self.ir.tcx, id);
-        match ty::get(fn_ty).sty {
+        match fn_ty.sty {
             ty::ty_unboxed_closure(closure_def_id, _, _) =>
                 self.ir.tcx.unboxed_closures()
                     .borrow()
@@ -1550,8 +1550,7 @@ fn check_ret(&self,
                         None if body.stmts.len() > 0 =>
                             match body.stmts.last().unwrap().node {
                                 ast::StmtSemi(ref e, _) => {
-                                    let t_stmt = ty::expr_ty(self.ir.tcx, &**e);
-                                    ty::get(t_stmt).sty == ty::get(t_ret).sty
+                                    ty::expr_ty(self.ir.tcx, &**e) == t_ret
                                 },
                                 _ => false
                             },
index cf1e58d17c78864e21c3baf3415afc4b232f11c7..93c2e8f0d9933e9bc557a56eefec09737cf65d35 100644 (file)
@@ -197,7 +197,7 @@ pub enum deref_kind {
 // derefable (we model an index as the combination of a deref and then a
 // pointer adjustment).
 pub fn opt_deref_kind(t: Ty) -> Option<deref_kind> {
-    match ty::get(t).sty {
+    match t.sty {
         ty::ty_uniq(_) |
         ty::ty_closure(box ty::ClosureTy {store: ty::UniqTraitStore, ..}) => {
             Some(deref_ptr(OwnedPtr))
@@ -585,7 +585,7 @@ pub fn cat_def(&self,
 
           def::DefUpvar(var_id, fn_node_id, _) => {
               let ty = if_ok!(self.node_ty(fn_node_id));
-              match ty::get(ty).sty {
+              match ty.sty {
                   ty::ty_closure(ref closure_ty) => {
                       // Translate old closure type info into unboxed
                       // closure kind/capture mode
@@ -808,7 +808,7 @@ pub fn cat_rvalue_node(&self,
                            -> cmt<'tcx> {
         match self.typer.temporary_scope(id) {
             Some(scope) => {
-                match ty::get(expr_ty).sty {
+                match expr_ty.sty {
                     ty::ty_vec(_, Some(0)) => self.cat_rvalue(id, span, ty::ReStatic, expr_ty),
                     _ => self.cat_rvalue(id, span, ty::ReScope(scope), expr_ty)
                 }
@@ -1069,8 +1069,8 @@ fn vec_slice_info(tcx: &ty::ctxt,
              * to recurse through rptrs.
              */
 
-            match ty::get(slice_ty).sty {
-                ty::ty_rptr(r, ref mt) => match ty::get(mt.ty).sty {
+            match slice_ty.sty {
+                ty::ty_rptr(r, ref mt) => match mt.ty.sty {
                     ty::ty_vec(_, None) => (mt.mutbl, r),
                     _ => vec_slice_info(tcx, pat, mt.ty),
                 },
@@ -1533,9 +1533,9 @@ fn repr(&self, _tcx: &ty::ctxt) -> String {
 }
 
 fn element_kind(t: Ty) -> ElementKind {
-    match ty::get(t).sty {
+    match t.sty {
         ty::ty_rptr(_, ty::mt{ty, ..}) |
-        ty::ty_uniq(ty) => match ty::get(ty).sty {
+        ty::ty_uniq(ty) => match ty.sty {
             ty::ty_vec(_, None) => VecElement,
             _ => OtherElement
         },
index c334d98daadea5f81fe29eac6ae6905d2f5a5df3..c2835ba5647e8a91ab1c79b20c1c6d2164045899 100644 (file)
@@ -667,7 +667,7 @@ fn check_field(&mut self,
         }
 
         let struct_type = ty::lookup_item_type(self.tcx, id).ty;
-        let struct_desc = match ty::get(struct_type).sty {
+        let struct_desc = match struct_type.sty {
             ty::ty_struct(_, _) =>
                 format!("struct `{}`", ty::item_path_str(self.tcx, id)),
             // struct variant fields have inherited visibility
@@ -837,7 +837,7 @@ 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::get(ty::expr_ty_adjusted(self.tcx, &**base)).sty {
+                match ty::expr_ty_adjusted(self.tcx, &**base).sty {
                     ty::ty_struct(id, _) => {
                         self.check_field(expr.span, id, NamedField(ident.node));
                     }
@@ -845,7 +845,7 @@ fn visit_expr(&mut self, expr: &ast::Expr) {
                 }
             }
             ast::ExprTupField(ref base, idx, _) => {
-                match ty::get(ty::expr_ty_adjusted(self.tcx, &**base)).sty {
+                match ty::expr_ty_adjusted(self.tcx, &**base).sty {
                     ty::ty_struct(id, _) => {
                         self.check_field(expr.span, id, UnnamedField(idx.node));
                     }
@@ -867,7 +867,7 @@ fn visit_expr(&mut self, expr: &ast::Expr) {
                 }
             }
             ast::ExprStruct(_, ref fields, _) => {
-                match ty::get(ty::expr_ty(self.tcx, expr)).sty {
+                match ty::expr_ty(self.tcx, expr).sty {
                     ty::ty_struct(id, _) => {
                         for field in (*fields).iter() {
                             self.check_field(expr.span, id,
@@ -976,7 +976,7 @@ fn visit_pat(&mut self, pattern: &ast::Pat) {
 
         match pattern.node {
             ast::PatStruct(_, ref fields, _) => {
-                match ty::get(ty::pat_ty(self.tcx, pattern)).sty {
+                match ty::pat_ty(self.tcx, pattern).sty {
                     ty::ty_struct(id, _) => {
                         for field in fields.iter() {
                             self.check_field(pattern.span, id,
@@ -1007,7 +1007,7 @@ struct type?!"),
             // Patterns which bind no fields are allowable (the path is check
             // elsewhere).
             ast::PatEnum(_, Some(ref fields)) => {
-                match ty::get(ty::pat_ty(self.tcx, pattern)).sty {
+                match ty::pat_ty(self.tcx, pattern).sty {
                     ty::ty_struct(id, _) => {
                         for (i, field) in fields.iter().enumerate() {
                             match field.node {
index acfce00b360bacc42d21bee6a8fba6ee57fd428b..bac417c8218a4383ab0f0bce396c3119bb6d5af9 100644 (file)
@@ -641,7 +641,7 @@ fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
         }
         self.ty_stack_depth += 1;
 
-        let t1 = match ty::get(t).sty {
+        let t1 = match t.sty {
             ty::ty_param(p) => {
                 self.ty_for_param(p, t)
             }
index ebd7c68877347f2748218e0fc7bb663cc6cc8e9a..c84a2a0d11e6b3b01a3c20a67899e21cb945ee39 100644 (file)
@@ -79,7 +79,7 @@ pub fn impl_is_local(tcx: &ty::ctxt,
 pub fn ty_is_local<'tcx>(tcx: &ty::ctxt<'tcx>, ty: Ty<'tcx>) -> bool {
     debug!("ty_is_local({})", ty.repr(tcx));
 
-    match ty::get(ty).sty {
+    match ty.sty {
         ty::ty_bool |
         ty::ty_char |
         ty::ty_int(..) |
index 217830bcb4e63b22dbaafc39a9374632fff5872a..b884cb535d7a5de9488ac78b33eb4ca2be92fc6e 100644 (file)
@@ -1030,7 +1030,7 @@ fn assemble_unboxed_candidates(&mut self,
         };
 
         let self_ty = self.infcx.shallow_resolve(obligation.self_ty());
-        let (closure_def_id, substs) = match ty::get(self_ty).sty {
+        let (closure_def_id, substs) = match self_ty.sty {
             ty::ty_unboxed_closure(id, _, ref substs) => (id, substs.clone()),
             ty::ty_infer(ty::TyVar(_)) => {
                 candidates.ambiguous = true;
@@ -1233,7 +1233,7 @@ fn builtin_bound(&mut self,
                      -> Result<BuiltinBoundConditions<'tcx>,SelectionError<'tcx>>
     {
         let self_ty = self.infcx.shallow_resolve(self_ty);
-        return match ty::get(self_ty).sty {
+        return match self_ty.sty {
             ty::ty_infer(ty::IntVar(_)) |
             ty::ty_infer(ty::FloatVar(_)) |
             ty::ty_uint(_) |
index eb94b57f52ca4082f76b2e04cd65d4716789bb0c..eb1fe227084c51bf0ad143527a9a8a99b423c9a3 100644 (file)
@@ -653,28 +653,21 @@ fn borrow_from<'a>(ty: &'a InternedTy<'tcx>) -> &'a sty<'tcx> {
     }
 }
 
-pub fn get<'tcx>(ty: Ty<'tcx>) -> Ty<'tcx> {
-    ty
-}
-
-pub fn tbox_has_flag(tb: &TyS, flag: TypeFlags) -> bool {
-    tb.flags.intersects(flag)
-}
 pub fn type_has_params(ty: Ty) -> bool {
-    tbox_has_flag(get(ty), HAS_PARAMS)
+    ty.flags.intersects(HAS_PARAMS)
 }
 pub fn type_has_self(ty: Ty) -> bool {
-    tbox_has_flag(get(ty), HAS_SELF)
+    ty.flags.intersects(HAS_SELF)
 }
 pub fn type_has_ty_infer(ty: Ty) -> bool {
-    tbox_has_flag(get(ty), HAS_TY_INFER)
+    ty.flags.intersects(HAS_TY_INFER)
 }
 pub fn type_needs_infer(ty: Ty) -> bool {
-    tbox_has_flag(get(ty), HAS_TY_INFER | HAS_RE_INFER)
+    ty.flags.intersects(HAS_TY_INFER | HAS_RE_INFER)
 }
 
 pub fn type_has_late_bound_regions(ty: Ty) -> bool {
-    get(ty).flags.intersects(HAS_RE_LATE_BOUND)
+    ty.flags.intersects(HAS_RE_LATE_BOUND)
 }
 
 pub fn type_has_escaping_regions(ty: Ty) -> bool {
@@ -714,7 +707,7 @@ pub fn type_has_escaping_regions(ty: Ty) -> bool {
 }
 
 pub fn type_escapes_depth(ty: Ty, depth: uint) -> bool {
-    get(ty).region_depth > depth
+    ty.region_depth > depth
 }
 
 #[deriving(Clone, PartialEq, Eq, Hash, Show)]
@@ -1929,9 +1922,8 @@ fn add_sty(&mut self, st: &sty) {
     }
 
     fn add_ty(&mut self, ty: Ty) {
-        let t_box = get(ty);
-        self.add_flags(t_box.flags);
-        self.add_depth(t_box.region_depth);
+        self.add_flags(ty.flags);
+        self.add_depth(ty.region_depth);
     }
 
     fn add_tys(&mut self, tys: &[Ty]) {
@@ -2211,7 +2203,7 @@ pub fn maybe_walk_ty<'tcx>(ty: Ty<'tcx>, f: |Ty<'tcx>| -> bool) {
     if !f(ty) {
         return;
     }
-    match get(ty).sty {
+    match ty.sty {
         ty_bool | ty_char | ty_int(_) | ty_uint(_) | ty_float(_) |
         ty_str | ty_infer(_) | ty_param(_) | ty_err => {}
         ty_uniq(ty) | ty_vec(ty, _) | ty_open(ty) => maybe_walk_ty(ty, f),
@@ -2302,18 +2294,18 @@ pub fn empty() -> ParamBounds<'tcx> {
 // Type utilities
 
 pub fn type_is_nil(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
         ty_tup(ref tys) => tys.is_empty(),
         _ => false
     }
 }
 
 pub fn type_is_error(ty: Ty) -> bool {
-    get(ty).flags.intersects(HAS_TY_ERR)
+    ty.flags.intersects(HAS_TY_ERR)
 }
 
 pub fn type_needs_subst(ty: Ty) -> bool {
-    tbox_has_flag(get(ty), NEEDS_SUBST)
+    ty.flags.intersects(NEEDS_SUBST)
 }
 
 pub fn trait_ref_contains_error(tref: &ty::TraitRef) -> bool {
@@ -2321,24 +2313,24 @@ pub fn trait_ref_contains_error(tref: &ty::TraitRef) -> bool {
 }
 
 pub fn type_is_ty_var(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
         ty_infer(TyVar(_)) => true,
         _ => false
     }
 }
 
-pub fn type_is_bool(ty: Ty) -> bool { get(ty).sty == ty_bool }
+pub fn type_is_bool(ty: Ty) -> bool { ty.sty == ty_bool }
 
 pub fn type_is_self(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
         ty_param(ref p) => p.space == subst::SelfSpace,
         _ => false
     }
 }
 
 fn type_is_slice(ty: Ty) -> bool {
-    match get(ty).sty {
-        ty_ptr(mt) | ty_rptr(_, mt) => match get(mt.ty).sty {
+    match ty.sty {
+        ty_ptr(mt) | ty_rptr(_, mt) => match mt.ty.sty {
             ty_vec(_, None) | ty_str => true,
             _ => false,
         },
@@ -2347,10 +2339,10 @@ fn type_is_slice(ty: Ty) -> bool {
 }
 
 pub fn type_is_vec(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
         ty_vec(..) => true,
         ty_ptr(mt{ty, ..}) | ty_rptr(_, mt{ty, ..}) |
-        ty_uniq(ty) => match get(ty).sty {
+        ty_uniq(ty) => match ty.sty {
             ty_vec(_, None) => true,
             _ => false
         },
@@ -2359,7 +2351,7 @@ pub fn type_is_vec(ty: Ty) -> bool {
 }
 
 pub fn type_is_structural(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
       ty_struct(..) | ty_tup(_) | ty_enum(..) | ty_closure(_) |
       ty_vec(_, Some(_)) | ty_unboxed_closure(..) => true,
       _ => type_is_slice(ty) | type_is_trait(ty)
@@ -2367,14 +2359,14 @@ pub fn type_is_structural(ty: Ty) -> bool {
 }
 
 pub fn type_is_simd(cx: &ctxt, ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
         ty_struct(did, _) => lookup_simd(cx, did),
         _ => false
     }
 }
 
 pub fn sequence_element_type<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> {
-    match get(ty).sty {
+    match ty.sty {
         ty_vec(ty, _) => ty,
         ty_str => mk_mach_uint(ast::TyU8),
         ty_open(ty) => sequence_element_type(cx, ty),
@@ -2384,7 +2376,7 @@ pub fn sequence_element_type<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> {
 }
 
 pub fn simd_type<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> {
-    match get(ty).sty {
+    match ty.sty {
         ty_struct(did, ref substs) => {
             let fields = lookup_struct_fields(cx, did);
             lookup_field_type(cx, did, fields[0].id, substs)
@@ -2394,7 +2386,7 @@ pub fn simd_type<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> {
 }
 
 pub fn simd_size(cx: &ctxt, ty: Ty) -> uint {
-    match get(ty).sty {
+    match ty.sty {
         ty_struct(did, _) => {
             let fields = lookup_struct_fields(cx, did);
             fields.len()
@@ -2404,22 +2396,22 @@ pub fn simd_size(cx: &ctxt, ty: Ty) -> uint {
 }
 
 pub fn type_is_region_ptr(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
         ty_rptr(..) => true,
         _ => false
     }
 }
 
 pub fn type_is_unsafe_ptr(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
       ty_ptr(_) => return true,
       _ => return false
     }
 }
 
 pub fn type_is_unique(ty: Ty) -> bool {
-    match get(ty).sty {
-        ty_uniq(_) => match get(ty).sty {
+    match ty.sty {
+        ty_uniq(_) => match ty.sty {
             ty_trait(..) => false,
             _ => true
         },
@@ -2428,7 +2420,7 @@ pub fn type_is_unique(ty: Ty) -> bool {
 }
 
 pub fn type_is_fat_ptr<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> bool {
-    match get(ty).sty {
+    match ty.sty {
         ty_ptr(mt{ty, ..}) | ty_rptr(_, mt{ty, ..})
         | ty_uniq(ty) if !type_is_sized(cx, ty) => true,
         _ => false,
@@ -2441,7 +2433,7 @@ pub fn type_is_fat_ptr<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> bool {
  contents are abstract to rustc.)
 */
 pub fn type_is_scalar(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
       ty_bool | ty_char | ty_int(_) | ty_float(_) | ty_uint(_) |
       ty_infer(IntVar(_)) | ty_infer(FloatVar(_)) |
       ty_bare_fn(..) | ty_ptr(_) => true,
@@ -2452,7 +2444,7 @@ pub fn type_is_scalar(ty: Ty) -> bool {
 
 /// Returns true if this type is a floating point type and false otherwise.
 pub fn type_is_floating_point(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
         ty_float(_) => true,
         _ => false,
     }
@@ -2480,7 +2472,7 @@ fn type_needs_unwind_cleanup_<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>,
 
         let mut needs_unwind_cleanup = false;
         maybe_walk_ty(ty, |ty| {
-            needs_unwind_cleanup |= match get(ty).sty {
+            needs_unwind_cleanup |= match ty.sty {
                 ty_bool | ty_int(_) | ty_uint(_) |
                 ty_float(_) | ty_tup(_) | ty_ptr(_) => false,
 
@@ -2732,7 +2724,7 @@ fn tc_ty<'tcx>(cx: &ctxt<'tcx>,
         }
         cache.insert(ty, TC::None);
 
-        let result = match get(ty).sty {
+        let result = match ty.sty {
             // uint and int are ffi-unsafe
             ty_uint(ast::TyU) | ty_int(ast::TyI) => {
                 TC::ReachesFfiUnsafe
@@ -2750,7 +2742,7 @@ fn tc_ty<'tcx>(cx: &ctxt<'tcx>,
             }
 
             ty_uniq(typ) => {
-                TC::ReachesFfiUnsafe | match get(typ).sty {
+                TC::ReachesFfiUnsafe | match typ.sty {
                     ty_str => TC::OwnsOwned,
                     _ => tc_ty(cx, typ, cache).owned_pointer(),
                 }
@@ -2765,7 +2757,7 @@ fn tc_ty<'tcx>(cx: &ctxt<'tcx>,
             }
 
             ty_rptr(r, ref mt) => {
-                TC::ReachesFfiUnsafe | match get(mt.ty).sty {
+                TC::ReachesFfiUnsafe | match mt.ty.sty {
                     ty_str => borrowed_contents(r, ast::MutImmutable),
                     ty_vec(..) => tc_ty(cx, mt.ty, cache).reference(borrowed_contents(r, mt.mutbl)),
                     _ => tc_ty(cx, mt.ty, cache).reference(borrowed_contents(r, mt.mutbl)),
@@ -2852,7 +2844,7 @@ fn tc_ty<'tcx>(cx: &ctxt<'tcx>,
                                 }
 
                                 if variants[data_idx].args.len() == 1 {
-                                    match get(variants[data_idx].args[0]).sty {
+                                    match variants[data_idx].args[0].sty {
                                         ty_bare_fn(..) => { res = res - TC::ReachesFfiUnsafe; }
                                         _ => { }
                                     }
@@ -3026,10 +3018,7 @@ fn type_requires<'tcx>(cx: &ctxt<'tcx>, seen: &mut Vec<DefId>,
                ::util::ppaux::ty_to_string(cx, r_ty),
                ::util::ppaux::ty_to_string(cx, ty));
 
-        let r = {
-            get(r_ty).sty == get(ty).sty ||
-                subtypes_require(cx, seen, r_ty, ty)
-        };
+        let r = r_ty == ty || subtypes_require(cx, seen, r_ty, ty);
 
         debug!("type_requires({}, {})? {}",
                ::util::ppaux::ty_to_string(cx, r_ty),
@@ -3044,7 +3033,7 @@ fn subtypes_require<'tcx>(cx: &ctxt<'tcx>, seen: &mut Vec<DefId>,
                ::util::ppaux::ty_to_string(cx, r_ty),
                ::util::ppaux::ty_to_string(cx, ty));
 
-        let r = match get(ty).sty {
+        let r = match ty.sty {
             // fixed length vectors need special treatment compared to
             // normal vectors, since they don't necessarily have the
             // possibility to have length zero.
@@ -3163,7 +3152,7 @@ fn find_nonrepresentable<'tcx, It: Iterator<Ty<'tcx>>>(cx: &ctxt<'tcx>, sp: Span
     fn are_inner_types_recursive<'tcx>(cx: &ctxt<'tcx>, sp: Span,
                                        seen: &mut Vec<Ty<'tcx>>, ty: Ty<'tcx>)
                                        -> Representability {
-        match get(ty).sty {
+        match ty.sty {
             ty_tup(ref ts) => {
                 find_nonrepresentable(cx, sp, seen, ts.iter().map(|ty| *ty))
             }
@@ -3193,7 +3182,7 @@ fn are_inner_types_recursive<'tcx>(cx: &ctxt<'tcx>, sp: Span,
     }
 
     fn same_struct_or_enum_def_id(ty: Ty, did: DefId) -> bool {
-        match get(ty).sty {
+        match ty.sty {
             ty_struct(ty_did, _) | ty_enum(ty_did, _) => {
                  ty_did == did
             }
@@ -3202,7 +3191,7 @@ fn same_struct_or_enum_def_id(ty: Ty, did: DefId) -> bool {
     }
 
     fn same_type<'tcx>(a: Ty<'tcx>, b: Ty<'tcx>) -> bool {
-        match (&get(a).sty, &get(b).sty) {
+        match (&a.sty, &b.sty) {
             (&ty_struct(did_a, ref substs_a), &ty_struct(did_b, ref substs_b)) |
             (&ty_enum(did_a, ref substs_a), &ty_enum(did_b, ref substs_b)) => {
                 if did_a != did_b {
@@ -3230,7 +3219,7 @@ fn is_type_structurally_recursive<'tcx>(cx: &ctxt<'tcx>, sp: Span,
         debug!("is_type_structurally_recursive: {}",
                ::util::ppaux::ty_to_string(cx, ty));
 
-        match get(ty).sty {
+        match ty.sty {
             ty_struct(did, _) | ty_enum(did, _) => {
                 {
                     // Iterate through stack of previously seen types.
@@ -3307,8 +3296,8 @@ pub fn type_is_trait(ty: Ty) -> bool {
 }
 
 pub fn type_trait_info<'tcx>(ty: Ty<'tcx>) -> Option<&'tcx TyTrait<'tcx>> {
-    match get(ty).sty {
-        ty_uniq(ty) | ty_rptr(_, mt { ty, ..}) | ty_ptr(mt { ty, ..}) => match get(ty).sty {
+    match ty.sty {
+        ty_uniq(ty) | ty_rptr(_, mt { ty, ..}) | ty_ptr(mt { ty, ..}) => match ty.sty {
             ty_trait(ref t) => Some(&**t),
             _ => None
         },
@@ -3318,14 +3307,14 @@ pub fn type_trait_info<'tcx>(ty: Ty<'tcx>) -> Option<&'tcx TyTrait<'tcx>> {
 }
 
 pub fn type_is_integral(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
       ty_infer(IntVar(_)) | ty_int(_) | ty_uint(_) => true,
       _ => false
     }
 }
 
 pub fn type_is_skolemized(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
       ty_infer(SkolemizedTy(_)) => true,
       ty_infer(SkolemizedIntTy(_)) => true,
       _ => false
@@ -3333,28 +3322,28 @@ pub fn type_is_skolemized(ty: Ty) -> bool {
 }
 
 pub fn type_is_uint(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
       ty_infer(IntVar(_)) | ty_uint(ast::TyU) => true,
       _ => false
     }
 }
 
 pub fn type_is_char(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
         ty_char => true,
         _ => false
     }
 }
 
 pub fn type_is_bare_fn(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
         ty_bare_fn(..) => true,
         _ => false
     }
 }
 
 pub fn type_is_fp(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
       ty_infer(FloatVar(_)) | ty_float(_) => true,
       _ => false
     }
@@ -3365,14 +3354,14 @@ pub fn type_is_numeric(ty: Ty) -> bool {
 }
 
 pub fn type_is_signed(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
       ty_int(_) => true,
       _ => false
     }
 }
 
 pub fn type_is_machine(ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
         ty_int(ast::TyI) | ty_uint(ast::TyU) => false,
         ty_int(..) | ty_uint(..) | ty_float(..) => true,
         _ => false
@@ -3385,7 +3374,7 @@ pub fn type_is_sized<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> bool {
 }
 
 pub fn lltype_is_sized<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> bool {
-    match get(ty).sty {
+    match ty.sty {
         ty_open(_) => true,
         _ => type_contents(cx, ty).is_sized(cx)
     }
@@ -3395,7 +3384,7 @@ pub fn lltype_is_sized<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> bool {
 // 'Smallest' here means component of the static representation of the type; not
 // the size of an object at runtime.
 pub fn unsized_part_of_type<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> {
-    match get(ty).sty {
+    match ty.sty {
         ty_str | ty_trait(..) | ty_vec(..) => ty,
         ty_struct(def_id, ref substs) => {
             let unsized_fields: Vec<_> = struct_fields(cx, def_id, substs).iter()
@@ -3416,7 +3405,7 @@ pub fn unsized_part_of_type<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> {
 // Whether a type is enum like, that is an enum type with only nullary
 // constructors
 pub fn type_is_c_like_enum(cx: &ctxt, ty: Ty) -> bool {
-    match get(ty).sty {
+    match ty.sty {
         ty_enum(did, _) => {
             let variants = enum_variants(cx, did);
             if variants.len() == 0 {
@@ -3434,7 +3423,7 @@ pub fn type_is_c_like_enum(cx: &ctxt, ty: Ty) -> bool {
 // The parameter `explicit` indicates if this is an *explicit* dereference.
 // Some types---notably unsafe ptrs---can only be dereferenced explicitly.
 pub fn deref<'tcx>(ty: Ty<'tcx>, explicit: bool) -> Option<mt<'tcx>> {
-    match get(ty).sty {
+    match ty.sty {
         ty_uniq(ty) => {
             Some(mt {
                 ty: ty,
@@ -3448,7 +3437,7 @@ pub fn deref<'tcx>(ty: Ty<'tcx>, explicit: bool) -> Option<mt<'tcx>> {
 }
 
 pub fn deref_or_dont<'tcx>(ty: Ty<'tcx>) -> Ty<'tcx> {
-    match get(ty).sty {
+    match ty.sty {
         ty_uniq(ty) => ty,
         ty_rptr(_, mt) | ty_ptr(mt) => mt.ty,
         _ => ty
@@ -3456,7 +3445,7 @@ pub fn deref_or_dont<'tcx>(ty: Ty<'tcx>) -> Ty<'tcx> {
 }
 
 pub fn close_type<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> {
-    match get(ty).sty {
+    match ty.sty {
         ty_open(ty) => mk_rptr(cx, ReStatic, mt {ty: ty, mutbl:ast::MutImmutable}),
         _ => cx.sess.bug(format!("Trying to close a non-open type {}",
                                  ty_to_string(cx, ty)).as_slice())
@@ -3464,7 +3453,7 @@ pub fn close_type<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> {
 }
 
 pub fn type_content<'tcx>(ty: Ty<'tcx>) -> Ty<'tcx> {
-    match get(ty).sty {
+    match ty.sty {
         ty_uniq(ty) => ty,
         ty_rptr(_, mt) |ty_ptr(mt) => mt.ty,
         _ => ty
@@ -3473,7 +3462,7 @@ pub fn type_content<'tcx>(ty: Ty<'tcx>) -> Ty<'tcx> {
 
 // Extract the unsized type in an open type (or just return ty if it is not open).
 pub fn unopen_type<'tcx>(ty: Ty<'tcx>) -> Ty<'tcx> {
-    match get(ty).sty {
+    match ty.sty {
         ty_open(ty) => ty,
         _ => ty
     }
@@ -3481,7 +3470,7 @@ pub fn unopen_type<'tcx>(ty: Ty<'tcx>) -> Ty<'tcx> {
 
 // Returns the type of ty[i]
 pub fn index<'tcx>(ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
-    match get(ty).sty {
+    match ty.sty {
         ty_vec(ty, _) => Some(ty),
         _ => None
     }
@@ -3491,7 +3480,7 @@ pub fn index<'tcx>(ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
 // This is exactly the same as the above, except it supports strings,
 // which can't actually be indexed.
 pub fn array_element_ty<'tcx>(ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
-    match get(ty).sty {
+    match ty.sty {
         ty_vec(ty, _) => Some(ty),
         ty_str => Some(mk_u8()),
         _ => None
@@ -3536,7 +3525,7 @@ pub fn node_id_item_substs<'tcx>(cx: &ctxt<'tcx>, id: ast::NodeId) -> ItemSubsts
 }
 
 pub fn fn_is_variadic(fty: Ty) -> bool {
-    match get(fty).sty {
+    match fty.sty {
         ty_bare_fn(ref f) => f.sig.variadic,
         ty_closure(ref f) => f.sig.variadic,
         ref s => {
@@ -3546,7 +3535,7 @@ pub fn fn_is_variadic(fty: Ty) -> bool {
 }
 
 pub fn ty_fn_sig<'tcx>(fty: Ty<'tcx>) -> &'tcx FnSig<'tcx> {
-    match get(fty).sty {
+    match fty.sty {
         ty_bare_fn(ref f) => &f.sig,
         ty_closure(ref f) => &f.sig,
         ref s => {
@@ -3557,7 +3546,7 @@ pub fn ty_fn_sig<'tcx>(fty: Ty<'tcx>) -> &'tcx FnSig<'tcx> {
 
 /// Returns the ABI of the given function.
 pub fn ty_fn_abi(fty: Ty) -> abi::Abi {
-    match get(fty).sty {
+    match fty.sty {
         ty_bare_fn(ref f) => f.abi,
         ty_closure(ref f) => f.abi,
         _ => panic!("ty_fn_abi() called on non-fn type"),
@@ -3570,7 +3559,7 @@ pub fn ty_fn_args<'tcx>(fty: Ty<'tcx>) -> &'tcx [Ty<'tcx>] {
 }
 
 pub fn ty_closure_store(fty: Ty) -> TraitStore {
-    match get(fty).sty {
+    match fty.sty {
         ty_closure(ref f) => f.store,
         ty_unboxed_closure(..) => {
             // Close enough for the purposes of all the callers of this
@@ -3584,7 +3573,7 @@ pub fn ty_closure_store(fty: Ty) -> TraitStore {
 }
 
 pub fn ty_fn_ret<'tcx>(fty: Ty<'tcx>) -> FnOutput<'tcx> {
-    match get(fty).sty {
+    match fty.sty {
         ty_bare_fn(ref f) => f.sig.output,
         ty_closure(ref f) => f.sig.output,
         ref s => {
@@ -3594,7 +3583,7 @@ pub fn ty_fn_ret<'tcx>(fty: Ty<'tcx>) -> FnOutput<'tcx> {
 }
 
 pub fn is_fn_ty(fty: Ty) -> bool {
-    match get(fty).sty {
+    match fty.sty {
         ty_bare_fn(_) => true,
         ty_closure(_) => true,
         _ => false
@@ -3604,7 +3593,7 @@ pub fn is_fn_ty(fty: Ty) -> bool {
 pub fn ty_region(tcx: &ctxt,
                  span: Span,
                  ty: Ty) -> Region {
-    match get(ty).sty {
+    match ty.sty {
         ty_rptr(r, _) => r,
         ref s => {
             tcx.sess.span_bug(
@@ -3716,7 +3705,7 @@ pub fn adjust_ty<'tcx>(cx: &ctxt<'tcx>,
                        -> Ty<'tcx> {
     /*! See `expr_ty_adjusted` */
 
-    match get(unadjusted_ty).sty {
+    match unadjusted_ty.sty {
         ty_err => return unadjusted_ty,
         _ => {}
     }
@@ -3725,7 +3714,7 @@ pub fn adjust_ty<'tcx>(cx: &ctxt<'tcx>,
         Some(adjustment) => {
             match *adjustment {
                 AdjustAddEnv(store) => {
-                    match ty::get(unadjusted_ty).sty {
+                    match unadjusted_ty.sty {
                         ty::ty_bare_fn(ref b) => {
                             let bounds = ty::ExistentialBounds {
                                 region_bound: ReStatic,
@@ -3829,7 +3818,7 @@ pub fn unsize_ty<'tcx>(cx: &ctxt<'tcx>,
                        span: Span)
                        -> Ty<'tcx> {
     match kind {
-        &UnsizeLength(len) => match get(ty).sty {
+        &UnsizeLength(len) => match ty.sty {
             ty_vec(ty, Some(n)) => {
                 assert!(len == n);
                 mk_vec(cx, ty, None)
@@ -3838,7 +3827,7 @@ pub fn unsize_ty<'tcx>(cx: &ctxt<'tcx>,
                                   format!("UnsizeLength with bad sty: {}",
                                           ty_to_string(cx, ty)).as_slice())
         },
-        &UnsizeStruct(box ref k, tp_index) => match get(ty).sty {
+        &UnsizeStruct(box ref k, tp_index) => match ty.sty {
             ty_struct(did, ref substs) => {
                 let ty_substs = substs.types.get_slice(subst::TypeSpace);
                 let new_ty = unsize_ty(cx, ty_substs[tp_index], k, span);
@@ -3925,7 +3914,7 @@ pub fn expr_kind(tcx: &ctxt, expr: &ast::Expr) -> ExprKind {
                 }
 
                 def::DefStruct(_) => {
-                    match get(expr_ty(tcx, expr)).sty {
+                    match expr_ty(tcx, expr).sty {
                         ty_bare_fn(..) => RvalueDatumExpr,
                         _ => RvalueDpsExpr
                     }
@@ -4089,7 +4078,7 @@ pub fn impl_or_trait_item_idx(id: ast::Name, trait_items: &[ImplOrTraitItem])
 }
 
 pub fn ty_sort_string<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> String {
-    match get(ty).sty {
+    match ty.sty {
         ty_bool | ty_char | ty_int(_) |
         ty_uint(_) | ty_float(_) | ty_str => {
             ::util::ppaux::ty_to_string(cx, ty)
@@ -4529,7 +4518,7 @@ pub fn try_add_builtin_trait(
 }
 
 pub fn ty_to_def_id(ty: Ty) -> Option<ast::DefId> {
-    match get(ty).sty {
+    match ty.sty {
         ty_trait(ref tt) =>
             Some(tt.principal.def_id),
         ty_struct(id, _) |
@@ -4684,7 +4673,7 @@ pub fn enum_is_univariant(cx: &ctxt, id: ast::DefId) -> bool {
 }
 
 pub fn type_is_empty(cx: &ctxt, ty: Ty) -> bool {
-    match ty::get(ty).sty {
+    match ty.sty {
        ty_enum(did, _) => (*enum_variants(cx, did)).is_empty(),
        _ => false
      }
@@ -5108,7 +5097,7 @@ fn tycat<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> int {
         if type_is_simd(cx, ty) {
             return tycat(cx, simd_type(cx, ty))
         }
-        match get(ty).sty {
+        match ty.sty {
           ty_char => tycat_char,
           ty_bool => tycat_bool,
           ty_int(_) | ty_uint(_) | ty_infer(IntVar(_)) => tycat_int,
@@ -5534,7 +5523,7 @@ pub fn hash_crate_independent(tcx: &ctxt, ty: Ty, svh: &Svh) -> u64 {
         mt.mutbl.hash(state);
     };
     ty::walk_ty(ty, |ty| {
-        match ty::get(ty).sty {
+        match ty.sty {
             ty_bool => byte!(2),
             ty_char => byte!(3),
             ty_int(i) => {
@@ -5870,7 +5859,7 @@ pub enum ExplicitSelfCategory {
 pub fn accumulate_lifetimes_in_type(accumulator: &mut Vec<ty::Region>,
                                     ty: Ty) {
     walk_ty(ty, |ty| {
-        match get(ty).sty {
+        match ty.sty {
             ty_rptr(region, _) => {
                 accumulator.push(region)
             }
index 7c6148459d18f9d0b0a59a217800b124f642b6d9..913919fe774f341f0a7320347904dc2d72565d8d 100644 (file)
@@ -490,7 +490,7 @@ fn fold_with<F:TypeFolder<'tcx>>(&self, folder: &mut F) -> traits::VtableParamDa
 pub fn super_fold_ty<'tcx, T: TypeFolder<'tcx>>(this: &mut T,
                                                 t: Ty<'tcx>)
                                                 -> Ty<'tcx> {
-    let sty = ty::get(t).sty.fold_with(this);
+    let sty = t.sty.fold_with(this);
     ty::mk_t(this.tcx(), sty)
 }
 
index 8e04e8b1f79d844ec6de4183d63a925e5aed5672..ea652bc7e6599cc393b06e7135277d0a89d48562 100644 (file)
@@ -667,7 +667,7 @@ pub fn ast_ty_to_builtin_ty<'tcx, AC: AstConv<'tcx>, RS: RegionScope>(
                 def::DefTy(did, _) |
                 def::DefStruct(did) if Some(did) == this.tcx().lang_items.owned_box() => {
                     let ty = ast_path_to_ty(this, rscope, did, path).ty;
-                    match ty::get(ty).sty {
+                    match ty.sty {
                         ty::ty_struct(struct_def_id, ref substs) => {
                             assert_eq!(struct_def_id, did);
                             assert_eq!(substs.types.len(TypeSpace), 1);
@@ -1294,7 +1294,7 @@ fn determine_explicit_self_category<'a, 'tcx, AC: AstConv<'tcx>,
             if impl_modifiers >= method_modifiers {
                 ty::ByValueExplicitSelfCategory
             } else {
-                match ty::get(explicit_type).sty {
+                match explicit_type.sty {
                     ty::ty_rptr(r, mt) => ty::ByReferenceExplicitSelfCategory(r, mt.mutbl),
                     ty::ty_uniq(_) => ty::ByBoxExplicitSelfCategory,
                     _ => ty::ByValueExplicitSelfCategory,
@@ -1304,7 +1304,7 @@ fn determine_explicit_self_category<'a, 'tcx, AC: AstConv<'tcx>,
     };
 
     fn count_modifiers(ty: Ty) -> uint {
-        match ty::get(ty).sty {
+        match ty.sty {
             ty::ty_rptr(_, mt) => count_modifiers(mt.ty) + 1,
             ty::ty_uniq(t) => count_modifiers(t) + 1,
             _ => 0,
index 7b5a37148c033d80176394849a0bbd2a2c506411..92b30cd7af8f76e97d1288ab41602dda11fdee14 100644 (file)
@@ -165,7 +165,7 @@ pub fn check_pat<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>,
         ast::PatVec(ref before, ref slice, ref after) => {
             let expected_ty = structurally_resolved_type(fcx, pat.span, expected);
             let inner_ty = fcx.infcx().next_ty_var();
-            let pat_ty = match ty::get(expected_ty).sty {
+            let pat_ty = match expected_ty.sty {
                 ty::ty_vec(_, Some(size)) => ty::mk_vec(tcx, inner_ty, Some({
                     let min_len = before.len() + after.len();
                     match *slice {
@@ -217,7 +217,7 @@ pub fn check_dereferencable<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>,
         fcx.infcx(), Some(span),
         expected, resolve::try_resolve_tvar_shallow) {
         Ok(t) if pat_is_binding(&tcx.def_map, inner) => {
-            ty::deref(t, true).map_or(true, |mt| match ty::get(mt.ty).sty {
+            ty::deref(t, true).map_or(true, |mt| match mt.ty.sty {
                 ty::ty_trait(_) => {
                     // This is "x = SomeTrait" being reduced from
                     // "let &x = &SomeTrait" or "let box x = Box<SomeTrait>", an error.
@@ -313,7 +313,7 @@ pub fn check_pat_struct<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>, pat: &ast::Pat,
         },
         _ => {
             let def_type = ty::lookup_item_type(tcx, def.def_id());
-            match ty::get(def_type.ty).sty {
+            match def_type.ty.sty {
                 ty::ty_struct(struct_def_id, _) =>
                     (struct_def_id, struct_def_id),
                 ty::ty_enum(enum_def_id, _)
@@ -378,7 +378,7 @@ pub fn check_pat_enum<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>, pat: &ast::Pat,
     demand::eqtype(fcx, pat.span, expected, pat_ty);
 
     let real_path_ty = fcx.node_ty(pat.id);
-    let (arg_tys, kind_name) = match ty::get(real_path_ty).sty {
+    let (arg_tys, kind_name) = match real_path_ty.sty {
         ty::ty_enum(enum_def_id, ref expected_substs) => {
             let variant = ty::enum_variant_with_id(tcx, enum_def_id, def.def_id());
             (variant.args.iter().map(|t| t.subst(tcx, expected_substs)).collect::<Vec<_>>(),
index 8a337421b87e2c0feeda8a1b648602d4418351b8..af8ef09d2a072865fae7816f499d68de6a32dde6 100644 (file)
@@ -305,7 +305,7 @@ fn extract_trait_ref<R>(&mut self,
             check::autoderef(
                 self.fcx, self.span, self_ty, None, NoPreference,
                 |ty, _| {
-                    match ty::get(ty).sty {
+                    match ty.sty {
                         ty::ty_trait(ref data) => Some(closure(self, ty, &**data)),
                         _ => None,
                     }
@@ -482,13 +482,13 @@ fn fixup_derefs_on_method_receiver_if_necessary(&self,
          * `DerefMut` and `IndexMut` respectively.
          */
 
-        let sig = match ty::get(method_callee.ty).sty {
+        let sig = match method_callee.ty.sty {
             ty::ty_bare_fn(ref f) => f.sig.clone(),
             ty::ty_closure(ref f) => f.sig.clone(),
             _ => return,
         };
 
-        match ty::get(sig.inputs[0]).sty {
+        match sig.inputs[0].sty {
             ty::ty_rptr(_, ty::mt {
                 ty: _,
                 mutbl: ast::MutMutable,
index 69a55bf0906a5be671a0adc4ccf6f1f49506c517..411948ed6b4acffd44da09d70c5d84dd9d39fac7 100644 (file)
@@ -262,7 +262,7 @@ pub fn lookup_in_trait_adjusted<'a, 'tcx>(fcx: &'a FnCtxt<'a, 'tcx>,
                 ty::ByReferenceExplicitSelfCategory(..) => {
                     // Trait method is fn(&self) or fn(&mut self), need an
                     // autoref. Pull the region etc out of the type of first argument.
-                    match ty::get(transformed_self_ty).sty {
+                    match transformed_self_ty.sty {
                         ty::ty_rptr(region, ty::mt { mutbl, ty: _ }) => {
                             let ty::AutoDerefRef { autoderefs, autoref } = autoderefref;
                             let autoref = autoref.map(|r| box r);
@@ -321,7 +321,7 @@ pub fn report_error<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
 
             // True if the type is a struct and contains a field with
             // the same name as the not-found method
-            let is_field = match ty::get(rcvr_ty).sty {
+            let is_field = match rcvr_ty.sty {
                 ty_struct(did, _) =>
                     ty::lookup_struct_fields(cx, did)
                         .iter()
index 921fd5bed8bd09e099c3c7a49dcebaaadf7950df..a98b4cf011d97e38f1a9b4eb414a813c2349e455 100644 (file)
@@ -173,7 +173,7 @@ fn create_steps<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
                 None::<()> // keep iterating until we can't anymore
             });
 
-    match ty::get(fully_dereferenced_ty).sty {
+    match fully_dereferenced_ty.sty {
         ty::ty_vec(elem_ty, Some(len)) => {
             steps.push(CandidateStep {
                 self_ty: ty::mk_vec(fcx.tcx(), elem_ty, None),
@@ -186,9 +186,9 @@ fn create_steps<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
 
     return steps;
 
-    fn consider_reborrow(t: Ty, d: uint) -> PickAdjustment {
+    fn consider_reborrow(ty: Ty, d: uint) -> PickAdjustment {
         // Insert a `&*` or `&mut *` if this is a reference type:
-        match ty::get(t).sty {
+        match ty.sty {
             ty::ty_rptr(_, ref mt) => AutoRef(mt.mutbl, box AutoDeref(d+1)),
             _ => AutoDeref(d),
         }
@@ -238,7 +238,7 @@ fn assemble_probe(&mut self, self_ty: Ty<'tcx>) {
         debug!("assemble_probe: self_ty={}",
                self_ty.repr(self.tcx()));
 
-        match ty::get(self_ty).sty {
+        match self_ty.sty {
             ty::ty_trait(box ty::TyTrait { ref principal, bounds, .. }) => {
                 self.assemble_inherent_candidates_from_object(self_ty, &*principal, bounds);
                 self.assemble_inherent_impl_candidates_for_type(principal.def_id);
@@ -562,7 +562,7 @@ fn assemble_unboxed_closure_candidates(&mut self,
         // If so, add "synthetic impls".
         let steps = self.steps.clone();
         for step in steps.iter() {
-            let (closure_def_id, _, _) = match ty::get(step.self_ty).sty {
+            let (closure_def_id, _, _) = match step.self_ty.sty {
                 ty::ty_unboxed_closure(a, b, ref c) => (a, b, c),
                 _ => continue,
             };
@@ -638,7 +638,7 @@ fn pick_step(&mut self, step: &CandidateStep<'tcx>) -> Option<PickResult<'tcx>>
 
         // FIXME -- Super hack. For DST types, we will convert to
         // &&[T] or &&str, as part of a kind of legacy lookup scheme.
-        match ty::get(step.self_ty).sty {
+        match step.self_ty.sty {
             ty::ty_str | ty::ty_vec(_, None) => self.pick_autorefrefd_method(step),
             _ => None
         }
index dcc5cfa760eaad971764f3ffe186e3a66a695680..543eb44697c06ce5fdaaa5c79293326b1330685c 100644 (file)
@@ -405,7 +405,7 @@ fn check_bare_fn<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
     // (replace any type-scheme with a type)
     let fty = fty.subst(ccx.tcx, &param_env.free_substs);
 
-    match ty::get(fty).sty {
+    match fty.sty {
         ty::ty_bare_fn(ref fn_ty) => {
             let inh = Inherited::new(ccx.tcx, param_env);
             let fcx = check_fn(ccx, fn_ty.fn_style, id, &fn_ty.sig,
@@ -1436,7 +1436,7 @@ fn check_cast(fcx: &FnCtxt,
         fcx.type_error_message(span, |actual| {
             format!("cast to unsized type: `{}` as `{}`", actual, tstr)
         }, t_e, None);
-        match ty::get(t_e).sty {
+        match t_e.sty {
             ty::ty_rptr(_, ty::mt { mutbl: mt, .. }) => {
                 let mtstr = match mt {
                     ast::MutMutable => "mut ",
@@ -1505,19 +1505,19 @@ fn check_cast(fcx: &FnCtxt,
         // casts from C-like enums are allowed
     } else if t_1_is_char {
         let t_e = fcx.infcx().shallow_resolve(t_e);
-        if ty::get(t_e).sty != ty::ty_uint(ast::TyU8) {
+        if t_e.sty != ty::ty_uint(ast::TyU8) {
             fcx.type_error_message(span, |actual| {
                 format!("only `u8` can be cast as \
                          `char`, not `{}`", actual)
             }, t_e, None);
         }
-    } else if ty::get(t_1).sty == ty::ty_bool {
+    } else if t_1.sty == ty::ty_bool {
         span_err!(fcx.tcx().sess, span, E0054,
             "cannot cast as `bool`, compare with zero instead");
     } else if ty::type_is_region_ptr(t_e) && ty::type_is_unsafe_ptr(t_1) {
         fn types_compatible<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, sp: Span,
                                       t1: Ty<'tcx>, t2: Ty<'tcx>) -> bool {
-            match ty::get(t1).sty {
+            match t1.sty {
                 ty::ty_vec(_, Some(_)) => {}
                 _ => return false
             }
@@ -1545,7 +1545,7 @@ fn types_compatible<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, sp: Span,
 
         /* this cast is only allowed from &[T, ..n] to *T or
         &T to *T. */
-        match (&ty::get(t_e).sty, &ty::get(t_1).sty) {
+        match (&t_e.sty, &t_1.sty) {
             (&ty::ty_rptr(_, ty::mt { ty: mt1, mutbl: ast::MutImmutable }),
              &ty::ty_ptr(ty::mt { ty: mt2, mutbl: ast::MutImmutable }))
             if types_compatible(fcx, e.span, mt1, mt2) => {
@@ -2370,7 +2370,7 @@ fn autoderef_for_index<'a, 'tcx, T>(fcx: &FnCtxt<'a, 'tcx>,
 
     // After we have fully autoderef'd, if the resulting type is [T, ..n], then
     // do a final unsized coercion to yield [T].
-    match ty::get(ty).sty {
+    match ty.sty {
         ty::ty_vec(element_ty, Some(n)) => {
             let adjusted_ty = ty::mk_vec(fcx.tcx(), element_ty, None);
             let autoderefref = ty::AutoDerefRef {
@@ -2653,7 +2653,7 @@ fn lookup_method_for_for_loop<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
                     structurally_resolved_type(fcx, iterator_expr.span, return_type),
                 ty::FnDiverging => ty::mk_err()
             };
-            match ty::get(return_type).sty {
+            match return_type.sty {
                 ty::ty_enum(_, ref substs)
                         if !substs.types.is_empty_in(subst::TypeSpace) => {
                     *substs.types.get(subst::TypeSpace, 0)
@@ -2695,7 +2695,7 @@ fn check_method_argument_types<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
                              tuple_arguments);
         ty::FnConverging(ty::mk_err())
     } else {
-        match ty::get(method_fn_ty).sty {
+        match method_fn_ty.sty {
             ty::ty_bare_fn(ref fty) => {
                 // HACK(eddyb) ignore self in the definition (see above).
                 check_argument_types(fcx,
@@ -2743,7 +2743,7 @@ fn check_argument_types<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
     let expected_arg_count = fn_inputs.len();
     let formal_tys = if tuple_arguments == TupleArguments {
         let tuple_type = structurally_resolved_type(fcx, sp, fn_inputs[0]);
-        match ty::get(tuple_type).sty {
+        match tuple_type.sty {
             ty::ty_tup(ref arg_types) => {
                 if arg_types.len() != args.len() {
                     span_err!(tcx.sess, sp, E0057,
@@ -2834,7 +2834,7 @@ fn check_argument_types<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
 
                 match deref_args {
                     DoDerefArgs => {
-                        match ty::get(formal_ty).sty {
+                        match formal_ty.sty {
                             ty::ty_rptr(_, mt) => formal_ty = mt.ty,
                             ty::ty_err => (),
                             _ => {
@@ -2866,7 +2866,7 @@ fn check_argument_types<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
             // in C but we just error out instead and require explicit casts.
             let arg_ty = structurally_resolved_type(fcx, arg.span,
                                                     fcx.expr_ty(&***arg));
-            match ty::get(arg_ty).sty {
+            match arg_ty.sty {
                 ty::ty_float(ast::TyF32) => {
                     fcx.type_error_message(arg.span,
                                            |t| {
@@ -3298,7 +3298,7 @@ fn lookup_op_method<'a, 'tcx>(fcx: &'a FnCtxt<'a, 'tcx>,
                 //   could also solve this with variance or different
                 //   traits that don't force left and right to have same
                 //   type.
-                let (adj_ty, adjustment) = match ty::get(lhs_ty).sty {
+                let (adj_ty, adjustment) = match lhs_ty.sty {
                     ty::ty_rptr(r_in, mt) => {
                         let r_adj = fcx.infcx().next_region_var(infer::Autoref(lhs.span));
                         fcx.mk_subr(infer::Reborrow(lhs.span), r_adj, r_in);
@@ -3700,7 +3700,7 @@ fn check_field(fcx: &FnCtxt,
         // FIXME(eddyb) #12808 Integrate privacy into this auto-deref loop.
         let (_, autoderefs, field_ty) =
             autoderef(fcx, expr.span, expr_t, Some(base.id), lvalue_pref, |base_t, _| {
-                match ty::get(base_t).sty {
+                match base_t.sty {
                     ty::ty_struct(base_id, ref substs) => {
                         debug!("struct named {}", ppaux::ty_to_string(tcx, base_t));
                         let fields = ty::lookup_struct_fields(tcx, base_id);
@@ -3761,7 +3761,7 @@ fn check_tup_field(fcx: &FnCtxt,
         // FIXME(eddyb) #12808 Integrate privacy into this auto-deref loop.
         let (_, autoderefs, field_ty) =
             autoderef(fcx, expr.span, expr_t, Some(base.id), lvalue_pref, |base_t, _| {
-                match ty::get(base_t).sty {
+                match base_t.sty {
                     ty::ty_struct(base_id, ref substs) => {
                         tuple_like = ty::is_tuple_struct(tcx, base_id);
                         if tuple_like {
@@ -4092,7 +4092,7 @@ fn check_struct_fields_on_error(fcx: &FnCtxt,
                                                            Some(&**oprnd), oprnd_t, lvalue_pref) {
                             Some(mt) => mt.ty,
                             None => {
-                                let is_newtype = match ty::get(oprnd_t).sty {
+                                let is_newtype = match oprnd_t.sty {
                                     ty::ty_struct(did, ref substs) => {
                                         let fields = ty::struct_fields(fcx.tcx(), did, substs);
                                         fields.len() == 1
@@ -4121,7 +4121,7 @@ fn check_struct_fields_on_error(fcx: &FnCtxt,
                     oprnd_t = structurally_resolved_type(fcx, oprnd.span,
                                                          oprnd_t);
                     if !(ty::type_is_integral(oprnd_t) ||
-                         ty::get(oprnd_t).sty == ty::ty_bool) {
+                         oprnd_t.sty == ty::ty_bool) {
                         oprnd_t = check_user_unop(fcx, "!", "not",
                                                   tcx.lang_items.not_trait(),
                                                   expr, &**oprnd, oprnd_t);
@@ -4387,7 +4387,7 @@ fn check_struct_fields_on_error(fcx: &FnCtxt,
       ast::ExprVec(ref args) => {
         let uty = match expected {
             ExpectHasType(uty) => {
-                match ty::get(uty).sty {
+                match uty.sty {
                         ty::ty_vec(ty, _) => Some(ty),
                         _ => None
                 }
@@ -4419,7 +4419,7 @@ fn check_struct_fields_on_error(fcx: &FnCtxt,
 
         let uty = match expected {
             ExpectHasType(uty) => {
-                match ty::get(uty).sty {
+                match uty.sty {
                         ty::ty_vec(ty, _) => Some(ty),
                         _ => None
                 }
@@ -4510,7 +4510,7 @@ fn check_struct_fields_on_error(fcx: &FnCtxt,
             Some(def) => {
                 // Verify that this was actually a struct.
                 let typ = ty::lookup_item_type(fcx.ccx.tcx, def.def_id());
-                match ty::get(typ.ty).sty {
+                match typ.ty.sty {
                     ty::ty_struct(struct_did, _) => {
                         check_struct_constructor(fcx,
                                                  id,
@@ -4733,7 +4733,7 @@ fn map<'a>(self, fcx: &FnCtxt<'a, 'tcx>,
                -> Expectation<'tcx> {
         match self.resolve(fcx) {
             NoExpectation => NoExpectation,
-            ExpectCastableToType(t) | ExpectHasType(t) => unpack(&ty::get(t).sty),
+            ExpectCastableToType(t) | ExpectHasType(t) => unpack(&t.sty),
         }
     }
 
@@ -4744,7 +4744,7 @@ fn map_to_option<'a, O>(self,
     {
         match self.resolve(fcx) {
             NoExpectation => None,
-            ExpectCastableToType(t) | ExpectHasType(t) => unpack(&ty::get(t).sty),
+            ExpectCastableToType(t) | ExpectHasType(t) => unpack(&t.sty),
         }
     }
 }
@@ -5042,7 +5042,7 @@ pub fn check_simd(tcx: &ty::ctxt, sp: Span, id: ast::NodeId) {
         span_err!(tcx.sess, sp, E0074, "SIMD vector cannot be generic");
         return;
     }
-    match ty::get(t).sty {
+    match t.sty {
         ty::ty_struct(did, ref substs) => {
             let fields = ty::lookup_struct_fields(tcx, did);
             if fields.is_empty() {
@@ -5750,7 +5750,7 @@ pub fn structurally_resolved_type<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, sp: Span,
 // Returns the one-level-deep structure of the given type.
 pub fn structure_of<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, sp: Span, typ: Ty<'tcx>)
                         -> &'tcx ty::sty<'tcx> {
-    &ty::get(structurally_resolved_type(fcx, sp, typ)).sty
+    &structurally_resolved_type(fcx, sp, typ).sty
 }
 
 // Returns true if b contains a break that can exit from b
@@ -5789,7 +5789,7 @@ pub fn check_bounds_are_used<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
     let mut tps_used = Vec::from_elem(tps.len(), false);
 
     ty::walk_ty(ty, |t| {
-            match ty::get(t).sty {
+            match t.sty {
                 ty::ty_param(ParamTy {idx, ..}) => {
                     debug!("Found use of ty param num {}", idx);
                     tps_used[idx] = true;
index ced8b4870874a09f7235dc168016251e94010182..44c11318038d39c244c78072b8f5cc8f1abeadc5 100644 (file)
@@ -693,7 +693,7 @@ fn visit_expr(rcx: &mut Rcx, expr: &ast::Expr) {
                 }
                 None => rcx.resolve_node_type(base.id)
             };
-            match ty::get(base_ty).sty {
+            match base_ty.sty {
                 ty::ty_rptr(r_ptr, _) => {
                     mk_subregion_due_to_dereference(rcx, expr.span,
                                                     ty::ReScope(expr.id), r_ptr);
@@ -814,7 +814,7 @@ fn walk_cast<'a, 'tcx>(rcx: &mut Rcx<'a, 'tcx>,
         debug!("walk_cast(from_ty={}, to_ty={})",
                from_ty.repr(rcx.tcx()),
                to_ty.repr(rcx.tcx()));
-        match (&ty::get(from_ty).sty, &ty::get(to_ty).sty) {
+        match (&from_ty.sty, &to_ty.sty) {
             /*From:*/ (&ty::ty_rptr(from_r, ref from_mt),
             /*To:  */  &ty::ty_rptr(to_r, ref to_mt)) => {
                 // Target cannot outlive source, naturally.
@@ -846,7 +846,7 @@ fn check_expr_fn_block(rcx: &mut Rcx,
     let tcx = rcx.fcx.tcx();
     let function_type = rcx.resolve_node_type(expr.id);
 
-    match ty::get(function_type).sty {
+    match function_type.sty {
         ty::ty_closure(box ty::ClosureTy{store: ty::RegionTraitStore(..),
                                          ref bounds,
                                          ..}) => {
@@ -889,7 +889,7 @@ fn check_expr_fn_block(rcx: &mut Rcx,
     visit::walk_expr(rcx, expr);
     rcx.set_repeating_scope(repeating_scope);
 
-    match ty::get(function_type).sty {
+    match function_type.sty {
         ty::ty_closure(box ty::ClosureTy { store: ty::RegionTraitStore(..), .. }) => {
             ty::with_freevars(tcx, expr.id, |freevars| {
                 propagate_upupvar_borrow_kind(rcx, expr, freevars);
@@ -905,7 +905,7 @@ fn check_expr_fn_block(rcx: &mut Rcx,
         _ => {}
     }
 
-    match ty::get(function_type).sty {
+    match function_type.sty {
         ty::ty_closure(box ty::ClosureTy {bounds, ..}) => {
             ty::with_freevars(tcx, expr.id, |freevars| {
                 ensure_free_variable_types_outlive_closure_bound(rcx, bounds, expr, freevars);
@@ -1092,7 +1092,7 @@ fn constrain_callee(rcx: &mut Rcx,
     let call_region = ty::ReScope(call_expr.id);
 
     let callee_ty = rcx.resolve_node_type(callee_id);
-    match ty::get(callee_ty).sty {
+    match callee_ty.sty {
         ty::ty_bare_fn(..) => { }
         ty::ty_closure(ref closure_ty) => {
             let region = match closure_ty.store {
@@ -1204,7 +1204,7 @@ fn constrain_autoderefs<'a, 'tcx>(rcx: &mut Rcx<'a, 'tcx>,
                 // was applied on the base type, as that is always the case.
                 let fn_sig = ty::ty_fn_sig(method.ty);
                 let self_ty = fn_sig.inputs[0];
-                let (m, r) = match ty::get(self_ty).sty {
+                let (m, r) = match self_ty.sty {
                     ty::ty_rptr(r, ref m) => (m.mutbl, r),
                     _ => rcx.tcx().sess.span_bug(deref_expr.span,
                             format!("bad overloaded deref type {}",
@@ -1232,7 +1232,7 @@ fn constrain_autoderefs<'a, 'tcx>(rcx: &mut Rcx<'a, 'tcx>,
             None => derefd_ty
         };
 
-        match ty::get(derefd_ty).sty {
+        match derefd_ty.sty {
             ty::ty_rptr(r_ptr, _) => {
                 mk_subregion_due_to_dereference(rcx, deref_expr.span,
                                                 r_deref_expr, r_ptr);
@@ -1272,8 +1272,8 @@ fn constrain_index<'a, 'tcx>(rcx: &mut Rcx<'a, 'tcx>,
            rcx.fcx.infcx().ty_to_string(indexed_ty));
 
     let r_index_expr = ty::ReScope(index_expr.id);
-    match ty::get(indexed_ty).sty {
-        ty::ty_rptr(r_ptr, mt) => match ty::get(mt.ty).sty {
+    match indexed_ty.sty {
+        ty::ty_rptr(r_ptr, mt) => match mt.ty.sty {
             ty::ty_vec(_, None) | ty::ty_str => {
                 rcx.fcx.mk_subr(infer::IndexSlice(index_expr.span),
                                 r_index_expr, r_ptr);
index d23131962873f6d2c38c1073e92446344c598f70..9fd24c4ee784e411a0bfc2df0a9bff9bc391388f 100644 (file)
@@ -59,7 +59,7 @@ fn accumulate_from_ty(&mut self, ty: Ty<'tcx>) {
         debug!("Wf::accumulate_from_ty(ty={})",
                ty.repr(self.tcx));
 
-        match ty::get(ty).sty {
+        match ty.sty {
             ty::ty_bool |
             ty::ty_char |
             ty::ty_int(..) |
index 5b5c6fe51e8c4fd76c5a2729cede6a2ade941894..99ffe898622297fc6cd86e77b93ae597b3c6eafd 100644 (file)
@@ -39,7 +39,7 @@ pub fn check_object_cast<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
     let source_ty = fcx.expr_ty(source_expr);
     let source_ty = structurally_resolved_type(fcx, source_expr.span, source_ty);
     debug!("source_ty={}", source_ty.repr(fcx.tcx()));
-    match (&ty::get(source_ty).sty, &ty::get(target_object_ty).sty) {
+    match (&source_ty.sty, &target_object_ty.sty) {
         (&ty::ty_uniq(referent_ty), &ty::ty_uniq(object_trait_ty)) => {
             let object_trait = object_trait(&object_trait_ty);
 
@@ -97,7 +97,7 @@ pub fn check_object_cast<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
     }
 
     fn object_trait<'a, 'tcx>(t: &'a Ty<'tcx>) -> &'a ty::TyTrait<'tcx> {
-        match ty::get(*t).sty {
+        match t.sty {
             ty::ty_trait(ref ty_trait) => &**ty_trait,
             _ => panic!("expected ty_trait")
         }
index 3557059951500d8cc9f467dda46b370892e9a912..5cc619bba26ba48148dc85a4547de1dfd244abc7 100644 (file)
@@ -193,7 +193,7 @@ fn check_impl(&mut self,
                 fcx.tcx().lang_items.drop_trait() == Some(trait_ref.def_id) &&
                 !attr::contains_name(item.attrs.as_slice(), "unsafe_destructor")
             {
-                match ty::get(self_ty).sty {
+                match self_ty.sty {
                     ty::ty_struct(def_id, _) |
                     ty::ty_enum(def_id, _) => {
                         check_struct_safe_for_destructor(fcx, item.span, self_ty, def_id);
@@ -336,7 +336,7 @@ fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
             None => { }
         }
 
-        match ty::get(t).sty{
+        match t.sty{
             ty::ty_struct(type_id, ref substs) |
             ty::ty_enum(type_id, ref substs) => {
                 let polytype = ty::lookup_item_type(self.fcx.tcx(), type_id);
index c12aed77342746411f5a6650609fb317af7ca358..1f32110a0933883744d33461d60a96af2354428a 100644 (file)
@@ -20,7 +20,6 @@
 use metadata::csearch;
 use middle::subst;
 use middle::subst::{Substs};
-use middle::ty::get;
 use middle::ty::{ImplContainer, ImplOrTraitItemId, MethodTraitItemId};
 use middle::ty::{TypeTraitItemId, lookup_item_type};
 use middle::ty::{Ty, ty_bool, ty_char, ty_enum, ty_err};
@@ -71,7 +70,7 @@ fn get_base_type<'a, 'tcx>(inference_context: &InferCtxt<'a, 'tcx>,
         }
     };
 
-    match get(resolved_type).sty {
+    match resolved_type.sty {
         ty_enum(..) | ty_struct(..) | ty_unboxed_closure(..) => {
             debug!("(getting base type) found base type");
             Some(resolved_type)
@@ -87,7 +86,7 @@ fn get_base_type<'a, 'tcx>(inference_context: &InferCtxt<'a, 'tcx>,
         ty_infer(..) | ty_param(..) | ty_err | ty_open(..) | ty_uniq(_) |
         ty_ptr(_) | ty_rptr(_, _) => {
             debug!("(getting base type) no base type; found {}",
-                   get(original_type).sty);
+                   original_type.sty);
             None
         }
         ty_trait(..) => panic!("should have been caught")
@@ -102,7 +101,7 @@ fn get_base_type_def_id<'a, 'tcx>(inference_context: &InferCtxt<'a, 'tcx>,
     match get_base_type(inference_context, span, original_type) {
         None => None,
         Some(base_type) => {
-            match get(base_type).sty {
+            match base_type.sty {
                 ty_enum(def_id, _) |
                 ty_struct(def_id, _) |
                 ty_unboxed_closure(def_id, _, _) => {
@@ -111,7 +110,7 @@ fn get_base_type_def_id<'a, 'tcx>(inference_context: &InferCtxt<'a, 'tcx>,
                 ty_ptr(ty::mt {ty, ..}) |
                 ty_rptr(_, ty::mt {ty, ..}) |
                 ty_uniq(ty) => {
-                    match ty::get(ty).sty {
+                    match ty.sty {
                         ty_trait(box ty::TyTrait { ref principal, .. }) => {
                             Some(principal.def_id)
                         }
@@ -442,7 +441,7 @@ fn populate_destructor_table(&self) {
             let method_def_id = items[0];
 
             let self_type = self.get_self_type_for_implementation(impl_did);
-            match ty::get(self_type.ty).sty {
+            match self_type.ty.sty {
                 ty::ty_enum(type_def_id, _) |
                 ty::ty_struct(type_def_id, _) |
                 ty::ty_unboxed_closure(type_def_id, _, _) => {
index ba362fb878c81b8d85c2c903ec2d70635ae05e99..57ce7f79e030a11b3d18790bf93ee1098999863f 100644 (file)
@@ -51,7 +51,7 @@ fn visit_item(&mut self, item: &'v ast::Item) {
                 // defined in this crate.
                 debug!("coherence2::orphan check: inherent impl {}", item.repr(self.tcx));
                 let self_ty = ty::lookup_item_type(self.tcx, def_id).ty;
-                match ty::get(self_ty).sty {
+                match self_ty.sty {
                     ty::ty_enum(def_id, _) |
                     ty::ty_struct(def_id, _) => {
                         self.check_def_id(item.span, def_id);
index 8ed630e88618954cba5eabe3a3cfb8e6a15e732e..b0e8b664d06d7d7189d00d8ae88a6fbd47921575 100644 (file)
@@ -663,7 +663,7 @@ fn is_associated_type_valid_for_param(ty: Ty,
                                       trait_id: ast::DefId,
                                       generics: &ty::Generics)
                                       -> bool {
-    match ty::get(ty).sty {
+    match ty.sty {
         ty::ty_param(param_ty) => {
             let type_parameter = generics.types.get(param_ty.space,
                                                     param_ty.idx);
@@ -694,7 +694,7 @@ fn find_associated_type_in_generics<'tcx>(tcx: &ty::ctxt<'tcx>,
         Some(ty) => ty,
     };
 
-    match ty::get(ty).sty {
+    match ty.sty {
         ty::ty_param(ref param_ty) => {
             /*let type_parameter = generics.types.get(param_ty.space,
                                                     param_ty.idx);
@@ -722,7 +722,7 @@ fn find_associated_type_in_generics<'tcx>(tcx: &ty::ctxt<'tcx>,
 }
 
 fn type_is_self(ty: Ty) -> bool {
-    match ty::get(ty).sty {
+    match ty.sty {
         ty::ty_param(ref param_ty) if param_ty.is_self() => true,
         _ => false,
     }
@@ -1908,7 +1908,7 @@ fn get_or_create_type_parameter_def<'tcx,AC>(this: &AC,
             let cur_idx = index;
 
             ty::walk_ty(ty, |t| {
-                match ty::get(t).sty {
+                match t.sty {
                     ty::ty_param(p) => if p.idx > cur_idx {
                         span_err!(this.tcx().sess, path.span, E0128,
                                   "type parameters with a default cannot use \
@@ -2150,7 +2150,7 @@ fn check_method_self_type<'a, 'tcx, RS:RegionScope>(
     match explicit_self.node {
         ast::SelfExplicit(ref ast_type, _) => {
             let typ = crate_context.to_ty(rs, &**ast_type);
-            let base_type = match ty::get(typ).sty {
+            let base_type = match typ.sty {
                 ty::ty_ptr(tm) | ty::ty_rptr(_, tm) => tm.ty,
                 ty::ty_uniq(typ) => typ,
                 _ => typ,
index c2e9a5d513325a73cbadc8047f044b4efca9ad54..49ac7178eb8db48d2fed3f25d59c2be8fc88e896 100644 (file)
@@ -105,9 +105,9 @@ pub fn tys(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> CoerceResult<'tcx> {
         //
         // Note: does not attempt to resolve type variables we encounter.
         // See above for details.
-        match ty::get(b).sty {
+        match b.sty {
             ty::ty_ptr(mt_b) => {
-                match ty::get(mt_b.ty).sty {
+                match mt_b.ty.sty {
                     ty::ty_str => {
                         return self.unpack_actual_value(a, |sty_a| {
                             self.coerce_unsafe_ptr(a, sty_a, b, ast::MutImmutable)
@@ -134,7 +134,7 @@ pub fn tys(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> CoerceResult<'tcx> {
             }
 
             ty::ty_rptr(_, mt_b) => {
-                match ty::get(mt_b.ty).sty {
+                match mt_b.ty.sty {
                     ty::ty_str => {
                         return self.unpack_actual_value(a, |sty_a| {
                             self.coerce_borrowed_pointer(a, sty_a, b, ast::MutImmutable)
@@ -202,7 +202,7 @@ pub fn unpack_actual_value<T>(&self, a: Ty<'tcx>, f: |&ty::sty<'tcx>| -> T)
         match resolve_type(self.get_ref().infcx, None,
                            a, try_resolve_tvar_shallow) {
             Ok(t) => {
-                f(&ty::get(t).sty)
+                f(&t.sty)
             }
             Err(e) => {
                 self.get_ref().infcx.tcx.sess.span_bug(
@@ -273,7 +273,7 @@ fn coerce_unsized(&self,
 
         let sub = Sub(self.get_ref().clone());
 
-        let sty_b = &ty::get(b).sty;
+        let sty_b = &b.sty;
         match (sty_a, sty_b) {
             (&ty::ty_rptr(_, ty::mt{ty: t_a, mutbl: mutbl_a}), &ty::ty_rptr(_, mt_b)) => {
                 self.unpack_actual_value(t_a, |sty_a| {
@@ -472,7 +472,7 @@ fn coerce_object(&self,
         let tcx = self.get_ref().infcx.tcx;
 
         match *sty_a {
-            ty::ty_rptr(_, ty::mt{ty, mutbl}) => match ty::get(ty).sty {
+            ty::ty_rptr(_, ty::mt{ty, mutbl}) => match ty.sty {
                 ty::ty_trait(box ty::TyTrait { ref principal, bounds }) => {
                     debug!("mutbl={} b_mutbl={}", mutbl, b_mutbl);
                     // FIXME what is purpose of this type `tr`?
index 811284cdd727892c558bbe38a422fd79f06f7bc5..763f204dc98bc5b942524195a0d32784d67b5483 100644 (file)
@@ -329,8 +329,8 @@ pub fn super_tys<'tcx, C: Combine<'tcx>>(this: &C,
                                          -> cres<'tcx, Ty<'tcx>> {
 
     let tcx = this.infcx().tcx;
-    let a_sty = &ty::get(a).sty;
-    let b_sty = &ty::get(b).sty;
+    let a_sty = &a.sty;
+    let b_sty = &b.sty;
     debug!("super_tys: a_sty={} b_sty={}", a_sty, b_sty);
     return match (a_sty, b_sty) {
       // The "subtype" ought to be handling cases involving var:
@@ -387,7 +387,7 @@ pub fn super_tys<'tcx, C: Combine<'tcx>>(this: &C,
       (&ty::ty_int(_), _) |
       (&ty::ty_uint(_), _) |
       (&ty::ty_float(_), _) => {
-        if ty::get(a).sty == ty::get(b).sty {
+        if a == b {
             Ok(a)
         } else {
             Err(ty::terr_sorts(expected_found(this, a, b)))
@@ -449,7 +449,7 @@ pub fn super_tys<'tcx, C: Combine<'tcx>>(this: &C,
             // used to use covariant subtyping. I have preserved this behaviour,
             // even though it is probably incorrect. So don't go down the usual
             // path which would require invariance.
-            let mt = match (&ty::get(a_mt.ty).sty, &ty::get(b_mt.ty).sty) {
+            let mt = match (&a_mt.ty.sty, &b_mt.ty.sty) {
                 (&ty::ty_trait(..), &ty::ty_trait(..)) if a_mt.mutbl == b_mt.mutbl => {
                     let ty = try!(this.tys(a_mt.ty, b_mt.ty));
                     ty::mt { ty: ty, mutbl: a_mt.mutbl }
@@ -692,7 +692,7 @@ fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
         //
         // (In particular, you could have something like `$0 = Box<$1>`
         //  where `$1` has already been instantiated with `Box<$0>`)
-        match ty::get(t).sty {
+        match t.sty {
             ty::ty_infer(ty::TyVar(vid)) => {
                 if vid == self.for_vid {
                     self.cycle_detected = true;
index 86c51fff640e79aab0e834816df67802caf2c3bf..356081c199afa5b9b144299cedc29c368ead685d 100644 (file)
@@ -111,7 +111,7 @@ fn tys(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> cres<'tcx, Ty<'tcx>> {
         let infcx = self.fields.infcx;
         let a = infcx.type_variables.borrow().replace_if_possible(a);
         let b = infcx.type_variables.borrow().replace_if_possible(b);
-        match (&ty::get(a).sty, &ty::get(b).sty) {
+        match (&a.sty, &b.sty) {
             (&ty::ty_infer(TyVar(a_id)), &ty::ty_infer(TyVar(b_id))) => {
                 infcx.type_variables.borrow_mut().relate_vars(a_id, EqTo, b_id);
                 Ok(a)
index 4767aa258ba9c7c8fe21ba8a05cd69a2eeb4c525..6e6c631f007490382f221058a5c68814448cb750 100644 (file)
@@ -80,7 +80,7 @@ pub fn super_lattice_tys<'tcx, L:LatticeDir<'tcx>+Combine<'tcx>>(this: &L,
     let infcx = this.infcx();
     let a = infcx.type_variables.borrow().replace_if_possible(a);
     let b = infcx.type_variables.borrow().replace_if_possible(b);
-    match (&ty::get(a).sty, &ty::get(b).sty) {
+    match (&a.sty, &b.sty) {
         (&ty::ty_infer(TyVar(..)), &ty::ty_infer(TyVar(..)))
             if infcx.type_var_diverges(a) && infcx.type_var_diverges(b) => {
             let v = infcx.next_diverging_ty_var();
index 729fbd6b337b5e5e23bda561c052b80f2a9f42a3..93c11693091c2daef28c7dd05d2dd25640eeb058 100644 (file)
@@ -528,7 +528,7 @@ pub fn skolemize<T:TypeFoldable<'tcx>>(&self, t: T) -> T {
     }
 
     pub fn type_var_diverges(&'a self, ty: Ty) -> bool {
-        match ty::get(ty).sty {
+        match ty.sty {
             ty::ty_infer(ty::TyVar(vid)) => self.type_variables.borrow().var_diverges(vid),
             _ => false
         }
@@ -838,7 +838,7 @@ pub fn contains_unbound_type_variables(&self, typ: Ty<'tcx>) -> Ty<'tcx> {
     }
 
     pub fn shallow_resolve(&self, typ: Ty<'tcx>) -> Ty<'tcx> {
-        match ty::get(typ).sty {
+        match typ.sty {
             ty::ty_infer(ty::TyVar(v)) => {
                 self.type_variables.borrow()
                     .probe(v)
@@ -878,7 +878,7 @@ pub fn resolve_type_vars_in_trait_ref_if_possible(&self,
                                   (*trait_ref).clone(),
                                   ty::region_existential_bound(ty::ReStatic));
         let dummy1 = self.resolve_type_vars_if_possible(dummy0);
-        match ty::get(dummy1).sty {
+        match dummy1.sty {
             ty::ty_trait(box ty::TyTrait { ref principal, .. }) => {
                 (*principal).clone()
             }
index f4bff7eeb7bdb0f32e0c8039ec5f4d702ad29ae1..cf5efd188ed96ed8724cf8628e9e9f8dcb40b7af 100644 (file)
@@ -159,7 +159,7 @@ pub fn resolve_type(&mut self, typ: Ty<'tcx>) -> Ty<'tcx> {
             return typ;
         }
 
-        match ty::get(typ).sty {
+        match typ.sty {
             ty::ty_infer(TyVar(vid)) => {
                 self.resolve_ty_var(vid)
             }
index 3c9a1345c47bf17e9c93ef4e7a514830a9cc5752..5907a2bb9b61d945d2eee360d7ea99653f65d937 100644 (file)
@@ -113,7 +113,7 @@ fn fold_region(&mut self, r: ty::Region) -> ty::Region {
     }
 
     fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
-        match ty::get(t).sty {
+        match t.sty {
             ty::ty_infer(ty::TyVar(v)) => {
                 self.skolemize(self.infcx.type_variables.borrow().probe(v),
                                ty::TyVar(v),
index ec260c6c363040e82ccd0169b2d09dc7975111c1..65d2a5133936c974e6ab42e6ca258b74de13b9ed 100644 (file)
@@ -127,7 +127,7 @@ fn tys(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> cres<'tcx, Ty<'tcx>> {
         let infcx = self.fields.infcx;
         let a = infcx.type_variables.borrow().replace_if_possible(a);
         let b = infcx.type_variables.borrow().replace_if_possible(b);
-        match (&ty::get(a).sty, &ty::get(b).sty) {
+        match (&a.sty, &b.sty) {
             (&ty::ty_infer(TyVar(a_id)), &ty::ty_infer(TyVar(b_id))) => {
                 infcx.type_variables
                     .borrow_mut()
index aaa77d251933ffa72d23755510adbc1fe71fce9e..f7f7389602f8292892a8c92ee9f4c88455cb4203 100644 (file)
@@ -133,7 +133,7 @@ pub fn probe(&self, vid: ty::TyVid) -> Option<Ty<'tcx>> {
     }
 
     pub fn replace_if_possible(&self, t: Ty<'tcx>) -> Ty<'tcx> {
-        match ty::get(t).sty {
+        match t.sty {
             ty::ty_infer(ty::TyVar(v)) => {
                 match self.probe(v) {
                     None => t,
index b322dacfb1a846ce78554180bd9f55c5e5d694ef..ad64537e1533ea2c5cec285dcfd4b4fed2b746c4 100644 (file)
@@ -363,7 +363,7 @@ fn check_main_fn_ty(ccx: &CrateCtxt,
                     main_span: Span) {
     let tcx = ccx.tcx;
     let main_t = ty::node_id_to_type(tcx, main_id);
-    match ty::get(main_t).sty {
+    match main_t.sty {
         ty::ty_bare_fn(..) => {
             match tcx.map.find(main_id) {
                 Some(ast_map::NodeItem(it)) => {
@@ -410,7 +410,7 @@ fn check_start_fn_ty(ccx: &CrateCtxt,
                      start_span: Span) {
     let tcx = ccx.tcx;
     let start_t = ty::node_id_to_type(tcx, start_id);
-    match ty::get(start_t).sty {
+    match start_t.sty {
         ty::ty_bare_fn(_) => {
             match tcx.map.find(start_id) {
                 Some(ast_map::NodeItem(it)) => {
index 27b9d9d19da3cc74aa4af1b3e653b3971c4dbaf7..b20ab0b05488025e6c685ba59772c6214f9de67a 100644 (file)
@@ -729,7 +729,7 @@ fn add_constraints_from_ty(&mut self,
                                variance: VarianceTermPtr<'a>) {
         debug!("add_constraints_from_ty(ty={})", ty.repr(self.tcx()));
 
-        match ty::get(ty).sty {
+        match ty.sty {
             ty::ty_bool |
             ty::ty_char | ty::ty_int(_) | ty::ty_uint(_) |
             ty::ty_float(_) | ty::ty_str => {
index 68c6459820ce1682e6dba7a61ac43ab3f2413c7e..2591051e9b90a23e808f6f1b488bbe71ffbfe1f7 100644 (file)
@@ -1300,9 +1300,7 @@ fn visit_expr(&mut self, ex: &ast::Expr) {
 
                 self.visit_expr(&**sub_ex);
 
-                let t = ty::expr_ty_adjusted(&self.analysis.ty_cx, &**sub_ex);
-                let t_box = ty::get(t);
-                match t_box.sty {
+                match ty::expr_ty_adjusted(&self.analysis.ty_cx, &**sub_ex).sty {
                     ty::ty_struct(def_id, _) => {
                         let fields = ty::lookup_struct_fields(&self.analysis.ty_cx, def_id);
                         for f in fields.iter() {
@@ -1328,9 +1326,7 @@ fn visit_expr(&mut self, ex: &ast::Expr) {
 
                 self.visit_expr(&**sub_ex);
 
-                let t = ty::expr_ty_adjusted(&self.analysis.ty_cx, &**sub_ex);
-                let t_box = ty::get(t);
-                match t_box.sty {
+                match ty::expr_ty_adjusted(&self.analysis.ty_cx, &**sub_ex).sty {
                     ty::ty_struct(def_id, _) => {
                         let fields = ty::lookup_struct_fields(&self.analysis.ty_cx, def_id);
                         for (i, f) in fields.iter().enumerate() {
index 8d16e56d435aa221969b2aeb7835b0e30c620579..de406cff6e74124378a5cbce2f472bd0eefbf961 100644 (file)
@@ -811,10 +811,10 @@ fn compare_str<'blk, 'tcx>(cx: Block<'blk, 'tcx>,
         return Result::new(rs.bcx, rs.val);
     }
 
-    match ty::get(rhs_t).sty {
-        ty::ty_rptr(_, mt) => match ty::get(mt.ty).sty {
+    match rhs_t.sty {
+        ty::ty_rptr(_, mt) => match mt.ty.sty {
             ty::ty_str => compare_str(cx, lhs, rhs, rhs_t),
-            ty::ty_vec(ty, _) => match ty::get(ty).sty {
+            ty::ty_vec(ty, _) => match ty.sty {
                 ty::ty_uint(ast::TyU8) => {
                     // NOTE: cast &[u8] to &str and abuse the str_eq lang item,
                     // which calls memcmp().
@@ -1034,7 +1034,7 @@ fn compile_submatch_continue<'a, 'p, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
     } else if any_uniq_pat(m, col) || any_region_pat(m, col) {
         Some(vec!(Load(bcx, val)))
     } else {
-        match ty::get(left_ty).sty {
+        match left_ty.sty {
             ty::ty_vec(_, Some(n)) => {
                 let args = extract_vec_elems(bcx, left_ty, n, 0, val);
                 Some(args.vals)
index eaf3f904107b2c561ccfa0b055abd7824fd4df3c..c5f66cf0c542ffbda014fa31bbf649ecb305d271 100644 (file)
@@ -166,7 +166,7 @@ pub fn represent_type<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
 
 fn represent_type_uncached<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
                                      t: Ty<'tcx>) -> Repr<'tcx> {
-    match ty::get(t).sty {
+    match t.sty {
         ty::ty_tup(ref elems) => {
             Univariant(mk_struct(cx, elems.as_slice(), false, t), false)
         }
@@ -306,9 +306,9 @@ fn is_zerolen<'a>(&self, cx: &CrateContext<'a, 'tcx>, scapegoat: Ty<'tcx>) -> bo
 
     fn find_ptr<'a>(&self, cx: &CrateContext<'a, 'tcx>) -> Option<PointerField> {
         for (i, &ty) in self.tys.iter().enumerate() {
-            match ty::get(ty).sty {
+            match ty.sty {
                 // &T/&mut T/Box<T> could either be a thin or fat pointer depending on T
-                ty::ty_rptr(_, ty::mt { ty, .. }) | ty::ty_uniq(ty) => match ty::get(ty).sty {
+                ty::ty_rptr(_, ty::mt { ty, .. }) | ty::ty_uniq(ty) => match ty.sty {
                     // &[T] and &str are a pointer and length pair
                     ty::ty_vec(_, None) | ty::ty_str => return Some(FatPointer(i)),
 
index cce5ce63c4dc9dc5880dac0ed100134533aa753d..b3f64e3fd798c612a4a5ae1abad7be32834c2dd5 100644 (file)
@@ -266,7 +266,7 @@ pub fn kind_for_unboxed_closure(ccx: &CrateContext, closure_id: ast::DefId)
 
 pub fn decl_rust_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
                               fn_ty: Ty<'tcx>, name: &str) -> ValueRef {
-    let (inputs, output, abi, env) = match ty::get(fn_ty).sty {
+    let (inputs, output, abi, env) = match fn_ty.sty {
         ty::ty_bare_fn(ref f) => {
             (f.sig.inputs.clone(), f.sig.output, f.abi, None)
         }
@@ -561,7 +561,7 @@ pub fn compare_scalar_types<'blk, 'tcx>(cx: Block<'blk, 'tcx>,
                                         -> Result<'blk, 'tcx> {
     let f = |a| Result::new(cx, compare_scalar_values(cx, lhs, rhs, a, op));
 
-    match ty::get(t).sty {
+    match t.sty {
         ty::ty_tup(ref tys) if tys.is_empty() => f(nil_type),
         ty::ty_bool | ty::ty_uint(_) | ty::ty_char => f(unsigned_int),
         ty::ty_ptr(mt) if ty::type_is_sized(cx.tcx(), mt.ty) => f(unsigned_int),
@@ -642,7 +642,7 @@ pub fn compare_simd_types<'blk, 'tcx>(
                     size: uint,
                     op: ast::BinOp)
                     -> ValueRef {
-    match ty::get(t).sty {
+    match t.sty {
         ty::ty_float(_) => {
             // The comparison operators for floating point vectors are challenging.
             // LLVM outputs a `< size x i1 >`, but if we perform a sign extension
@@ -711,7 +711,7 @@ fn iter_variant<'a, 'blk, 'tcx>(cx: Block<'blk, 'tcx>,
     };
 
     let mut cx = cx;
-    match ty::get(t).sty {
+    match t.sty {
       ty::ty_struct(..) => {
           let repr = adt::represent_type(cx.ccx(), t);
           expr::with_field_tys(cx.tcx(), t, None, |discr, field_tys| {
@@ -871,7 +871,7 @@ pub fn fail_if_zero_or_overflows<'blk, 'tcx>(
         ("attempted remainder with a divisor of zero",
          "attempted remainder with overflow")
     };
-    let (is_zero, is_signed) = match ty::get(rhs_t).sty {
+    let (is_zero, is_signed) = match rhs_t.sty {
         ty::ty_int(t) => {
             let zero = C_integral(Type::int_from_ty(cx.ccx(), t), 0u64, false);
             (ICmp(cx, llvm::IntEQ, rhs, zero), true)
@@ -899,7 +899,7 @@ pub fn fail_if_zero_or_overflows<'blk, 'tcx>(
     // signed division/remainder which would trigger overflow. For unsigned
     // integers, no action beyond checking for zero need be taken.
     if is_signed {
-        let (llty, min) = match ty::get(rhs_t).sty {
+        let (llty, min) = match rhs_t.sty {
             ty::ty_int(t) => {
                 let llty = Type::int_from_ty(cx.ccx(), t);
                 let min = match t {
@@ -932,7 +932,7 @@ pub fn fail_if_zero_or_overflows<'blk, 'tcx>(
 pub fn trans_external_path<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
                                      did: ast::DefId, t: Ty<'tcx>) -> ValueRef {
     let name = csearch::get_symbol(&ccx.sess().cstore, did);
-    match ty::get(t).sty {
+    match t.sty {
         ty::ty_bare_fn(ref fn_ty) => {
             match ccx.sess().target.target.adjust_abi(fn_ty.abi) {
                 Rust | RustCall => {
@@ -1564,7 +1564,7 @@ fn create_datums_for_fn_args_under_call_abi<'blk, 'tcx>(
         }
 
         // This is the last argument. Tuple it.
-        match ty::get(arg_ty).sty {
+        match arg_ty.sty {
             ty::ty_tup(ref tupled_arg_tys) => {
                 let tuple_args_scope_id = cleanup::CustomScope(arg_scope);
                 let tuple =
@@ -1661,7 +1661,7 @@ fn copy_unboxed_closure_args_to_allocas<'blk, 'tcx>(
                       arg_datum.to_lvalue_datum_in_scope(bcx,
                                                          "argtuple",
                                                          arg_scope_id));
-    let untupled_arg_types = match ty::get(monomorphized_arg_types[0]).sty {
+    let untupled_arg_types = match monomorphized_arg_types[0].sty {
         ty::ty_tup(ref types) => types.as_slice(),
         _ => {
             bcx.tcx().sess.span_bug(args[0].pat.span,
@@ -1978,7 +1978,7 @@ pub fn trans_named_tuple_constructor<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
     let ccx = bcx.fcx.ccx;
     let tcx = ccx.tcx();
 
-    let result_ty = match ty::get(ctor_ty).sty {
+    let result_ty = match ctor_ty.sty {
         ty::ty_bare_fn(ref bft) => bft.sig.output.unwrap(),
         _ => ccx.sess().bug(
             format!("trans_enum_variant_constructor: \
@@ -2050,7 +2050,7 @@ fn trans_enum_variant_or_tuple_like_struct<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx
     let ctor_ty = ty::node_id_to_type(ccx.tcx(), ctor_id);
     let ctor_ty = ctor_ty.subst(ccx.tcx(), param_substs);
 
-    let result_ty = match ty::get(ctor_ty).sty {
+    let result_ty = match ctor_ty.sty {
         ty::ty_bare_fn(ref bft) => bft.sig.output,
         _ => ccx.sess().bug(
             format!("trans_enum_variant_or_tuple_like_struct: \
@@ -2387,7 +2387,7 @@ fn register_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
                          node_id: ast::NodeId,
                          node_type: Ty<'tcx>)
                          -> ValueRef {
-    match ty::get(node_type).sty {
+    match node_type.sty {
         ty::ty_bare_fn(ref f) => {
             assert!(f.abi == Rust || f.abi == RustCall);
         }
@@ -2403,7 +2403,7 @@ pub fn get_fn_llvm_attributes<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_ty: Ty<
                                         -> llvm::AttrBuilder {
     use middle::ty::{BrAnon, ReLateBound};
 
-    let (fn_sig, abi, has_env) = match ty::get(fn_ty).sty {
+    let (fn_sig, abi, has_env) = match fn_ty.sty {
         ty::ty_closure(ref f) => (f.sig.clone(), f.abi, true),
         ty::ty_bare_fn(ref f) => (f.sig.clone(), f.abi, false),
         ty::ty_unboxed_closure(closure_did, _, ref substs) => {
@@ -2425,11 +2425,11 @@ pub fn get_fn_llvm_attributes<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_ty: Ty<
 
     // These have an odd calling convention, so we need to manually
     // unpack the input ty's
-    let input_tys = match ty::get(fn_ty).sty {
+    let input_tys = match fn_ty.sty {
         ty::ty_unboxed_closure(_, _, _) => {
             assert!(abi == RustCall);
 
-            match ty::get(fn_sig.inputs[0]).sty {
+            match fn_sig.inputs[0].sty {
                 ty::ty_tup(ref inputs) => inputs.clone(),
                 _ => ccx.sess().bug("expected tuple'd inputs")
             }
@@ -2437,7 +2437,7 @@ pub fn get_fn_llvm_attributes<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_ty: Ty<
         ty::ty_bare_fn(_) if abi == RustCall => {
             let mut inputs = vec![fn_sig.inputs[0]];
 
-            match ty::get(fn_sig.inputs[1]).sty {
+            match fn_sig.inputs[1].sty {
                 ty::ty_tup(ref t_in) => {
                     inputs.push_all(t_in.as_slice());
                     inputs
@@ -2469,7 +2469,7 @@ pub fn get_fn_llvm_attributes<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_ty: Ty<
         } else {
             // The `noalias` attribute on the return value is useful to a
             // function ptr caller.
-            match ty::get(ret_ty).sty {
+            match ret_ty.sty {
                 // `~` pointer return values never alias because ownership
                 // is transferred
                 ty::ty_uniq(it) if !ty::type_is_sized(ccx.tcx(), it) => {}
@@ -2480,7 +2480,7 @@ pub fn get_fn_llvm_attributes<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_ty: Ty<
             }
 
             // We can also mark the return value as `dereferenceable` in certain cases
-            match ty::get(ret_ty).sty {
+            match ret_ty.sty {
                 // These are not really pointers but pairs, (pointer, len)
                 ty::ty_uniq(it) |
                 ty::ty_rptr(_, ty::mt { ty: it, .. }) if !ty::type_is_sized(ccx.tcx(), it) => {}
@@ -2491,7 +2491,7 @@ pub fn get_fn_llvm_attributes<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_ty: Ty<
                 _ => {}
             }
 
-            match ty::get(ret_ty).sty {
+            match ret_ty.sty {
                 ty::ty_bool => {
                     attrs.ret(llvm::ZExtAttribute);
                 }
@@ -2501,7 +2501,7 @@ pub fn get_fn_llvm_attributes<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_ty: Ty<
     }
 
     for (idx, &t) in input_tys.iter().enumerate().map(|(i, v)| (i + first_arg_offset, v)) {
-        match ty::get(t).sty {
+        match t.sty {
             // this needs to be first to prevent fat pointers from falling through
             _ if !type_is_immediate(ccx, t) => {
                 let llarg_sz = llsize_of_real(ccx, type_of::type_of(ccx, t));
index c1a56dc96819d2253c1d9a70d7ce37375c4b97b0..bf7adbbecef1a847d03e2a28d58b344f96125c6c 100644 (file)
@@ -107,7 +107,7 @@ fn trans<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, expr: &ast::Expr)
     fn datum_callee<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, expr: &ast::Expr)
                                 -> Callee<'blk, 'tcx> {
         let DatumBlock {mut bcx, datum} = expr::trans(bcx, expr);
-        match ty::get(datum.ty).sty {
+        match datum.ty.sty {
             ty::ty_bare_fn(..) => {
                 let llval = datum.to_llscalarish(bcx);
                 return Callee {
@@ -163,7 +163,7 @@ fn trans_def<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                     data: NamedTupleConstructor(substs, 0)
                 }
             }
-            def::DefFn(did, _) if match ty::get(expr_ty).sty {
+            def::DefFn(did, _) if match expr_ty.sty {
                 ty::ty_bare_fn(ref f) => f.abi == synabi::RustIntrinsic,
                 _ => false
             } => {
@@ -707,7 +707,7 @@ pub fn trans_call_inner<'a, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
     let callee = get_callee(bcx, cleanup::CustomScope(arg_cleanup_scope));
     let mut bcx = callee.bcx;
 
-    let (abi, ret_ty) = match ty::get(callee_ty).sty {
+    let (abi, ret_ty) = match callee_ty.sty {
         ty::ty_bare_fn(ref f) => (f.abi, f.sig.output),
         ty::ty_closure(ref f) => (f.abi, f.sig.output),
         _ => panic!("expected bare rust fn or closure in trans_call_inner")
@@ -933,7 +933,7 @@ fn trans_args_under_call_abi<'blk, 'tcx>(
     let tuple_expr = &arg_exprs[1];
     let tuple_type = node_id_type(bcx, tuple_expr.id);
 
-    match ty::get(tuple_type).sty {
+    match tuple_type.sty {
         ty::ty_tup(ref field_types) => {
             let tuple_datum = unpack_datum!(bcx,
                                             expr::trans(bcx, &**tuple_expr));
@@ -991,7 +991,7 @@ fn trans_overloaded_call_args<'blk, 'tcx>(
 
     // Now untuple the rest of the arguments.
     let tuple_type = arg_tys[1];
-    match ty::get(tuple_type).sty {
+    match tuple_type.sty {
         ty::ty_tup(ref field_types) => {
             for (i, &field_type) in field_types.iter().enumerate() {
                 let arg_datum =
index a0ba3f4e226868dfc0dad8cb568ea13b8e5a0aea..d4c93be7eafca17c26ae6976d14de5312ed25f6f 100644 (file)
@@ -15,7 +15,6 @@
 use llvm::ValueRef;
 use middle::def;
 use middle::mem_categorization::Typer;
-use middle::subst::Substs;
 use trans::adt;
 use trans::base::*;
 use trans::build::*;
@@ -470,7 +469,7 @@ pub fn get_or_create_declaration_if_unboxed_closure<'blk, 'tcx>(bcx: Block<'blk,
     // Normalize type so differences in regions and typedefs don't cause
     // duplicate declarations
     let function_type = ty::normalize_ty(bcx.tcx(), function_type);
-    let params = match ty::get(function_type).sty {
+    let params = match function_type.sty {
         ty::ty_unboxed_closure(_, _, ref substs) => substs.types.clone(),
         _ => unreachable!()
     };
@@ -605,7 +604,7 @@ pub fn get_wrapper_for_bare_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
 
     debug!("get_wrapper_for_bare_fn(closure_ty={})", closure_ty.repr(tcx));
 
-    let f = match ty::get(closure_ty).sty {
+    let f = match closure_ty.sty {
         ty::ty_closure(ref f) => f,
         _ => {
             ccx.sess().bug(format!("get_wrapper_for_bare_fn: \
index 11d214e354902a68c0f58adc2b3c69e70036477d..9cd249f1e005dd106cd2114197899591de6696a8 100644 (file)
@@ -57,7 +57,7 @@
 
 fn type_is_newtype_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
                                        ty: Ty<'tcx>) -> bool {
-    match ty::get(ty).sty {
+    match ty.sty {
         ty::ty_struct(def_id, ref substs) => {
             let fields = ty::struct_fields(ccx.tcx(), def_id, substs);
             fields.len() == 1 &&
@@ -84,7 +84,7 @@ pub fn type_is_immediate<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ty: Ty<'tcx>) -
     if !ty::type_is_sized(tcx, ty) {
         return false;
     }
-    match ty::get(ty).sty {
+    match ty.sty {
         ty::ty_struct(..) | ty::ty_enum(..) | ty::ty_tup(..) |
         ty::ty_unboxed_closure(..) => {
             let llty = sizing_type_of(ccx, ty);
index fb08b76e3d233db8cbb8ca08b044892c99e72ec9..4213e9417276c8ac447810b58bef2ffd9c774446 100644 (file)
@@ -52,7 +52,7 @@ pub fn const_lit(cx: &CrateContext, e: &ast::Expr, lit: &ast::Lit)
         }
         ast::LitInt(i, ast::UnsuffixedIntLit(_)) => {
             let lit_int_ty = ty::node_id_to_type(cx.tcx(), e.id);
-            match ty::get(lit_int_ty).sty {
+            match lit_int_ty.sty {
                 ty::ty_int(t) => {
                     C_integral(Type::int_from_ty(cx, t), i as u64, true)
                 }
@@ -70,7 +70,7 @@ pub fn const_lit(cx: &CrateContext, e: &ast::Expr, lit: &ast::Lit)
         }
         ast::LitFloatUnsuffixed(ref fs) => {
             let lit_float_ty = ty::node_id_to_type(cx.tcx(), e.id);
-            match ty::get(lit_float_ty).sty {
+            match lit_float_ty.sty {
                 ty::ty_float(t) => {
                     C_floating(fs.get(), Type::float_from_ty(cx, t))
                 }
@@ -144,7 +144,7 @@ fn const_deref<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, v: ValueRef,
                          -> (ValueRef, Ty<'tcx>) {
     match ty::deref(t, explicit) {
         Some(ref mt) => {
-            match ty::get(t).sty {
+            match t.sty {
                 ty::ty_ptr(mt) | ty::ty_rptr(_, mt) => {
                     if ty::type_is_sized(cx.tcx(), mt.ty) {
                         (const_deref_ptr(cx, v), mt.ty)
@@ -260,7 +260,7 @@ pub fn const_expr<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, e: &ast::Expr)
                                         llconst = const_addr_of(cx, llconst, ast::MutImmutable)
                                     }
 
-                                    match ty::get(ty).sty {
+                                    match ty.sty {
                                         ty::ty_vec(unit_ty, Some(len)) => {
                                             let llunitty = type_of::type_of(cx, unit_ty);
                                             let llptr = const_ptrcast(cx, llconst, llunitty);
@@ -442,9 +442,9 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr) -> ValueRef {
                   _ => cx.sess().span_bug(index.span,
                                           "index is not an integer-constant expression")
               };
-              let (arr, len) = match ty::get(bt).sty {
+              let (arr, len) = match bt.sty {
                   ty::ty_vec(_, Some(u)) => (bv, C_uint(cx, u)),
-                  ty::ty_open(ty) => match ty::get(ty).sty {
+                  ty::ty_open(ty) => match ty.sty {
                       ty::ty_vec(_, None) | ty::ty_str => {
                           let e1 = const_get_elt(cx, bv, &[0]);
                           (const_deref_ptr(cx, e1), const_get_elt(cx, bv, &[1]))
@@ -454,7 +454,7 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr) -> ValueRef {
                                                        or string type, found {}",
                                                       ty_to_string(cx.tcx(), bt)).as_slice())
                   },
-                  ty::ty_rptr(_, mt) => match ty::get(mt.ty).sty {
+                  ty::ty_rptr(_, mt) => match mt.ty.sty {
                       ty::ty_vec(_, Some(u)) => {
                           (const_deref_ptr(cx, bv), C_uint(cx, u))
                       },
@@ -470,8 +470,8 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr) -> ValueRef {
               };
 
               let len = llvm::LLVMConstIntGetZExtValue(len) as u64;
-              let len = match ty::get(bt).sty {
-                  ty::ty_uniq(ty) | ty::ty_rptr(_, ty::mt{ty, ..}) => match ty::get(ty).sty {
+              let len = match bt.sty {
+                  ty::ty_uniq(ty) | ty::ty_rptr(_, ty::mt{ty, ..}) => match ty.sty {
                       ty::ty_str => {
                           assert!(len > 0);
                           len - 1
index b0be310becd1cac00db4aa54efd7387b64bab840..354a6072207156f9ca5d622532ed1ffa8a198784 100644 (file)
@@ -518,7 +518,7 @@ pub fn to_llref(self) -> ValueRef {
     pub fn get_element<'blk>(&self, bcx: Block<'blk, 'tcx>, ty: Ty<'tcx>,
                              gep: |ValueRef| -> ValueRef)
                              -> Datum<'tcx, Lvalue> {
-        let val = match ty::get(self.ty).sty {
+        let val = match self.ty.sty {
             _ if ty::type_is_sized(bcx.tcx(), self.ty) => gep(self.val),
             ty::ty_open(_) => {
                 let base = Load(bcx, expr::get_dataptr(bcx, self.val));
index 5484f6f5653fe66f567f132a78a194926b6470b5..7b3f619f41f1a5139db159e0b70173dd6903dc20 100644 (file)
@@ -357,7 +357,7 @@ fn get_unique_type_id_of_type<'a>(&mut self, cx: &CrateContext<'a, 'tcx>,
         let mut unique_type_id = String::with_capacity(256);
         unique_type_id.push('{');
 
-        match ty::get(type_).sty {
+        match type_.sty {
             ty::ty_bool     |
             ty::ty_char     |
             ty::ty_str      |
@@ -485,7 +485,7 @@ fn get_unique_type_id_of_type<'a>(&mut self, cx: &CrateContext<'a, 'tcx>,
             _ => {
                 cx.sess().bug(format!("get_unique_type_id_of_type() - unexpected type: {}, {}",
                                       ppaux::ty_to_string(cx.tcx(), type_).as_slice(),
-                                      ty::get(type_).sty).as_slice())
+                                      type_.sty).as_slice())
             }
         };
 
@@ -1743,9 +1743,9 @@ fn diverging_type_metadata(cx: &CrateContext) -> DIType {
 fn basic_type_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
                                  t: Ty<'tcx>) -> DIType {
 
-    debug!("basic_type_metadata: {}", ty::get(t));
+    debug!("basic_type_metadata: {}", t);
 
-    let (name, encoding) = match ty::get(t).sty {
+    let (name, encoding) = match t.sty {
         ty::ty_tup(ref elements) if elements.is_empty() =>
             ("()".to_string(), DW_ATE_unsigned),
         ty::ty_bool => ("bool".to_string(), DW_ATE_boolean),
@@ -2787,7 +2787,7 @@ fn subroutine_type_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
 
     // return type
     signature_metadata.push(match signature.output {
-        ty::FnConverging(ret_ty) => match ty::get(ret_ty).sty {
+        ty::FnConverging(ret_ty) => match ret_ty.sty {
             ty::ty_tup(ref tys) if tys.is_empty() => ptr::null_mut(),
             _ => type_metadata(cx, ret_ty, span)
         },
@@ -2826,7 +2826,7 @@ fn trait_pointer_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
     // type is assigned the correct name, size, namespace, and source location.
     // But it does not describe the trait's methods.
 
-    let def_id = match ty::get(trait_type).sty {
+    let def_id = match trait_type.sty {
         ty::ty_trait(box ty::TyTrait { ref principal, .. }) => principal.def_id,
         _ => {
             let pp_type_name = ppaux::ty_to_string(cx.tcx(), trait_type);
@@ -2891,9 +2891,9 @@ fn type_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
         }
     };
 
-    debug!("type_metadata: {}", ty::get(t));
+    debug!("type_metadata: {}", t);
 
-    let sty = &ty::get(t).sty;
+    let sty = &t.sty;
     let MetadataCreationResult { metadata, already_stored_in_typemap } = match *sty {
         ty::ty_bool     |
         ty::ty_char     |
@@ -2920,7 +2920,7 @@ fn type_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
             false)
         }
         ty::ty_uniq(ty) | ty::ty_ptr(ty::mt{ty, ..}) | ty::ty_rptr(_, ty::mt{ty, ..}) => {
-            match ty::get(ty).sty {
+            match ty.sty {
                 ty::ty_vec(typ, None) => {
                     vec_slice_metadata(cx, t, typ, unique_type_id, usage_site_span)
                 }
@@ -3688,7 +3688,7 @@ fn push_debuginfo_type_name<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
                                       t: Ty<'tcx>,
                                       qualified: bool,
                                       output: &mut String) {
-    match ty::get(t).sty {
+    match t.sty {
         ty::ty_bool              => output.push_str("bool"),
         ty::ty_char              => output.push_str("char"),
         ty::ty_str               => output.push_str("str"),
index f9c6583c5ef4fbea6db7a2aab57eb98b4adf2caf..8ccc59831993ac3f2919e1d4c221080b049b5f1a 100644 (file)
@@ -212,7 +212,7 @@ fn apply_adjustments<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                 // also be just in case we need to unsize. But if there are no nested
                 // adjustments then it should be a no-op).
                 Some(ty::AutoPtr(_, _, None)) if adj.autoderefs == 1 => {
-                    match ty::get(datum.ty).sty {
+                    match datum.ty.sty {
                         // Don't skip a conversion from Box<T> to &T, etc.
                         ty::ty_rptr(..) => {
                             let method_call = MethodCall::autoderef(expr.id, adj.autoderefs-1);
@@ -318,7 +318,7 @@ fn unsized_info<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                                 mk_ty: |Ty<'tcx>| -> Ty<'tcx>) -> ValueRef {
         match kind {
             &ty::UnsizeLength(len) => C_uint(bcx.ccx(), len),
-            &ty::UnsizeStruct(box ref k, tp_index) => match ty::get(unsized_ty).sty {
+            &ty::UnsizeStruct(box ref k, tp_index) => match unsized_ty.sty {
                 ty::ty_struct(_, ref substs) => {
                     let ty_substs = substs.types.get_slice(subst::TypeSpace);
                     // The dtor for a field treats it like a value, so mk_ty
@@ -446,7 +446,7 @@ fn unsize_unique_expr<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
         let tcx = bcx.tcx();
 
         let datum_ty = datum.ty;
-        let unboxed_ty = match ty::get(datum_ty).sty {
+        let unboxed_ty = match datum_ty.sty {
             ty::ty_uniq(t) => t,
             _ => bcx.sess().bug(format!("Expected ty_uniq, found {}",
                                         bcx.ty_to_string(datum_ty)).as_slice())
@@ -628,7 +628,7 @@ fn trans_datum_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
             // Special case for `Box<T>`
             let box_ty = expr_ty(bcx, expr);
             let contents_ty = expr_ty(bcx, &**contents);
-            match ty::get(box_ty).sty {
+            match box_ty.sty {
                 ty::ty_uniq(..) => {
                     trans_uniq_expr(bcx, box_ty, &**contents, contents_ty)
                 }
@@ -1173,7 +1173,7 @@ fn trans_def_dps_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
         }
         def::DefStruct(_) => {
             let ty = expr_ty(bcx, ref_expr);
-            match ty::get(ty).sty {
+            match ty.sty {
                 ty::ty_struct(did, _) if ty::has_dtor(bcx.tcx(), did) => {
                     let repr = adt::represent_type(bcx.ccx(), ty);
                     adt::trans_set_discr(bcx, &*repr, lldest, 0);
@@ -1276,7 +1276,7 @@ pub fn with_field_tys<'tcx, R>(tcx: &ty::ctxt<'tcx>,
      * is and `node_id_opt` is none, this function panics).
      */
 
-    match ty::get(ty).sty {
+    match ty.sty {
         ty::ty_struct(did, ref substs) => {
             op(0, struct_fields(tcx, did, substs).as_slice())
         }
@@ -1605,7 +1605,7 @@ fn trans_addr_of<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
     let _icx = push_ctxt("trans_addr_of");
     let mut bcx = bcx;
     let sub_datum = unpack_datum!(bcx, trans_to_lvalue(bcx, subexpr, "addr_of"));
-    match ty::get(sub_datum.ty).sty {
+    match sub_datum.ty.sty {
         ty::ty_open(_) => {
             // Opened DST value, close to a fat pointer
             debug!("Closing fat pointer {}", bcx.ty_to_string(sub_datum.ty));
@@ -1906,7 +1906,7 @@ pub enum cast_kind {
 }
 
 pub fn cast_type_kind<'tcx>(tcx: &ty::ctxt<'tcx>, t: Ty<'tcx>) -> cast_kind {
-    match ty::get(t).sty {
+    match t.sty {
         ty::ty_char        => cast_integral,
         ty::ty_float(..)   => cast_float,
         ty::ty_rptr(_, mt) | ty::ty_ptr(mt) => {
@@ -2139,7 +2139,7 @@ fn deref_once<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
         }
     };
 
-    let r = match ty::get(datum.ty).sty {
+    let r = match datum.ty.sty {
         ty::ty_uniq(content_ty) => {
             if ty::type_is_sized(bcx.tcx(), content_ty) {
                 deref_owned_pointer(bcx, expr, datum, content_ty)
index a2f894bb0f17c9400724b186cd0980872cff97c0..1f6aeacc860586cad25b8d3980aabebe08a67d89 100644 (file)
@@ -122,7 +122,7 @@ pub fn register_static(ccx: &CrateContext,
                                           "invalid linkage specified");
                 }
             };
-            let llty2 = match ty::get(ty).sty {
+            let llty2 = match ty.sty {
                 ty::ty_ptr(ref mt) => type_of::type_of(ccx, mt.ty),
                 _ => {
                     ccx.sess().span_fatal(foreign_item.span,
@@ -235,7 +235,7 @@ pub fn trans_native_call<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
            ccx.tn().val_to_string(llfn),
            ccx.tn().val_to_string(llretptr));
 
-    let (fn_abi, fn_sig) = match ty::get(callee_ty).sty {
+    let (fn_abi, fn_sig) = match callee_ty.sty {
         ty::ty_bare_fn(ref fn_ty) => (fn_ty.abi, fn_ty.sig.clone()),
         _ => ccx.sess().bug("trans_native_call called on non-function type")
     };
@@ -490,7 +490,7 @@ pub fn decl_rust_fn_with_foreign_abi<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
                                                -> ValueRef {
     let tys = foreign_types_for_fn_ty(ccx, t);
     let llfn_ty = lltype_for_fn_from_foreign_types(ccx, &tys);
-    let cconv = match ty::get(t).sty {
+    let cconv = match t.sty {
         ty::ty_bare_fn(ref fn_ty) => {
             llvm_calling_convention(ccx, fn_ty.abi)
         }
@@ -513,7 +513,7 @@ pub fn register_rust_fn_with_foreign_abi(ccx: &CrateContext,
     let tys = foreign_types_for_id(ccx, node_id);
     let llfn_ty = lltype_for_fn_from_foreign_types(ccx, &tys);
     let t = ty::node_id_to_type(ccx.tcx(), node_id);
-    let cconv = match ty::get(t).sty {
+    let cconv = match t.sty {
         ty::ty_bare_fn(ref fn_ty) => {
             llvm_calling_convention(ccx, fn_ty.abi)
         }
@@ -567,7 +567,7 @@ fn build_rust_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
 
         // Compute the type that the function would have if it were just a
         // normal Rust function. This will be the type of the wrappee fn.
-        match ty::get(t).sty {
+        match t.sty {
             ty::ty_bare_fn(ref f) => {
                 assert!(f.abi != Rust && f.abi != RustIntrinsic);
             }
@@ -864,7 +864,7 @@ fn foreign_types_for_id<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
 
 fn foreign_types_for_fn_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
                                      ty: Ty<'tcx>) -> ForeignTypes<'tcx> {
-    let fn_sig = match ty::get(ty).sty {
+    let fn_sig = match ty.sty {
         ty::ty_bare_fn(ref fn_ty) => fn_ty.sig.clone(),
         _ => ccx.sess().bug("foreign_types_for_fn_ty called on non-function type")
     };
index 85369afa60243fac635371b484f84280f935247d..67b3310dbdf88d25cf30711634ab75b95bb8bb37 100644 (file)
@@ -87,7 +87,7 @@ pub fn get_drop_glue_type<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
     if !ty::type_needs_drop(tcx, t) {
         return ty::mk_i8();
     }
-    match ty::get(t).sty {
+    match t.sty {
         ty::ty_uniq(typ) if !ty::type_needs_drop(tcx, typ)
                          && ty::type_is_sized(tcx, typ) => {
             let llty = sizing_type_of(ccx, typ);
@@ -225,7 +225,7 @@ fn trans_struct_drop<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
     };
 
     let fty = ty::lookup_item_type(bcx.tcx(), dtor_did).ty.subst(bcx.tcx(), substs);
-    let self_ty = match ty::get(fty).sty {
+    let self_ty = match fty.sty {
         ty::ty_bare_fn(ref f) => {
             assert!(f.sig.inputs.len() == 1);
             f.sig.inputs[0]
@@ -308,7 +308,7 @@ fn size_and_align_of_dst<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, t: Ty<'tcx>, info:
         let align = C_uint(bcx.ccx(), align_of(bcx.ccx(), t));
         return (size, align);
     }
-    match ty::get(t).sty {
+    match t.sty {
         ty::ty_struct(id, ref substs) => {
             let ccx = bcx.ccx();
             // First get the size of all statically known fields.
@@ -358,9 +358,9 @@ fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, t: Ty<'tcx>)
                               -> Block<'blk, 'tcx> {
     // NB: v0 is an *alias* of type t here, not a direct value.
     let _icx = push_ctxt("make_drop_glue");
-    match ty::get(t).sty {
+    match t.sty {
         ty::ty_uniq(content_ty) => {
-            match ty::get(content_ty).sty {
+            match content_ty.sty {
                 ty::ty_vec(ty, None) => {
                     tvec::make_drop_glue_unboxed(bcx, v0, ty, true)
                 }
index d8c9b3ac9b2e83831b5416d1c5298148eaaf024b..6bdb35f8d6074dc345f03e62a63492f6391b0401 100644 (file)
@@ -149,7 +149,7 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
     let ccx = fcx.ccx;
     let tcx = bcx.tcx();
 
-    let ret_ty = match ty::get(callee_ty).sty {
+    let ret_ty = match callee_ty.sty {
         ty::ty_bare_fn(ref f) => f.sig.output,
         _ => panic!("expected bare_fn in trans_intrinsic_call")
     };
index 1b02b9588f5c317fa2dbb0fcceaa850e1afcc9b0..0311d37c3de524cf1f1c0bcd522fb3904f7808ca 100644 (file)
@@ -488,7 +488,7 @@ pub fn trans_trait_callee_from_llval<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
     // Load the function from the vtable and cast it to the expected type.
     debug!("(translating trait callee) loading method");
     // Replace the self type (&Self or Box<Self>) with an opaque pointer.
-    let llcallee_ty = match ty::get(callee_ty).sty {
+    let llcallee_ty = match callee_ty.sty {
         ty::ty_bare_fn(ref f) if f.abi == Rust || f.abi == RustCall => {
             type_of_rust_fn(ccx,
                             Some(Type::i8p(ccx)),
@@ -585,12 +585,10 @@ pub fn get_vtable<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                                                  unboxed closure");
                     if closure_info.kind == ty::FnOnceUnboxedClosureKind {
                         // Untuple the arguments and create an unboxing shim.
-                        let (new_inputs, new_output) = match ty::get(self_ty).sty {
+                        let (new_inputs, new_output) = match self_ty.sty {
                             ty::ty_unboxed_closure(_, _, ref substs) => {
                                 let mut new_inputs = vec![self_ty.clone()];
-                                match ty::get(closure_info.closure_type
-                                              .sig
-                                              .inputs[0]).sty {
+                                match closure_info.closure_type.sig.inputs[0].sty {
                                     ty::ty_tup(ref elements) => {
                                         for element in elements.iter() {
                                             new_inputs.push(element.subst(bcx.tcx(), substs));
index baab9b7b9a75b0b9127ca8b3d04757d9267a2ea9..359f74bdbf134d866fc1df7a27054422ed9aa8c1 100644 (file)
@@ -420,15 +420,15 @@ pub fn get_base_and_len(bcx: Block,
 
     let ccx = bcx.ccx();
 
-    match ty::get(vec_ty).sty {
+    match vec_ty.sty {
         ty::ty_vec(_, Some(n)) => get_fixed_base_and_len(bcx, llval, n),
-        ty::ty_open(ty) => match ty::get(ty).sty {
+        ty::ty_open(ty) => match ty.sty {
             ty::ty_vec(_, None) | ty::ty_str => get_slice_base_and_len(bcx, llval),
             _ => ccx.sess().bug("unexpected type in get_base_and_len")
         },
 
         // Only used for pattern matching.
-        ty::ty_uniq(ty) | ty::ty_rptr(_, ty::mt{ty, ..}) => match ty::get(ty).sty {
+        ty::ty_uniq(ty) | ty::ty_rptr(_, ty::mt{ty, ..}) => match ty.sty {
             ty::ty_vec(_, None) | ty::ty_str => get_slice_base_and_len(bcx, llval),
             ty::ty_vec(_, Some(n)) => {
                 let base = GEPi(bcx, Load(bcx, llval), &[0u, 0u]);
index 431768a94de58d3738960af042756cbaf698eefb..31e8130dd751334b982bd9e786239af68cbc8b56 100644 (file)
@@ -81,7 +81,7 @@ pub fn untuple_arguments_if_necessary<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
         }
     }
 
-    match ty::get(inputs[inputs.len() - 1]).sty {
+    match inputs[inputs.len() - 1].sty {
         ty::ty_tup(ref tupled_arguments) => {
             debug!("untuple_arguments_if_necessary(): untupling arguments");
             for &tupled_argument in tupled_arguments.iter() {
@@ -142,7 +142,7 @@ pub fn type_of_rust_fn<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
 
 // Given a function type and a count of ty params, construct an llvm type
 pub fn type_of_fn_from_ty<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, fty: Ty<'tcx>) -> Type {
-    match ty::get(fty).sty {
+    match fty.sty {
         ty::ty_closure(ref f) => {
             type_of_rust_fn(cx,
                             Some(Type::i8p(cx)),
@@ -184,7 +184,7 @@ pub fn sizing_type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> Typ
         None => ()
     }
 
-    let llsizingty = match ty::get(t).sty {
+    let llsizingty = match t.sty {
         _ if !ty::lltype_is_sized(cx.tcx(), t) => {
             cx.sess().bug(format!("trying to take the sizing type of {}, an unsized type",
                                   ppaux::ty_to_string(cx.tcx(), t)).as_slice())
@@ -269,7 +269,7 @@ fn type_of_unsize_info<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> Ty
             return Type::i8p(cx);
         }
 
-        match ty::get(ty::unsized_part_of_type(cx.tcx(), t)).sty {
+        match ty::unsized_part_of_type(cx.tcx(), t).sty {
             ty::ty_str | ty::ty_vec(..) => Type::uint_from_ty(cx, ast::TyU),
             ty::ty_trait(_) => Type::vtable_ptr(cx),
             _ => panic!("Unexpected type returned from unsized_part_of_type : {}",
@@ -283,7 +283,7 @@ fn type_of_unsize_info<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> Ty
         None => ()
     }
 
-    debug!("type_of {} {}", t.repr(cx.tcx()), ty::get(t).sty);
+    debug!("type_of {} {}", t.repr(cx.tcx()), t.sty);
 
     // Replace any typedef'd types with their equivalent non-typedef
     // type. This ensures that all LLVM nominal types that contain
@@ -304,7 +304,7 @@ fn type_of_unsize_info<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> Ty
         return llty;
     }
 
-    let mut llty = match ty::get(t).sty {
+    let mut llty = match t.sty {
       ty::ty_bool => Type::bool(cx),
       ty::ty_char => Type::char(cx),
       ty::ty_int(t) => Type::int_from_ty(cx, t),
@@ -333,7 +333,7 @@ fn type_of_unsize_info<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> Ty
       }
 
       ty::ty_uniq(ty) | ty::ty_rptr(_, ty::mt{ty, ..}) | ty::ty_ptr(ty::mt{ty, ..}) => {
-          match ty::get(ty).sty {
+          match ty.sty {
               ty::ty_str => {
                   // This means we get a nicer name in the output (str is always
                   // unsized).
@@ -393,7 +393,7 @@ fn type_of_unsize_info<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> Ty
           }
       }
 
-      ty::ty_open(t) => match ty::get(t).sty {
+      ty::ty_open(t) => match t.sty {
           ty::ty_struct(..) => {
               let p_ty = type_of(cx, t).ptr_to();
               Type::struct_(cx, &[p_ty, type_of_unsize_info(cx, t)], false)
@@ -424,7 +424,7 @@ fn type_of_unsize_info<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> Ty
     cx.lltypes().borrow_mut().insert(t, llty);
 
     // If this was an enum or struct, fill in the type now.
-    match ty::get(t).sty {
+    match t.sty {
         ty::ty_enum(..) | ty::ty_struct(..) | ty::ty_unboxed_closure(..)
                 if !ty::type_is_simd(cx.tcx(), t) => {
             let repr = adt::represent_type(cx, t);
index bcbd09d7b119e190fe3200ff7d836d1067ab0a50..16edccd154302ce4118d4a653536ef6e9b28c1dd 100644 (file)
@@ -169,7 +169,7 @@ pub fn build_external_trait(cx: &DocContext, tcx: &ty::ctxt,
 
 fn build_external_function(cx: &DocContext, tcx: &ty::ctxt, did: ast::DefId) -> clean::Function {
     let t = ty::lookup_item_type(tcx, did);
-    let (decl, style) = match ty::get(t.ty).sty {
+    let (decl, style) = match t.ty.sty {
         ty::ty_bare_fn(ref f) => ((did, &f.sig).clean(cx), f.fn_style),
         _ => panic!("bad function"),
     };
@@ -201,7 +201,7 @@ fn build_struct(cx: &DocContext, tcx: &ty::ctxt, did: ast::DefId) -> clean::Stru
 
 fn build_type(cx: &DocContext, tcx: &ty::ctxt, did: ast::DefId) -> clean::ItemEnum {
     let t = ty::lookup_item_type(tcx, did);
-    match ty::get(t.ty).sty {
+    match t.ty.sty {
         ty::ty_enum(edid, _) if !csearch::is_typedef(&tcx.sess.cstore, did) => {
             return clean::EnumItem(clean::Enum {
                 generics: (&t.generics, subst::TypeSpace).clean(cx),
index 48cec8bfecbee3db89540f353640c2e982ede3ac..22b646e9ffe5b5e0c8ccab37d01f766b3df0f957 100644 (file)
@@ -1049,7 +1049,7 @@ fn clean(&self, cx: &DocContext) -> Item {
                 let s = match s {
                     ty::ByValueExplicitSelfCategory => SelfValue,
                     ty::ByReferenceExplicitSelfCategory(..) => {
-                        match ty::get(self.fty.sig.inputs[0]).sty {
+                        match self.fty.sig.inputs[0].sty {
                             ty::ty_rptr(r, mt) => {
                                 SelfBorrowed(r.clean(cx), mt.mutbl.clean(cx))
                             }
@@ -1259,7 +1259,7 @@ fn clean(&self, cx: &DocContext) -> Type {
 
 impl Clean<Type> for Ty {
     fn clean(&self, cx: &DocContext) -> Type {
-        match ty::get(*self).sty {
+        match self.sty {
             ty::ty_bool => Primitive(Bool),
             ty::ty_char => Primitive(Char),
             ty::ty_int(ast::TyI) => Primitive(Int),
@@ -1321,7 +1321,7 @@ fn clean(&self, cx: &DocContext) -> Type {
                 let fqn: Vec<String> = fqn.into_iter().map(|i| {
                     i.to_string()
                 }).collect();
-                let kind = match ty::get(*self).sty {
+                let kind = match self.sty {
                     ty::ty_struct(..) => TypeStruct,
                     ty::ty_trait(..) => TypeTrait,
                     _ => TypeEnum,