about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-05-01 16:06:48 -0700
committerbors <bors@rust-lang.org>2014-05-01 16:06:48 -0700
commit9f836d5a53e20fde65aa3469fa1826228e7c273a (patch)
tree01a0c192a4dabd1ebb17f3d3da8662701d43c6f4 /src/libstd
parentfb72d7cfea9ba44581f708b13aa82ab23ee4fa7e (diff)
parente93cb04c4b011088d3b13a17bdf4cb865730dd38 (diff)
downloadrust-9f836d5a53e20fde65aa3469fa1826228e7c273a.tar.gz
rust-9f836d5a53e20fde65aa3469fa1826228e7c273a.zip
auto merge of #13877 : thestinger/rust/de-tilde-str-vec, r=alexcrichton
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/bitflags.rs2
-rw-r--r--src/libstd/hash/mod.rs2
-rw-r--r--src/libstd/path/posix.rs2
-rw-r--r--src/libstd/repr.rs2
-rw-r--r--src/libstd/str.rs20
-rw-r--r--src/libstd/vec.rs6
6 files changed, 17 insertions, 17 deletions
diff --git a/src/libstd/bitflags.rs b/src/libstd/bitflags.rs
index 8764163ddc5..bf12dd2d94a 100644
--- a/src/libstd/bitflags.rs
+++ b/src/libstd/bitflags.rs
@@ -62,7 +62,7 @@
 //!     let mut flags = FlagA | FlagB;
 //!     flags.clear();
 //!     assert!(flags.is_empty());
-//!     assert_eq!(format!("{}", flags), ~"hi!");
+//!     assert_eq!(format!("{}", flags).as_slice(), "hi!");
 //! }
 //! ~~~
 //!
diff --git a/src/libstd/hash/mod.rs b/src/libstd/hash/mod.rs
index ffb41e9781b..e8ca4037f57 100644
--- a/src/libstd/hash/mod.rs
+++ b/src/libstd/hash/mod.rs
@@ -343,7 +343,7 @@ mod tests {
 
         assert_eq!(hasher.hash(&'a'), 97);
 
-        assert_eq!(hasher.hash(& &"a"), 97 + 0xFF);
+        assert_eq!(hasher.hash(&("a")), 97 + 0xFF);
         assert_eq!(hasher.hash(& &[1u8, 2u8, 3u8]), 9);
 
         unsafe {
diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs
index d69e9b448be..99a281755e4 100644
--- a/src/libstd/path/posix.rs
+++ b/src/libstd/path/posix.rs
@@ -555,7 +555,7 @@ mod tests {
             ($path:expr, $disp:ident, $exp:expr) => (
                 {
                     let path = Path::new($path);
-                    assert!(path.$disp().to_str() == ~$exp);
+                    assert!(path.$disp().to_str().as_slice() == $exp);
                 }
             )
         )
diff --git a/src/libstd/repr.rs b/src/libstd/repr.rs
index 61154502445..fc0137d00b7 100644
--- a/src/libstd/repr.rs
+++ b/src/libstd/repr.rs
@@ -637,7 +637,7 @@ fn test_repr() {
     exact_test(&true, "true");
     exact_test(&false, "false");
     exact_test(&1.234, "1.234f64");
-    exact_test(&(&"hello"), "\"hello\"");
+    exact_test(&("hello"), "\"hello\"");
     // FIXME What do I do about this one?
     exact_test(&("he\u10f3llo".to_owned()), "~\"he\\u10f3llo\"");
 
diff --git a/src/libstd/str.rs b/src/libstd/str.rs
index bc7943dd777..b105dd0ca5a 100644
--- a/src/libstd/str.rs
+++ b/src/libstd/str.rs
@@ -2025,12 +2025,12 @@ pub trait StrSlice<'a> {
     /// # Example
     ///
     /// ```rust
-    /// let s = ~"Do you know the muffin man,
-    /// The muffin man, the muffin man, ...";
+    /// let s = "Do you know the muffin man,
+    /// The muffin man, the muffin man, ...".to_owned();
     ///
     /// assert_eq!(s.replace("muffin man", "little lamb"),
-    ///            ~"Do you know the little lamb,
-    /// The little lamb, the little lamb, ...");
+    ///            "Do you know the little lamb,
+    /// The little lamb, the little lamb, ...".to_owned());
     ///
     /// // not found, so no change.
     /// assert_eq!(s.replace("cookie monster", "little lamb"), s);
@@ -3604,11 +3604,11 @@ mod tests {
 
     #[test]
     fn test_total_ord() {
-        "1234".cmp(& &"123") == Greater;
-        "123".cmp(& &"1234") == Less;
-        "1234".cmp(& &"1234") == Equal;
-        "12345555".cmp(& &"123456") == Less;
-        "22".cmp(& &"1234") == Greater;
+        "1234".cmp(&("123")) == Greater;
+        "123".cmp(&("1234")) == Less;
+        "1234".cmp(&("1234")) == Equal;
+        "12345555".cmp(&("123456")) == Less;
+        "22".cmp(&("1234")) == Greater;
     }
 
     #[test]
@@ -4005,7 +4005,7 @@ mod tests {
 
     #[test]
     fn test_from_str() {
-      let owned: Option<~str> = from_str(&"string");
+      let owned: Option<~str> = from_str("string");
       assert_eq!(owned, Some("string".to_owned()));
     }
 
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs
index aeb1bf555e8..fa2f53fcf69 100644
--- a/src/libstd/vec.rs
+++ b/src/libstd/vec.rs
@@ -242,7 +242,7 @@ impl<T: Clone> Vec<T> {
     ///
     /// ```rust
     /// let mut vec = vec!("hello");
-    /// vec.grow(2, & &"world");
+    /// vec.grow(2, &("world"));
     /// assert_eq!(vec, vec!("hello", "world", "world"));
     /// ```
     pub fn grow(&mut self, n: uint, value: &T) {
@@ -267,8 +267,8 @@ impl<T: Clone> Vec<T> {
     ///
     /// ```rust
     /// let mut vec = vec!("a", "b", "c");
-    /// vec.grow_set(1, & &"fill", "d");
-    /// vec.grow_set(4, & &"fill", "e");
+    /// vec.grow_set(1, &("fill"), "d");
+    /// vec.grow_set(4, &("fill"), "e");
     /// assert_eq!(vec, vec!("a", "d", "c", "fill", "e"));
     /// ```
     pub fn grow_set(&mut self, index: uint, initval: &T, value: T) {