about summary refs log tree commit diff
path: root/src/librustc_trans/trans/_match.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc_trans/trans/_match.rs')
-rw-r--r--src/librustc_trans/trans/_match.rs46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/librustc_trans/trans/_match.rs b/src/librustc_trans/trans/_match.rs
index fed0931cab7..f55076e7484 100644
--- a/src/librustc_trans/trans/_match.rs
+++ b/src/librustc_trans/trans/_match.rs
@@ -427,7 +427,7 @@ fn enter_match<'a, 'b, 'p, 'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
     let _indenter = indenter();
 
     m.iter().filter_map(|br| {
-        e(br.pats[]).map(|pats| {
+        e(br.pats.index(&FullRange)).map(|pats| {
             let this = br.pats[col];
             let mut bound_ptrs = br.bound_ptrs.clone();
             match this.node {
@@ -471,8 +471,8 @@ fn enter_default<'a, 'p, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
     // Collect all of the matches that can match against anything.
     enter_match(bcx, dm, m, col, val, |pats| {
         if pat_is_binding_or_wild(dm, &*pats[col]) {
-            let mut r = pats[..col].to_vec();
-            r.push_all(pats[col + 1..]);
+            let mut r = pats.index(&(0..col)).to_vec();
+            r.push_all(pats.index(&((col + 1)..)));
             Some(r)
         } else {
             None
@@ -548,7 +548,7 @@ fn enter_opt<'a, 'p, 'blk, 'tcx>(
         param_env: param_env,
     };
     enter_match(bcx, dm, m, col, val, |pats|
-        check_match::specialize(&mcx, pats[], &ctor, col, variant_size)
+        check_match::specialize(&mcx, pats.index(&FullRange), &ctor, col, variant_size)
     )
 }
 
@@ -790,7 +790,7 @@ fn compare_values<'blk, 'tcx>(cx: Block<'blk, 'tcx>,
         let did = langcall(cx,
                            None,
                            format!("comparison of `{}`",
-                                   cx.ty_to_string(rhs_t))[],
+                                   cx.ty_to_string(rhs_t)).index(&FullRange),
                            StrEqFnLangItem);
         callee::trans_lang_call(cx, did, &[lhs, rhs], None)
     }
@@ -945,7 +945,7 @@ fn compile_submatch<'a, 'p, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
             if has_nested_bindings(m, col) {
                 let expanded = expand_nested_bindings(bcx, m, col, val);
                 compile_submatch_continue(bcx,
-                                          expanded[],
+                                          expanded.index(&FullRange),
                                           vals,
                                           chk,
                                           col,
@@ -967,7 +967,7 @@ fn compile_submatch<'a, 'p, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                     bcx = compile_guard(bcx,
                                         &**guard_expr,
                                         m[0].data,
-                                        m[1..m.len()],
+                                        m.index(&(1..m.len())),
                                         vals,
                                         chk,
                                         has_genuine_default);
@@ -990,8 +990,8 @@ fn compile_submatch_continue<'a, 'p, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
     let tcx = bcx.tcx();
     let dm = &tcx.def_map;
 
-    let mut vals_left = vals[0u..col].to_vec();
-    vals_left.push_all(vals[col + 1u..]);
+    let mut vals_left = vals.index(&(0u..col)).to_vec();
+    vals_left.push_all(vals.index(&((col + 1u)..)));
     let ccx = bcx.fcx.ccx;
 
     // Find a real id (we're adding placeholder wildcard patterns, but
@@ -1037,8 +1037,8 @@ fn compile_submatch_continue<'a, 'p, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
                                         field_vals.len())
             );
             let mut vals = field_vals;
-            vals.push_all(vals_left[]);
-            compile_submatch(bcx, pats[], vals[], chk, has_genuine_default);
+            vals.push_all(vals_left.index(&FullRange));
+            compile_submatch(bcx, pats.index(&FullRange), vals.index(&FullRange), chk, has_genuine_default);
             return;
         }
         _ => ()
@@ -1191,10 +1191,10 @@ fn compile_submatch_continue<'a, 'p, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
         }
         let opt_ms = enter_opt(opt_cx, pat_id, dm, m, opt, col, size, val);
         let mut opt_vals = unpacked;
-        opt_vals.push_all(vals_left[]);
+        opt_vals.push_all(vals_left.index(&FullRange));
         compile_submatch(opt_cx,
-                         opt_ms[],
-                         opt_vals[],
+                         opt_ms.index(&FullRange),
+                         opt_vals.index(&FullRange),
                          branch_chk.as_ref().unwrap_or(chk),
                          has_genuine_default);
     }
@@ -1213,8 +1213,8 @@ fn compile_submatch_continue<'a, 'p, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
             }
             _ => {
                 compile_submatch(else_cx,
-                                 defaults[],
-                                 vals_left[],
+                                 defaults.index(&FullRange),
+                                 vals_left.index(&FullRange),
                                  chk,
                                  has_genuine_default);
             }
@@ -1333,7 +1333,7 @@ fn create_bindings_map<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, pat: &ast::Pat,
                                  "__llmatch");
                 trmode = TrByCopy(alloca_no_lifetime(bcx,
                                          llvariable_ty,
-                                         bcx.ident(ident)[]));
+                                         bcx.ident(ident).index(&FullRange)));
             }
             ast::BindByValue(_) => {
                 // in this case, the final type of the variable will be T,
@@ -1341,13 +1341,13 @@ fn create_bindings_map<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, pat: &ast::Pat,
                 // above
                 llmatch = alloca_no_lifetime(bcx,
                                  llvariable_ty.ptr_to(),
-                                 bcx.ident(ident)[]);
+                                 bcx.ident(ident).index(&FullRange));
                 trmode = TrByMove;
             }
             ast::BindByRef(_) => {
                 llmatch = alloca_no_lifetime(bcx,
                                  llvariable_ty,
-                                 bcx.ident(ident)[]);
+                                 bcx.ident(ident).index(&FullRange));
                 trmode = TrByRef;
             }
         };
