]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/method/probe.rs
use slicing sugar
[rust.git] / src / librustc_typeck / check / method / probe.rs
index 4ba161fa83563af1d670b32f62878de083087a76..36321e5e8c63c907ac7443a11eb0512853c7ca54 100644 (file)
@@ -575,8 +575,8 @@ fn assemble_unboxed_closure_candidates(&mut self,
                 None => {
                     self.tcx().sess.span_bug(
                         self.span,
-                        format!("No entry for unboxed closure: {}",
-                                closure_def_id.repr(self.tcx())).index(&FullRange));
+                        &format!("No entry for unboxed closure: {}",
+                                closure_def_id.repr(self.tcx()))[]);
                 }
             };
 
@@ -745,7 +745,7 @@ fn pick_method(&mut self, self_ty: Ty<'tcx>) -> Option<PickResult<'tcx>> {
         debug!("pick_method(self_ty={})", self.infcx().ty_to_string(self_ty));
 
         debug!("searching inherent candidates");
-        match self.consider_candidates(self_ty, self.inherent_candidates.index(&FullRange)) {
+        match self.consider_candidates(self_ty, &self.inherent_candidates[]) {
             None => {}
             Some(pick) => {
                 return Some(pick);
@@ -753,7 +753,7 @@ fn pick_method(&mut self, self_ty: Ty<'tcx>) -> Option<PickResult<'tcx>> {
         }
 
         debug!("searching extension candidates");
-        self.consider_candidates(self_ty, self.extension_candidates.index(&FullRange))
+        self.consider_candidates(self_ty, &self.extension_candidates[])
     }
 
     fn consider_candidates(&self,
@@ -768,7 +768,7 @@ fn consider_candidates(&self,
         debug!("applicable_candidates: {}", applicable_candidates.repr(self.tcx()));
 
         if applicable_candidates.len() > 1 {
-            match self.collapse_candidates_to_trait_pick(applicable_candidates.index(&FullRange)) {
+            match self.collapse_candidates_to_trait_pick(&applicable_candidates[]) {
                 Some(pick) => { return Some(Ok(pick)); }
                 None => { }
             }
@@ -864,7 +864,7 @@ fn collapse_candidates_to_trait_pick(&self,
             Some(data) => data,
             None => return None,
         };
-        if probes.index(&(1..)).iter().any(|p| p.to_trait_data() != Some(trait_data)) {
+        if probes[1..].iter().any(|p| p.to_trait_data() != Some(trait_data)) {
             return None;
         }