about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcollections/slice.rs4
-rw-r--r--src/libcollections/vec.rs4
-rw-r--r--src/libcoretest/slice.rs6
-rw-r--r--src/librustc/middle/astconv_util.rs3
-rw-r--r--src/librustc_resolve/lib.rs2
-rw-r--r--src/libserialize/json.rs2
-rw-r--r--src/libstd/io/cursor.rs12
-rw-r--r--src/libsyntax/ast_util.rs8
-rw-r--r--src/rustbook/book.rs8
9 files changed, 23 insertions, 26 deletions
diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs
index d4c53739686..a2924f8fe53 100644
--- a/src/libcollections/slice.rs
+++ b/src/libcollections/slice.rs
@@ -2663,7 +2663,7 @@ mod tests {
             let (left, right) = values.split_at_mut(2);
             {
                 let left: &[_] = left;
-                assert!(left[..left.len()] == [1, 2][]);
+                assert!(left[..left.len()] == [1, 2]);
             }
             for p in left {
                 *p += 1;
@@ -2671,7 +2671,7 @@ mod tests {
 
             {
                 let right: &[_] = right;
-                assert!(right[..right.len()] == [3, 4, 5][]);
+                assert!(right[..right.len()] == [3, 4, 5]);
             }
             for p in right {
                 *p += 2;
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index 6d4541b5bde..c43c6c739d9 100644
--- a/src/libcollections/vec.rs
+++ b/src/libcollections/vec.rs
@@ -2090,7 +2090,7 @@ mod tests {
             let (left, right) = values.split_at_mut(2);
             {
                 let left: &[_] = left;
-                assert!(&left[..left.len()] == &[1, 2][]);
+                assert!(&left[..left.len()] == &[1, 2]);
             }
             for p in left {
                 *p += 1;
@@ -2098,7 +2098,7 @@ mod tests {
 
             {
                 let right: &[_] = right;
-                assert!(&right[..right.len()] == &[3, 4, 5][]);
+                assert!(&right[..right.len()] == &[3, 4, 5]);
             }
             for p in right {
                 *p += 2;
diff --git a/src/libcoretest/slice.rs b/src/libcoretest/slice.rs
index 46c7730cc64..fe73b3b4407 100644
--- a/src/libcoretest/slice.rs
+++ b/src/libcoretest/slice.rs
@@ -59,16 +59,16 @@ fn iterator_to_slice() {
                 let mut iter = data.iter_mut();
                 assert_eq!(&iter[..], &other_data[..]);
                 // mutability:
-                assert!(&mut iter[] == other_data);
+                assert!(&mut iter[..] == other_data);
 
                 iter.next();
                 assert_eq!(&iter[..], &other_data[1..]);
-                assert!(&mut iter[] == &mut other_data[1..]);
+                assert!(&mut iter[..] == &mut other_data[1..]);
 
                 iter.next_back();
 
                 assert_eq!(&iter[..], &other_data[1..2]);
-                assert!(&mut iter[] == &mut other_data[1..2]);
+                assert!(&mut iter[..] == &mut other_data[1..2]);
 
                 let s = iter.into_slice();
                 assert!(s == &mut other_data[1..2]);
diff --git a/src/librustc/middle/astconv_util.rs b/src/librustc/middle/astconv_util.rs
index 17fd80ceaea..0f98b3c33fb 100644
--- a/src/librustc/middle/astconv_util.rs
+++ b/src/librustc/middle/astconv_util.rs
@@ -68,7 +68,7 @@ pub fn ast_ty_to_prim_ty<'tcx>(tcx: &ty::ctxt<'tcx>, ast_ty: &ast::Ty)
             Some(d) => d.full_def()
         };
         if let def::DefPrimTy(nty) = def {
-            Some(prim_ty_to_ty(tcx, &path.segments[], nty))
+            Some(prim_ty_to_ty(tcx, &path.segments, nty))
         } else {
             None
         }
@@ -76,4 +76,3 @@ pub fn ast_ty_to_prim_ty<'tcx>(tcx: &ty::ctxt<'tcx>, ast_ty: &ast::Ty)
         None
     }
 }
-
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs
index 95523be68c3..78ce9abe07d 100644
--- a/src/librustc_resolve/lib.rs
+++ b/src/librustc_resolve/lib.rs
@@ -2985,7 +2985,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
         } else {
             let msg = format!("use of undeclared trait name `{}`",
                               self.path_names_to_string(trait_path, path_depth));
-            self.resolve_error(trait_path.span, &msg[]);
+            self.resolve_error(trait_path.span, &msg);
             Err(())
         }
     }
diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs
index 05d4e0f59fe..14930f91c91 100644
--- a/src/libserialize/json.rs
+++ b/src/libserialize/json.rs
@@ -3945,9 +3945,7 @@ mod tests {
 
     #[test]
     fn test_encode_hashmap_with_arbitrary_key() {
-        use std::old_io::Writer;
         use std::collections::HashMap;
-        use std::fmt;
         #[derive(PartialEq, Eq, Hash, RustcEncodable)]
         struct ArbitraryType(uint);
         let mut hm: HashMap<ArbitraryType, bool> = HashMap::new();
diff --git a/src/libstd/io/cursor.rs b/src/libstd/io/cursor.rs
index f6cb4a8c9f3..b1779587528 100644
--- a/src/libstd/io/cursor.rs
+++ b/src/libstd/io/cursor.rs
@@ -173,7 +173,7 @@ mod tests {
         assert_eq!(writer.write(&[1, 2, 3]), Ok(3));
         assert_eq!(writer.write(&[4, 5, 6, 7]), Ok(4));
         let b: &[_] = &[0, 1, 2, 3, 4, 5, 6, 7];
-        assert_eq!(&writer.get_ref()[], b);
+        assert_eq!(&writer.get_ref()[..], b);
     }
 
     #[test]
@@ -369,28 +369,28 @@ mod tests {
         assert_eq!(writer.write(&[4, 5, 6, 7]), Ok(4));
         assert_eq!(writer.position(), 8);
         let b: &[_] = &[0, 1, 2, 3, 4, 5, 6, 7];
-        assert_eq!(&writer.get_ref()[], b);
+        assert_eq!(&writer.get_ref()[..], b);
 
         assert_eq!(writer.seek(SeekFrom::Start(0)), Ok(0));
         assert_eq!(writer.position(), 0);
         assert_eq!(writer.write(&[3, 4]), Ok(2));
         let b: &[_] = &[3, 4, 2, 3, 4, 5, 6, 7];
-        assert_eq!(&writer.get_ref()[], b);
+        assert_eq!(&writer.get_ref()[..], b);
 
         assert_eq!(writer.seek(SeekFrom::Current(1)), Ok(3));
         assert_eq!(writer.write(&[0, 1]), Ok(2));
         let b: &[_] = &[3, 4, 2, 0, 1, 5, 6, 7];
-        assert_eq!(&writer.get_ref()[], b);
+        assert_eq!(&writer.get_ref()[..], b);
 
         assert_eq!(writer.seek(SeekFrom::End(-1)), Ok(7));
         assert_eq!(writer.write(&[1, 2]), Ok(2));
         let b: &[_] = &[3, 4, 2, 0, 1, 5, 6, 1, 2];
-        assert_eq!(&writer.get_ref()[], b);
+        assert_eq!(&writer.get_ref()[..], b);
 
         assert_eq!(writer.seek(SeekFrom::End(1)), Ok(10));
         assert_eq!(writer.write(&[1]), Ok(1));
         let b: &[_] = &[3, 4, 2, 0, 1, 5, 6, 1, 2, 0, 1];
-        assert_eq!(&writer.get_ref()[], b);
+        assert_eq!(&writer.get_ref()[..], b);
     }
 
     #[test]
diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs
index 79f0433761d..264e05f5c8d 100644
--- a/src/libsyntax/ast_util.rs
+++ b/src/libsyntax/ast_util.rs
@@ -760,13 +760,13 @@ mod test {
     #[test] fn idents_name_eq_test() {
         assert!(segments_name_eq(
             &[Ident{name:Name(3),ctxt:4}, Ident{name:Name(78),ctxt:82}]
-                .iter().map(ident_to_segment).collect::<Vec<PathSegment>>()[],
+                .iter().map(ident_to_segment).collect::<Vec<PathSegment>>(),
             &[Ident{name:Name(3),ctxt:104}, Ident{name:Name(78),ctxt:182}]
-                .iter().map(ident_to_segment).collect::<Vec<PathSegment>>()[]));
+                .iter().map(ident_to_segment).collect::<Vec<PathSegment>>()));
         assert!(!segments_name_eq(
             &[Ident{name:Name(3),ctxt:4}, Ident{name:Name(78),ctxt:82}]
-                .iter().map(ident_to_segment).collect::<Vec<PathSegment>>()[],
+                .iter().map(ident_to_segment).collect::<Vec<PathSegment>>(),
             &[Ident{name:Name(3),ctxt:104}, Ident{name:Name(77),ctxt:182}]
-                .iter().map(ident_to_segment).collect::<Vec<PathSegment>>()[]));
+                .iter().map(ident_to_segment).collect::<Vec<PathSegment>>()));
     }
 }
diff --git a/src/rustbook/book.rs b/src/rustbook/book.rs
index 3c116aa860b..8900b60d191 100644
--- a/src/rustbook/book.rs
+++ b/src/rustbook/book.rs
@@ -114,12 +114,12 @@ pub fn parse_summary<R: Reader>(input: R, src: &Path) -> Result<Book, Vec<String
             }
         };
 
-        let star_idx = match line.find_str("*") { Some(i) => i, None => continue };
+        let star_idx = match line.find("*") { Some(i) => i, None => continue };
 
-        let start_bracket = star_idx + line[star_idx..].find_str("[").unwrap();
-        let end_bracket = start_bracket + line[start_bracket..].find_str("](").unwrap();
+        let start_bracket = star_idx + line[star_idx..].find("[").unwrap();
+        let end_bracket = start_bracket + line[start_bracket..].find("](").unwrap();
         let start_paren = end_bracket + 1;
-        let end_paren = start_paren + line[start_paren..].find_str(")").unwrap();
+        let end_paren = start_paren + line[start_paren..].find(")").unwrap();
 
         let given_path = &line[start_paren + 1 .. end_paren];
         let title = line[start_bracket + 1..end_bracket].to_string();