@@ -1415,7 +1415,7 @@ fn trans_match_inner<'blk, 'tcx>(scope_cx: Block<'blk, 'tcx>,
         && arm.pats.last().unwrap().node == ast::PatWild(ast::PatWildSingle)
     });
 
-    compile_submatch(bcx, matches[], &[discr_datum.val], &chk, has_default);
+    compile_submatch(bcx, matches.index(&FullRange), &[discr_datum.val], &chk, has_default);
 
     let mut arm_cxs = Vec::new();
     for arm_data in arm_datas.iter() {
@@ -1429,7 +1429,7 @@ fn trans_match_inner<'blk, 'tcx>(scope_cx: Block<'blk, 'tcx>,
         arm_cxs.push(bcx);
     }
 
-    bcx = scope_cx.fcx.join_blocks(match_id, arm_cxs[]);
+    bcx = scope_cx.fcx.join_blocks(match_id, arm_cxs.index(&FullRange));
     return bcx;
 }
 
@@ -1582,7 +1582,7 @@ fn mk_binding_alloca<'blk, 'tcx, A, F>(bcx: Block<'blk, 'tcx>,
     let var_ty = node_id_type(bcx, p_id);
 
     // Allocate memory on stack for the binding.
-    let llval = alloc_ty(bcx, var_ty, bcx.ident(*ident)[]);
+    let llval = alloc_ty(bcx, var_ty, bcx.ident(*ident).index(&FullRange));
 
     // Subtle: be sure that we *populate* the memory *before*
     // we schedule the cleanup.
@@ -1620,7 +1620,7 @@ fn bind_irrefutable_pat<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
 
     if bcx.sess().asm_comments() {
         add_comment(bcx, format!("bind_irrefutable_pat(pat={})",
-                                 pat.repr(bcx.tcx()))[]);
+                                 pat.repr(bcx.tcx())).index(&FullRange));
     }
 
     let _indenter = indenter();