about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/test/auxiliary/cci_class_4.rs4
-rw-r--r--src/test/auxiliary/cci_class_cast.rs4
-rw-r--r--src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs4
-rw-r--r--src/test/auxiliary/crateresolve5-1.rs4
-rw-r--r--src/test/auxiliary/crateresolve5-2.rs4
-rw-r--r--src/test/auxiliary/explicit_self_xcrate.rs2
-rw-r--r--src/test/auxiliary/issue-2414-a.rs2
-rw-r--r--src/test/auxiliary/issue-2631-a.rs6
-rw-r--r--src/test/auxiliary/issue13507.rs2
-rw-r--r--src/test/auxiliary/issue_2242_a.rs6
-rw-r--r--src/test/auxiliary/issue_2242_c.rs2
-rw-r--r--src/test/auxiliary/reexported_static_methods.rs6
-rw-r--r--src/test/auxiliary/static-methods-crate.rs10
-rw-r--r--src/test/bench/core-set.rs16
-rw-r--r--src/test/bench/core-std.rs10
-rw-r--r--src/test/bench/msgsend-pipes-shared.rs14
-rw-r--r--src/test/bench/msgsend-pipes.rs12
-rw-r--r--src/test/bench/shootout-binarytrees.rs6
-rw-r--r--src/test/bench/shootout-chameneos-redux.rs8
-rw-r--r--src/test/bench/shootout-k-nucleotide-pipes.rs24
-rw-r--r--src/test/bench/shootout-meteor.rs4
-rw-r--r--src/test/bench/shootout-pfib.rs9
-rw-r--r--src/test/compile-fail/bad-const-type.rs6
-rw-r--r--src/test/compile-fail/bad-expr-path.rs2
-rw-r--r--src/test/compile-fail/bad-expr-path2.rs2
-rw-r--r--src/test/compile-fail/binop-bitxor-str.rs4
-rw-r--r--src/test/compile-fail/borrowck-move-error-with-note.rs6
-rw-r--r--src/test/compile-fail/borrowck-move-in-irrefut-pat.rs4
-rw-r--r--src/test/compile-fail/borrowck-move-out-of-struct-with-dtor.rs6
-rw-r--r--src/test/compile-fail/borrowck-move-out-of-tuple-struct-with-dtor.rs6
-rw-r--r--src/test/compile-fail/borrowck-move-out-of-vec-tail.rs8
-rw-r--r--src/test/compile-fail/break-outside-loop.rs2
-rw-r--r--src/test/compile-fail/by-move-pattern-binding.rs6
-rw-r--r--src/test/compile-fail/check-static-values-constraints.rs7
-rw-r--r--src/test/compile-fail/circular_modules_main.rs2
-rw-r--r--src/test/compile-fail/class-cast-to-trait.rs6
-rw-r--r--src/test/compile-fail/disallowed-deconstructing-destructing-struct-let.rs6
-rw-r--r--src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs4
-rw-r--r--src/test/compile-fail/estr-subtyping.rs8
-rw-r--r--src/test/compile-fail/generic-type-params-name-repr.rs8
-rw-r--r--src/test/compile-fail/import.rs2
-rw-r--r--src/test/compile-fail/import2.rs2
-rw-r--r--src/test/compile-fail/integral-indexing.rs14
-rw-r--r--src/test/compile-fail/issue-13428.rs10
-rw-r--r--src/test/compile-fail/issue-2063.rs4
-rw-r--r--src/test/compile-fail/issue-3099.rs4
-rw-r--r--src/test/compile-fail/issue-3601.rs2
-rw-r--r--src/test/compile-fail/issue-3973.rs2
-rw-r--r--src/test/compile-fail/issue-5543.rs2
-rw-r--r--src/test/compile-fail/issue-6458-4.rs2
-rw-r--r--src/test/compile-fail/issue-7573.rs8
-rw-r--r--src/test/compile-fail/issue-7575.rs2
-rw-r--r--src/test/compile-fail/kindck-copy.rs2
-rw-r--r--src/test/compile-fail/kindck-send.rs2
-rw-r--r--src/test/compile-fail/lint-unused-unsafe.rs2
-rw-r--r--src/test/compile-fail/lub-if.rs16
-rw-r--r--src/test/compile-fail/lub-match.rs16
-rw-r--r--src/test/compile-fail/map-types.rs10
-rw-r--r--src/test/compile-fail/match-vec-mismatch.rs4
-rw-r--r--src/test/compile-fail/match-vec-unreachable.rs6
-rw-r--r--src/test/compile-fail/minus-string.rs4
-rw-r--r--src/test/compile-fail/moves-based-on-type-access-to-field.rs8
-rw-r--r--src/test/compile-fail/moves-based-on-type-exprs.rs28
-rw-r--r--src/test/compile-fail/moves-based-on-type-match-bindings.rs2
-rw-r--r--src/test/compile-fail/multitrait.rs2
-rw-r--r--src/test/compile-fail/unsendable-class.rs6
-rw-r--r--src/test/debuginfo/issue11600.rs4
-rw-r--r--src/test/pretty/closure-reform-pretty.rs2
-rw-r--r--src/test/run-fail/binop-fail-2.rs4
-rw-r--r--src/test/run-fail/binop-fail.rs4
-rw-r--r--src/test/run-fail/fmt-fail.rs5
-rw-r--r--src/test/run-fail/if-cond-bot.rs4
-rw-r--r--src/test/run-fail/match-bot-fail.rs2
-rw-r--r--src/test/run-fail/result-get-fail.rs2
-rw-r--r--src/test/run-fail/rhs-type.rs2
-rw-r--r--src/test/run-fail/str-overrun.rs4
-rw-r--r--src/test/run-fail/unwind-lambda.rs10
-rw-r--r--src/test/run-make/unicode-input/span_length.rs2
-rw-r--r--src/test/run-pass-fulldeps/qquote.rs2
-rw-r--r--src/test/run-pass/alias-uninit-value.rs6
-rw-r--r--src/test/run-pass/autobind.rs5
-rw-r--r--src/test/run-pass/autoref-intermediate-types-issue-3585.rs12
-rw-r--r--src/test/run-pass/backtrace.rs13
-rw-r--r--src/test/run-pass/block-explicit-types.rs4
-rw-r--r--src/test/run-pass/borrowed-ptr-pattern-2.rs6
-rw-r--r--src/test/run-pass/bug-7183-generics.rs27
-rw-r--r--src/test/run-pass/c-stack-returning-int64.rs13
-rw-r--r--src/test/run-pass/child-outlives-parent.rs4
-rw-r--r--src/test/run-pass/class-attributes-1.rs6
-rw-r--r--src/test/run-pass/class-attributes-2.rs6
-rw-r--r--src/test/run-pass/class-cast-to-trait-cross-crate-2.rs8
-rw-r--r--src/test/run-pass/class-cast-to-trait-multiple-types.rs6
-rw-r--r--src/test/run-pass/class-cast-to-trait.rs6
-rw-r--r--src/test/run-pass/class-exports.rs9
-rw-r--r--src/test/run-pass/class-impl-very-parameterized-trait.rs4
-rw-r--r--src/test/run-pass/class-implement-trait-cross-crate.rs6
-rw-r--r--src/test/run-pass/class-implement-traits.rs6
-rw-r--r--src/test/run-pass/class-separate-impl.rs12
-rw-r--r--src/test/run-pass/class-str-field.rs6
-rw-r--r--src/test/run-pass/classes-cross-crate.rs2
-rw-r--r--src/test/run-pass/classes.rs6
-rw-r--r--src/test/run-pass/closure-reform.rs18
-rw-r--r--src/test/run-pass/complex.rs6
-rw-r--r--src/test/run-pass/conditional-compile.rs4
-rw-r--r--src/test/run-pass/const-enum-structlike.rs2
-rw-r--r--src/test/run-pass/crate-method-reexport-grrrrrrr.rs2
-rw-r--r--src/test/run-pass/deriving-hash.rs14
-rw-r--r--src/test/run-pass/deriving-show-2.rs2
-rw-r--r--src/test/run-pass/deriving-via-extension-struct-tuple.rs8
-rw-r--r--src/test/run-pass/drop-on-ret.rs2
-rw-r--r--src/test/run-pass/enum-disr-val-pretty.rs10
-rw-r--r--src/test/run-pass/enum-variants.rs10
-rw-r--r--src/test/run-pass/estr-uniq.rs10
-rw-r--r--src/test/run-pass/explicit_self_xcrate_exe.rs2
-rw-r--r--src/test/run-pass/foreign-fn-linkname.rs6
-rw-r--r--src/test/run-pass/hashmap-memory.rs29
-rw-r--r--src/test/run-pass/html-literals.rs10
-rw-r--r--src/test/run-pass/issue-10228.rs2
-rw-r--r--src/test/run-pass/issue-13304.rs15
-rw-r--r--src/test/run-pass/issue-1701.rs18
-rw-r--r--src/test/run-pass/issue-2631-b.rs4
-rw-r--r--src/test/run-pass/issue-2804-2.rs4
-rw-r--r--src/test/run-pass/issue-2804.rs24
-rw-r--r--src/test/run-pass/issue-3037.rs2
-rw-r--r--src/test/run-pass/issue-3389.rs8
-rw-r--r--src/test/run-pass/issue-3424.rs6
-rw-r--r--src/test/run-pass/issue-3556.rs23
-rw-r--r--src/test/run-pass/issue-3563-3.rs6
-rw-r--r--src/test/run-pass/issue-3609.rs4
-rw-r--r--src/test/run-pass/issue-3702.rs2
-rw-r--r--src/test/run-pass/issue-3935.rs6
-rw-r--r--src/test/run-pass/issue-4241.rs12
-rw-r--r--src/test/run-pass/issue-4541.rs6
-rw-r--r--src/test/run-pass/issue-5008-borrowed-traitobject-method-call.rs8
-rw-r--r--src/test/run-pass/issue-5353.rs8
-rw-r--r--src/test/run-pass/issue-5550.rs4
-rw-r--r--src/test/run-pass/issue-5666.rs12
-rw-r--r--src/test/run-pass/issue-8506.rs2
-rw-r--r--src/test/run-pass/issue-8578.rs2
-rw-r--r--src/test/run-pass/issue-8898.rs16
-rw-r--r--src/test/run-pass/issue-9047.rs4
-rw-r--r--src/test/run-pass/issue-9259.rs8
-rw-r--r--src/test/run-pass/issue-9394-inherited-trait-calls.rs46
-rw-r--r--src/test/run-pass/issue-9446.rs8
-rw-r--r--src/test/run-pass/istr.rs33
-rw-r--r--src/test/run-pass/last-use-in-block.rs6
-rw-r--r--src/test/run-pass/log-knows-the-names-of-variants-in-std.rs20
-rw-r--r--src/test/run-pass/log-knows-the-names-of-variants.rs9
-rw-r--r--src/test/run-pass/match-borrowed_str.rs56
-rw-r--r--src/test/run-pass/match-str.rs8
-rw-r--r--src/test/run-pass/monad.rs17
-rw-r--r--src/test/run-pass/move-self.rs4
-rw-r--r--src/test/run-pass/nullable-pointer-iotareduction.rs2
-rw-r--r--src/test/run-pass/nullable-pointer-size.rs1
-rw-r--r--src/test/run-pass/packed-struct-generic-size.rs3
-rw-r--r--src/test/run-pass/packed-struct-size.rs5
-rw-r--r--src/test/run-pass/packed-tuple-struct-size.rs5
-rw-r--r--src/test/run-pass/rec-auto.rs4
-rw-r--r--src/test/run-pass/reexported-static-methods-cross-crate.rs2
-rw-r--r--src/test/run-pass/reflect-visit-type.rs24
-rw-r--r--src/test/run-pass/repeated-vector-syntax.rs5
-rw-r--r--src/test/run-pass/ret-bang.rs8
-rw-r--r--src/test/run-pass/send_str_treemap.rs4
-rw-r--r--src/test/run-pass/shape_intrinsic_tag_then_rec.rs4
-rw-r--r--src/test/run-pass/spawn-fn.rs14
-rw-r--r--src/test/run-pass/spawn-types.rs6
-rw-r--r--src/test/run-pass/static-impl.rs12
-rw-r--r--src/test/run-pass/static-method-xcrate.rs6
-rw-r--r--src/test/run-pass/str-concat.rs8
-rw-r--r--src/test/run-pass/str-multiline.rs12
-rw-r--r--src/test/run-pass/string-self-append.rs4
-rw-r--r--src/test/run-pass/struct-literal-dtor.rs6
-rw-r--r--src/test/run-pass/struct-order-of-eval-1.rs12
-rw-r--r--src/test/run-pass/struct-order-of-eval-2.rs12
-rw-r--r--src/test/run-pass/swap-overlapping.rs4
-rw-r--r--src/test/run-pass/syntax-extension-source-utils.rs15
-rw-r--r--src/test/run-pass/tag-variant-disr-val.rs56
-rw-r--r--src/test/run-pass/tail-call-arg-leak.rs6
-rw-r--r--src/test/run-pass/task-comm-10.rs14
-rw-r--r--src/test/run-pass/task-life-0.rs4
-rw-r--r--src/test/run-pass/trait-bounds-in-arc.rs31
-rw-r--r--src/test/run-pass/trait-cast.rs24
-rw-r--r--src/test/run-pass/trait-generic.rs26
-rw-r--r--src/test/run-pass/trait-to-str.rs26
-rw-r--r--src/test/run-pass/traits-default-method-macro.rs6
-rw-r--r--src/test/run-pass/utf8.rs28
-rw-r--r--src/test/run-pass/utf8_chars.rs12
-rw-r--r--src/test/run-pass/variant-attributes.rs4
-rw-r--r--src/test/run-pass/vec-tail-matching.rs18
189 files changed, 843 insertions, 772 deletions
diff --git a/src/test/auxiliary/cci_class_4.rs b/src/test/auxiliary/cci_class_4.rs
index 733509753d3..67e57de085a 100644
--- a/src/test/auxiliary/cci_class_4.rs
+++ b/src/test/auxiliary/cci_class_4.rs
@@ -13,7 +13,7 @@ pub mod kitties {
         meows : uint,
 
         pub how_hungry : int,
-        pub name : ~str,
+        pub name : StrBuf,
     }
 
     impl cat {
@@ -41,7 +41,7 @@ pub mod kitties {
         }
     }
 
-    pub fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
+    pub fn cat(in_x : uint, in_y : int, in_name: StrBuf) -> cat {
         cat {
             meows: in_x,
             how_hungry: in_y,
diff --git a/src/test/auxiliary/cci_class_cast.rs b/src/test/auxiliary/cci_class_cast.rs
index 2ce4f818659..0abacf9ecdd 100644
--- a/src/test/auxiliary/cci_class_cast.rs
+++ b/src/test/auxiliary/cci_class_cast.rs
@@ -14,7 +14,7 @@ pub mod kitty {
     pub struct cat {
       meows : uint,
       pub how_hungry : int,
-      pub name : ~str,
+      pub name : StrBuf,
     }
 
     impl fmt::Show for cat {
@@ -50,7 +50,7 @@ pub mod kitty {
         }
     }
 
-    pub fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
+    pub fn cat(in_x : uint, in_y : int, in_name: StrBuf) -> cat {
         cat {
             meows: in_x,
             how_hungry: in_y,
diff --git a/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs b/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs
index f7b42e05d7f..36e46f6c8c2 100644
--- a/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs
+++ b/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs
@@ -17,11 +17,11 @@ pub mod name_pool {
     pub type name_pool = ();
 
     pub trait add {
-        fn add(&self, s: ~str);
+        fn add(&self, s: StrBuf);
     }
 
     impl add for name_pool {
-        fn add(&self, _s: ~str) {
+        fn add(&self, _s: StrBuf) {
         }
     }
 }
diff --git a/src/test/auxiliary/crateresolve5-1.rs b/src/test/auxiliary/crateresolve5-1.rs
index 8c9ce5dda66..ca3cf1bd857 100644
--- a/src/test/auxiliary/crateresolve5-1.rs
+++ b/src/test/auxiliary/crateresolve5-1.rs
@@ -12,10 +12,10 @@
 
 #![crate_type = "lib"]
 
-pub struct NameVal { pub name: ~str, pub val: int }
+pub struct NameVal { pub name: StrBuf, pub val: int }
 
 pub fn struct_nameval() -> NameVal {
-    NameVal { name: "crateresolve5".to_owned(), val: 10 }
+    NameVal { name: "crateresolve5".to_strbuf(), val: 10 }
 }
 
 pub enum e {
diff --git a/src/test/auxiliary/crateresolve5-2.rs b/src/test/auxiliary/crateresolve5-2.rs
index 52296e2c054..631f68d0b84 100644
--- a/src/test/auxiliary/crateresolve5-2.rs
+++ b/src/test/auxiliary/crateresolve5-2.rs
@@ -12,9 +12,9 @@
 
 #![crate_type = "lib"]
 
-pub struct NameVal { pub name: ~str, pub val: int }
+pub struct NameVal { pub name: StrBuf, pub val: int }
 pub fn struct_nameval() -> NameVal {
-    NameVal { name: "crateresolve5".to_owned(), val: 10 }
+    NameVal { name: "crateresolve5".to_strbuf(), val: 10 }
 }
 
 pub enum e {
diff --git a/src/test/auxiliary/explicit_self_xcrate.rs b/src/test/auxiliary/explicit_self_xcrate.rs
index e482e8c62ca..c23af84b3f5 100644
--- a/src/test/auxiliary/explicit_self_xcrate.rs
+++ b/src/test/auxiliary/explicit_self_xcrate.rs
@@ -14,7 +14,7 @@ pub trait Foo {
 }
 
 pub struct Bar {
-    pub x: ~str
+    pub x: StrBuf
 }
 
 impl Foo for Bar {
diff --git a/src/test/auxiliary/issue-2414-a.rs b/src/test/auxiliary/issue-2414-a.rs
index 0e444a43c7c..7767859144a 100644
--- a/src/test/auxiliary/issue-2414-a.rs
+++ b/src/test/auxiliary/issue-2414-a.rs
@@ -17,6 +17,6 @@ trait foo {
     fn foo(&self);
 }
 
-impl foo for ~str {
+impl foo for StrBuf {
     fn foo(&self) {}
 }
diff --git a/src/test/auxiliary/issue-2631-a.rs b/src/test/auxiliary/issue-2631-a.rs
index 5da5653f26e..495999bfcbc 100644
--- a/src/test/auxiliary/issue-2631-a.rs
+++ b/src/test/auxiliary/issue-2631-a.rs
@@ -17,9 +17,11 @@ extern crate collections;
 use std::cell::RefCell;
 use collections::HashMap;
 
-pub type header_map = HashMap<~str, @RefCell<Vec<@~str>>>;
+pub type header_map = HashMap<StrBuf, @RefCell<Vec<@StrBuf>>>;
 
 // the unused ty param is necessary so this gets monomorphized
 pub fn request<T>(req: &header_map) {
-  let _x = (**((**req.get(&"METHOD".to_owned())).clone()).borrow().clone().get(0)).clone();
+  let _x = (**((**req.get(&"METHOD".to_strbuf())).clone()).borrow()
+                                                          .clone()
+                                                          .get(0)).clone();
 }
diff --git a/src/test/auxiliary/issue13507.rs b/src/test/auxiliary/issue13507.rs
index 2b4df978cc8..3c860958e2c 100644
--- a/src/test/auxiliary/issue13507.rs
+++ b/src/test/auxiliary/issue13507.rs
@@ -48,7 +48,7 @@ pub mod testtypes {
     // Tests ty_float (does not test all variants of FloatTy)
     pub type FooFloat = f64;
 
-    // For ty_str, what kind of string should I use? &'static str? ~str? Raw str?
+    // For ty_str, what kind of string should I use? &'static str? StrBuf? Raw str?
 
     // Tests ty_enum
     pub enum FooEnum {
diff --git a/src/test/auxiliary/issue_2242_a.rs b/src/test/auxiliary/issue_2242_a.rs
index e51624dec38..855e48f3f91 100644
--- a/src/test/auxiliary/issue_2242_a.rs
+++ b/src/test/auxiliary/issue_2242_a.rs
@@ -12,9 +12,9 @@
 #![crate_type = "lib"]
 
 trait to_strz {
-    fn to_strz() -> ~str;
+    fn to_strz() -> StrBuf;
 }
 
-impl to_strz for ~str {
-    fn to_strz() -> ~str { self.clone() }
+impl to_strz for StrBuf {
+    fn to_strz() -> StrBuf { self.clone() }
 }
diff --git a/src/test/auxiliary/issue_2242_c.rs b/src/test/auxiliary/issue_2242_c.rs
index 4beb8118e21..6c04a742efb 100644
--- a/src/test/auxiliary/issue_2242_c.rs
+++ b/src/test/auxiliary/issue_2242_c.rs
@@ -16,5 +16,5 @@ extern crate a;
 use a::to_strz;
 
 impl to_strz for bool {
-    fn to_strz() -> ~str { fmt!("%b", self) }
+    fn to_strz() -> StrBuf { fmt!("%b", self) }
 }
diff --git a/src/test/auxiliary/reexported_static_methods.rs b/src/test/auxiliary/reexported_static_methods.rs
index 6d94bfcf613..f93bd5e2e49 100644
--- a/src/test/auxiliary/reexported_static_methods.rs
+++ b/src/test/auxiliary/reexported_static_methods.rs
@@ -31,7 +31,7 @@ pub mod sub_foo {
     }
 
     pub struct Boz {
-        unused_str: ~str
+        unused_str: StrBuf
     }
 
     impl Boz {
@@ -46,8 +46,8 @@ pub mod sub_foo {
     }
 
     impl Bort {
-        pub fn bort() -> ~str {
-            "bort()".to_owned()
+        pub fn bort() -> StrBuf {
+            "bort()".to_strbuf()
         }
     }
 }
diff --git a/src/test/auxiliary/static-methods-crate.rs b/src/test/auxiliary/static-methods-crate.rs
index 4e0489b0685..367ab47ceaa 100644
--- a/src/test/auxiliary/static-methods-crate.rs
+++ b/src/test/auxiliary/static-methods-crate.rs
@@ -14,17 +14,17 @@
 use std::int;
 
 pub trait read {
-    fn readMaybe(s: ~str) -> Option<Self>;
+    fn readMaybe(s: StrBuf) -> Option<Self>;
 }
 
 impl read for int {
-    fn readMaybe(s: ~str) -> Option<int> {
-        from_str::<int>(s)
+    fn readMaybe(s: StrBuf) -> Option<int> {
+        from_str::<int>(s.as_slice())
     }
 }
 
 impl read for bool {
-    fn readMaybe(s: ~str) -> Option<bool> {
+    fn readMaybe(s: StrBuf) -> Option<bool> {
         match s.as_slice() {
           "true" => Some(true),
           "false" => Some(false),
@@ -33,7 +33,7 @@ impl read for bool {
     }
 }
 
-pub fn read<T:read>(s: ~str) -> T {
+pub fn read<T:read>(s: StrBuf) -> T {
     match read::readMaybe(s) {
       Some(x) => x,
       _ => fail!("read failed!")
diff --git a/src/test/bench/core-set.rs b/src/test/bench/core-set.rs
index 53b371e06cb..757d61f2857 100644
--- a/src/test/bench/core-set.rs
+++ b/src/test/bench/core-set.rs
@@ -80,7 +80,7 @@ impl Results {
         }
     }
 
-    pub fn bench_str<T:MutableSet<~str>,
+    pub fn bench_str<T:MutableSet<StrBuf>,
                      R:rand::Rng>(
                      &mut self,
                      rng: &mut R,
@@ -90,11 +90,11 @@ impl Results {
             let mut set = f();
             timed(&mut self.sequential_strings, || {
                 for i in range(0u, num_keys) {
-                    set.insert(i.to_str());
+                    set.insert(i.to_str().to_strbuf());
                 }
 
                 for i in range(0u, num_keys) {
-                    assert!(set.contains(&i.to_str()));
+                    assert!(set.contains(&i.to_str().to_strbuf()));
                 }
             })
         }
@@ -103,7 +103,7 @@ impl Results {
             let mut set = f();
             timed(&mut self.random_strings, || {
                 for _ in range(0, num_keys) {
-                    let s = rng.gen::<uint>().to_str();
+                    let s = rng.gen::<uint>().to_str().to_strbuf();
                     set.insert(s);
                 }
             })
@@ -112,11 +112,11 @@ impl Results {
         {
             let mut set = f();
             for i in range(0u, num_keys) {
-                set.insert(i.to_str());
+                set.insert(i.to_str().to_strbuf());
             }
             timed(&mut self.delete_strings, || {
                 for i in range(0u, num_keys) {
-                    assert!(set.remove(&i.to_str()));
+                    assert!(set.remove(&i.to_str().to_strbuf()));
                 }
             })
         }
@@ -175,7 +175,7 @@ fn main() {
             s
         });
         results.bench_str(&mut rng, num_keys, || {
-            let s: HashSet<~str> = HashSet::new();
+            let s: HashSet<StrBuf> = HashSet::new();
             s
         });
         write_results("collections::HashSet", &results);
@@ -189,7 +189,7 @@ fn main() {
             s
         });
         results.bench_str(&mut rng, num_keys, || {
-            let s: TreeSet<~str> = TreeSet::new();
+            let s: TreeSet<StrBuf> = TreeSet::new();
             s
         });
         write_results("collections::TreeSet", &results);
diff --git a/src/test/bench/core-std.rs b/src/test/bench/core-std.rs
index 7e54198bd39..9c854a31c1e 100644
--- a/src/test/bench/core-std.rs
+++ b/src/test/bench/core-std.rs
@@ -24,11 +24,13 @@ use std::vec;
 use std::io::File;
 
 macro_rules! bench (
-    ($argv:expr, $id:ident) => (maybe_run_test($argv.as_slice(), stringify!($id).to_owned(), $id))
+    ($argv:expr, $id:ident) => (maybe_run_test($argv.as_slice(),
+                                               stringify!($id).to_strbuf(),
+                                                          $id))
 )
 
 fn main() {
-    let argv = os::args();
+    let argv = os::args().move_iter().map(|x| x.to_strbuf()).collect::<Vec<StrBuf>>();
     let _tests = argv.slice(1, argv.len());
 
     bench!(argv, shift_push);
@@ -40,13 +42,13 @@ fn main() {
     bench!(argv, is_utf8_multibyte);
 }
 
-fn maybe_run_test(argv: &[~str], name: ~str, test: ||) {
+fn maybe_run_test(argv: &[StrBuf], name: StrBuf, test: ||) {
     let mut run_test = false;
 
     if os::getenv("RUST_BENCH").is_some() {
         run_test = true
     } else if argv.len() > 0 {
-        run_test = argv.iter().any(|x| x == &"all".to_owned()) || argv.iter().any(|x| x == &name)
+        run_test = argv.iter().any(|x| x == &"all".to_strbuf()) || argv.iter().any(|x| x == &name)
     }
 
     if !run_test {
diff --git a/src/test/bench/msgsend-pipes-shared.rs b/src/test/bench/msgsend-pipes-shared.rs
index 5a42d2e3c59..0135688a81c 100644
--- a/src/test/bench/msgsend-pipes-shared.rs
+++ b/src/test/bench/msgsend-pipes-shared.rs
@@ -52,12 +52,12 @@ fn server(requests: &Receiver<request>, responses: &Sender<uint>) {
     //println!("server exiting");
 }
 
-fn run(args: &[~str]) {
+fn run(args: &[StrBuf]) {
     let (to_parent, from_child) = channel();
     let (to_child, from_parent) = channel();
 
-    let size = from_str::<uint>(args[1]).unwrap();
-    let workers = from_str::<uint>(args[2]).unwrap();
+    let size = from_str::<uint>(args[1].as_slice()).unwrap();
+    let workers = from_str::<uint>(args[2].as_slice()).unwrap();
     let num_bytes = 100;
     let start = time::precise_time_s();
     let mut worker_results = Vec::new();
@@ -97,13 +97,13 @@ fn run(args: &[~str]) {
 fn main() {
     let args = os::args();
     let args = if os::getenv("RUST_BENCH").is_some() {
-        vec!("".to_owned(), "1000000".to_owned(), "10000".to_owned())
+        vec!("".to_strbuf(), "1000000".to_strbuf(), "10000".to_strbuf())
     } else if args.len() <= 1u {
-        vec!("".to_owned(), "10000".to_owned(), "4".to_owned())
+        vec!("".to_strbuf(), "10000".to_strbuf(), "4".to_strbuf())
     } else {
-        args.clone().move_iter().collect()
+        args.move_iter().map(|x| x.to_strbuf()).collect()
     };
 
-    println!("{:?}", args);
+    println!("{}", args);
     run(args.as_slice());
 }
diff --git a/src/test/bench/msgsend-pipes.rs b/src/test/bench/msgsend-pipes.rs
index 741cc4be4fa..20ed7efcb83 100644
--- a/src/test/bench/msgsend-pipes.rs
+++ b/src/test/bench/msgsend-pipes.rs
@@ -47,11 +47,11 @@ fn server(requests: &Receiver<request>, responses: &Sender<uint>) {
     //println!("server exiting");
 }
 
-fn run(args: &[~str]) {
+fn run(args: &[StrBuf]) {
     let (to_parent, from_child) = channel();
 
-    let size = from_str::<uint>(args[1]).unwrap();
-    let workers = from_str::<uint>(args[2]).unwrap();
+    let size = from_str::<uint>(args[1].as_slice()).unwrap();
+    let workers = from_str::<uint>(args[2].as_slice()).unwrap();
     let num_bytes = 100;
     let start = time::precise_time_s();
     let mut worker_results = Vec::new();
@@ -107,11 +107,11 @@ fn run(args: &[~str]) {
 fn main() {
     let args = os::args();
     let args = if os::getenv("RUST_BENCH").is_some() {
-        vec!("".to_owned(), "1000000".to_owned(), "8".to_owned())
+        vec!("".to_strbuf(), "1000000".to_strbuf(), "8".to_strbuf())
     } else if args.len() <= 1u {
-        vec!("".to_owned(), "10000".to_owned(), "4".to_owned())
+        vec!("".to_strbuf(), "10000".to_strbuf(), "4".to_strbuf())
     } else {
-        args.clone().move_iter().collect()
+        args.clone().move_iter().map(|x| x.to_strbuf()).collect()
     };
 
     println!("{:?}", args);
diff --git a/src/test/bench/shootout-binarytrees.rs b/src/test/bench/shootout-binarytrees.rs
index 8914c5b327e..181d19ade3a 100644
--- a/src/test/bench/shootout-binarytrees.rs
+++ b/src/test/bench/shootout-binarytrees.rs
@@ -74,10 +74,10 @@ fn main() {
                     let b = bottom_up_tree(&arena, -i, depth);
                     chk += item_check(a) + item_check(b);
                 }
-                format!("{}\t trees of depth {}\t check: {}",
-                        iterations * 2, depth, chk)
+                format_strbuf!("{}\t trees of depth {}\t check: {}",
+                               iterations * 2, depth, chk)
             })
-        }).collect::<Vec<Future<~str>>>();
+        }).collect::<Vec<Future<StrBuf>>>();
 
     for message in messages.mut_iter() {
         println!("{}", *message.get_ref());
diff --git a/src/test/bench/shootout-chameneos-redux.rs b/src/test/bench/shootout-chameneos-redux.rs
index 07e5b08c37c..9db068e56c2 100644
--- a/src/test/bench/shootout-chameneos-redux.rs
+++ b/src/test/bench/shootout-chameneos-redux.rs
@@ -107,7 +107,7 @@ fn creature(
     mut color: Color,
     from_rendezvous: Receiver<CreatureInfo>,
     to_rendezvous: Sender<CreatureInfo>,
-    to_rendezvous_log: Sender<~str>
+    to_rendezvous_log: Sender<StrBuf>
 ) {
     let mut creatures_met = 0;
     let mut evil_clones_met = 0;
@@ -132,7 +132,9 @@ fn creature(
         }
     }
     // log creatures met and evil clones of self
-    let report = format!("{}{}", creatures_met, Number(evil_clones_met));
+    let report = format_strbuf!("{}{}",
+                                creatures_met,
+                                Number(evil_clones_met));
     to_rendezvous_log.send(report);
 }
 
@@ -141,7 +143,7 @@ fn rendezvous(nn: uint, set: Vec<Color>) {
     let (to_rendezvous, from_creatures) = channel::<CreatureInfo>();
 
     // these channels will be passed to the creatures so they can talk to us
-    let (to_rendezvous_log, from_creatures_log) = channel::<~str>();
+    let (to_rendezvous_log, from_creatures_log) = channel::<StrBuf>();
 
     // these channels will allow us to talk to each creature by 'name'/index
     let mut to_creature: Vec<Sender<CreatureInfo>> =
diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs
index 04032c4aa39..250562a095e 100644
--- a/src/test/bench/shootout-k-nucleotide-pipes.rs
+++ b/src/test/bench/shootout-k-nucleotide-pipes.rs
@@ -37,7 +37,7 @@ fn f64_cmp(x: f64, y: f64) -> Ordering {
 }
 
 // given a map, print a sorted version of it
-fn sort_and_fmt(mm: &HashMap<Vec<u8> , uint>, total: uint) -> ~str {
+fn sort_and_fmt(mm: &HashMap<Vec<u8> , uint>, total: uint) -> StrBuf {
    fn pct(xx: uint, yy: uint) -> f64 {
       return (xx as f64) * 100.0 / (yy as f64);
    }
@@ -67,12 +67,12 @@ fn sort_and_fmt(mm: &HashMap<Vec<u8> , uint>, total: uint) -> ~str {
                                .into_str(), v));
    }
 
-   return buffer.into_owned();
+   return buffer
 }
 
 // given a map, search for the frequency of a pattern
-fn find(mm: &HashMap<Vec<u8> , uint>, key: ~str) -> uint {
-   let key = key.into_ascii().as_slice().to_lower().into_str();
+fn find(mm: &HashMap<Vec<u8> , uint>, key: StrBuf) -> uint {
+   let key = key.to_owned().into_ascii().as_slice().to_lower().into_str();
    match mm.find_equiv(&key.as_bytes()) {
       option::None      => { return 0u; }
       option::Some(&num) => { return num; }
@@ -106,7 +106,7 @@ fn windows_with_carry(bb: &[u8], nn: uint, it: |window: &[u8]|) -> Vec<u8> {
 
 fn make_sequence_processor(sz: uint,
                            from_parent: &Receiver<Vec<u8>>,
-                           to_parent: &Sender<~str>) {
+                           to_parent: &Sender<StrBuf>) {
    let mut freqs: HashMap<Vec<u8>, uint> = HashMap::new();
    let mut carry = Vec::new();
    let mut total: uint = 0u;
@@ -129,13 +129,13 @@ fn make_sequence_processor(sz: uint,
    let buffer = match sz {
        1u => { sort_and_fmt(&freqs, total) }
        2u => { sort_and_fmt(&freqs, total) }
-       3u => { format!("{}\t{}", find(&freqs, "GGT".to_owned()), "GGT") }
-       4u => { format!("{}\t{}", find(&freqs, "GGTA".to_owned()), "GGTA") }
-       6u => { format!("{}\t{}", find(&freqs, "GGTATT".to_owned()), "GGTATT") }
-      12u => { format!("{}\t{}", find(&freqs, "GGTATTTTAATT".to_owned()), "GGTATTTTAATT") }
-      18u => { format!("{}\t{}", find(&freqs, "GGTATTTTAATTTATAGT".to_owned()),
+       3u => { format_strbuf!("{}\t{}", find(&freqs, "GGT".to_strbuf()), "GGT") }
+       4u => { format_strbuf!("{}\t{}", find(&freqs, "GGTA".to_strbuf()), "GGTA") }
+       6u => { format_strbuf!("{}\t{}", find(&freqs, "GGTATT".to_strbuf()), "GGTATT") }
+      12u => { format_strbuf!("{}\t{}", find(&freqs, "GGTATTTTAATT".to_strbuf()), "GGTATTTTAATT") }
+      18u => { format_strbuf!("{}\t{}", find(&freqs, "GGTATTTTAATTTATAGT".to_strbuf()),
                        "GGTATTTTAATTTATAGT") }
-        _ => { "".to_owned() }
+        _ => { "".to_strbuf() }
    };
 
     to_parent.send(buffer);
@@ -155,7 +155,7 @@ fn main() {
 
     // initialize each sequence sorter
     let sizes = vec!(1u,2,3,4,6,12,18);
-    let mut streams = Vec::from_fn(sizes.len(), |_| Some(channel::<~str>()));
+    let mut streams = Vec::from_fn(sizes.len(), |_| Some(channel::<StrBuf>()));
     let mut from_child = Vec::new();
     let to_child  = sizes.iter().zip(streams.mut_iter()).map(|(sz, stream_ref)| {
         let sz = *sz;
diff --git a/src/test/bench/shootout-meteor.rs b/src/test/bench/shootout-meteor.rs
index 45f8b1b9a83..dd795b7faea 100644
--- a/src/test/bench/shootout-meteor.rs
+++ b/src/test/bench/shootout-meteor.rs
@@ -184,7 +184,7 @@ fn get_id(m: u64) -> u8 {
     fail!("{:016x} does not have a valid identifier", m);
 }
 
-// Converts a list of mask to a ~str.
+// Converts a list of mask to a StrBuf.
 fn to_vec(raw_sol: &List<u64>) -> Vec<u8> {
     let mut sol = Vec::from_elem(50, '.' as u8);
     for &m in raw_sol.iter() {
@@ -198,7 +198,7 @@ fn to_vec(raw_sol: &List<u64>) -> Vec<u8> {
     sol
 }
 
-// Prints a solution in ~str form.
+// Prints a solution in StrBuf form.
 fn print_sol(sol: &Vec<u8>) {
     for (i, c) in sol.iter().enumerate() {
         if (i) % 5 == 0 { println!(""); }
diff --git a/src/test/bench/shootout-pfib.rs b/src/test/bench/shootout-pfib.rs
index 0819b71853a..a6e579689ed 100644
--- a/src/test/bench/shootout-pfib.rs
+++ b/src/test/bench/shootout-pfib.rs
@@ -52,9 +52,10 @@ struct Config {
     stress: bool
 }
 
-fn parse_opts(argv: Vec<~str> ) -> Config {
+fn parse_opts(argv: Vec<StrBuf> ) -> Config {
     let opts = vec!(getopts::optflag("", "stress", ""));
 
+    let argv = argv.iter().map(|x| x.to_str()).collect::<Vec<_>>();
     let opt_args = argv.slice(1, argv.len());
 
     match getopts::getopts(opt_args, opts.as_slice()) {
@@ -92,11 +93,11 @@ fn stress(num_tasks: int) {
 fn main() {
     let args = os::args();
     let args = if os::getenv("RUST_BENCH").is_some() {
-        vec!("".to_owned(), "20".to_owned())
+        vec!("".to_strbuf(), "20".to_strbuf())
     } else if args.len() <= 1u {
-        vec!("".to_owned(), "8".to_owned())
+        vec!("".to_strbuf(), "8".to_strbuf())
     } else {
-        args.move_iter().collect()
+        args.move_iter().map(|x| x.to_strbuf()).collect()
     };
 
     let opts = parse_opts(args.clone());
diff --git a/src/test/compile-fail/bad-const-type.rs b/src/test/compile-fail/bad-const-type.rs
index 92643eca3c8..ab5735150fd 100644
--- a/src/test/compile-fail/bad-const-type.rs
+++ b/src/test/compile-fail/bad-const-type.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// error-pattern:expected `~str` but found `int`
+// error-pattern:expected `std::strbuf::StrBuf` but found `int`
 
-static i: ~str = 10i;
-fn main() { println!("{:?}", i); }
+static i: StrBuf = 10i;
+fn main() { println!("{}", i); }
diff --git a/src/test/compile-fail/bad-expr-path.rs b/src/test/compile-fail/bad-expr-path.rs
index 6e73427f80f..0fadbbe785d 100644
--- a/src/test/compile-fail/bad-expr-path.rs
+++ b/src/test/compile-fail/bad-expr-path.rs
@@ -12,4 +12,4 @@
 
 mod m1 {}
 
-fn main(args: Vec<~str>) { log(debug, m1::a); }
+fn main(args: Vec<StrBuf>) { log(debug, m1::a); }
diff --git a/src/test/compile-fail/bad-expr-path2.rs b/src/test/compile-fail/bad-expr-path2.rs
index d2b3a578686..84bdf40dbab 100644
--- a/src/test/compile-fail/bad-expr-path2.rs
+++ b/src/test/compile-fail/bad-expr-path2.rs
@@ -14,6 +14,6 @@ mod m1 {
     pub mod a {}
 }
 
-fn main(args: Vec<~str>) {
+fn main(args: Vec<StrBuf>) {
     log(debug, m1::a);
 }
diff --git a/src/test/compile-fail/binop-bitxor-str.rs b/src/test/compile-fail/binop-bitxor-str.rs
index d97628bad7a..c0da78737ca 100644
--- a/src/test/compile-fail/binop-bitxor-str.rs
+++ b/src/test/compile-fail/binop-bitxor-str.rs
@@ -8,6 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// error-pattern:`^` cannot be applied to type `~str`
+// error-pattern:`^` cannot be applied to type `std::strbuf::StrBuf`
 
-fn main() { let x = "a".to_owned() ^ "b".to_owned(); }
+fn main() { let x = "a".to_strbuf() ^ "b".to_strbuf(); }
diff --git a/src/test/compile-fail/borrowck-move-error-with-note.rs b/src/test/compile-fail/borrowck-move-error-with-note.rs
index 72101d86960..de77bb8144d 100644
--- a/src/test/compile-fail/borrowck-move-error-with-note.rs
+++ b/src/test/compile-fail/borrowck-move-error-with-note.rs
@@ -26,15 +26,15 @@ fn blah() {
 }
 
 struct S {
-    f: ~str,
-    g: ~str
+    f: StrBuf,
+    g: StrBuf
 }
 impl Drop for S {
     fn drop(&mut self) { println!("{}", self.f); }
 }
 
 fn move_in_match() {
-    match S {f: "foo".to_owned(), g: "bar".to_owned()} {
+    match S {f: "foo".to_strbuf(), g: "bar".to_strbuf()} {
         S {         //~ ERROR cannot move out of type `S`, which defines the `Drop` trait
             f: _s,  //~ NOTE attempting to move value to here
             g: _t   //~ NOTE and here
diff --git a/src/test/compile-fail/borrowck-move-in-irrefut-pat.rs b/src/test/compile-fail/borrowck-move-in-irrefut-pat.rs
index 2be5d570135..c65f2523f9b 100644
--- a/src/test/compile-fail/borrowck-move-in-irrefut-pat.rs
+++ b/src/test/compile-fail/borrowck-move-in-irrefut-pat.rs
@@ -8,9 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn with(f: |&~str|) {}
+fn with(f: |&StrBuf|) {}
 
-fn arg_item(&_x: &~str) {}
+fn arg_item(&_x: &StrBuf) {}
     //~^ ERROR cannot move out of dereference of `&`-pointer
 
 fn arg_closure() {
diff --git a/src/test/compile-fail/borrowck-move-out-of-struct-with-dtor.rs b/src/test/compile-fail/borrowck-move-out-of-struct-with-dtor.rs
index e40fc4e4b23..1de48b61920 100644
--- a/src/test/compile-fail/borrowck-move-out-of-struct-with-dtor.rs
+++ b/src/test/compile-fail/borrowck-move-out-of-struct-with-dtor.rs
@@ -8,20 +8,20 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-struct S {f:~str}
+struct S {f:StrBuf}
 impl Drop for S {
     fn drop(&mut self) { println!("{}", self.f); }
 }
 
 fn move_in_match() {
-    match S {f:"foo".to_owned()} {
+    match S {f:"foo".to_strbuf()} {
         S {f:_s} => {}
         //~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
     }
 }
 
 fn move_in_let() {
-    let S {f:_s} = S {f:"foo".to_owned()};
+    let S {f:_s} = S {f:"foo".to_strbuf()};
     //~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
 }
 
diff --git a/src/test/compile-fail/borrowck-move-out-of-tuple-struct-with-dtor.rs b/src/test/compile-fail/borrowck-move-out-of-tuple-struct-with-dtor.rs
index 9701283469b..0b7939f1898 100644
--- a/src/test/compile-fail/borrowck-move-out-of-tuple-struct-with-dtor.rs
+++ b/src/test/compile-fail/borrowck-move-out-of-tuple-struct-with-dtor.rs
@@ -8,20 +8,20 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-struct S(~str);
+struct S(StrBuf);
 impl Drop for S {
     fn drop(&mut self) { }
 }
 
 fn move_in_match() {
-    match S("foo".to_owned()) {
+    match S("foo".to_strbuf()) {
         S(_s) => {}
         //~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
     }
 }
 
 fn move_in_let() {
-    let S(_s) = S("foo".to_owned());
+    let S(_s) = S("foo".to_strbuf());
     //~^ ERROR cannot move out of type `S`, which defines the `Drop` trait
 }
 
diff --git a/src/test/compile-fail/borrowck-move-out-of-vec-tail.rs b/src/test/compile-fail/borrowck-move-out-of-vec-tail.rs
index 317c30c6e19..a30d8d44ca0 100644
--- a/src/test/compile-fail/borrowck-move-out-of-vec-tail.rs
+++ b/src/test/compile-fail/borrowck-move-out-of-vec-tail.rs
@@ -12,14 +12,14 @@
 
 #[deriving(Clone)]
 struct Foo {
-    string: ~str
+    string: StrBuf
 }
 
 pub fn main() {
     let x = vec!(
-        Foo { string: "foo".to_owned() },
-        Foo { string: "bar".to_owned() },
-        Foo { string: "baz".to_owned() }
+        Foo { string: "foo".to_strbuf() },
+        Foo { string: "bar".to_strbuf() },
+        Foo { string: "baz".to_strbuf() }
     );
     let x: &[Foo] = x.as_slice();
     match x {
diff --git a/src/test/compile-fail/break-outside-loop.rs b/src/test/compile-fail/break-outside-loop.rs
index 210e3d3af80..5a5b63ba846 100644
--- a/src/test/compile-fail/break-outside-loop.rs
+++ b/src/test/compile-fail/break-outside-loop.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 struct Foo {
-    t: ~str
+    t: StrBuf
 }
 
 fn cond() -> bool { true }
diff --git a/src/test/compile-fail/by-move-pattern-binding.rs b/src/test/compile-fail/by-move-pattern-binding.rs
index 986db86a6c1..12d9e1610a5 100644
--- a/src/test/compile-fail/by-move-pattern-binding.rs
+++ b/src/test/compile-fail/by-move-pattern-binding.rs
@@ -10,17 +10,17 @@
 
 enum E {
     Foo,
-    Bar(~str)
+    Bar(StrBuf)
 }
 
 struct S {
     x: E
 }
 
-fn f(x: ~str) {}
+fn f(x: StrBuf) {}
 
 fn main() {
-    let s = S { x: Bar("hello".to_owned()) };
+    let s = S { x: Bar("hello".to_strbuf()) };
     match &s.x {
         &Foo => {}
         &Bar(identifier) => f(identifier.clone())  //~ ERROR cannot move
diff --git a/src/test/compile-fail/check-static-values-constraints.rs b/src/test/compile-fail/check-static-values-constraints.rs
index 6c1e759cc2f..06317f06f26 100644
--- a/src/test/compile-fail/check-static-values-constraints.rs
+++ b/src/test/compile-fail/check-static-values-constraints.rs
@@ -27,7 +27,7 @@ enum SafeEnum {
     Variant1,
     Variant2(int),
     Variant3(WithDtor),
-    Variant4(~str)
+    Variant4(StrBuf)
 }
 
 // These should be ok
@@ -106,8 +106,11 @@ static mut STATIC12: UnsafeStruct = UnsafeStruct;
 static mut STATIC13: SafeStruct = SafeStruct{field1: Variant1, field2: Variant3(WithDtor)};
 //~^ ERROR mutable static items are not allowed to have destructors
 
-static mut STATIC14: SafeStruct = SafeStruct{field1: Variant1, field2: Variant4("str".to_owned())};
+static mut STATIC14: SafeStruct = SafeStruct {
 //~^ ERROR mutable static items are not allowed to have destructors
+    field1: Variant1,
+    field2: Variant4("str".to_strbuf())
+};
 
 static STATIC15: &'static [Box<MyOwned>] = &'static [box MyOwned, box MyOwned];
 //~^ ERROR static items are not allowed to have owned pointers
diff --git a/src/test/compile-fail/circular_modules_main.rs b/src/test/compile-fail/circular_modules_main.rs
index a1739849807..bc9f3247db7 100644
--- a/src/test/compile-fail/circular_modules_main.rs
+++ b/src/test/compile-fail/circular_modules_main.rs
@@ -11,7 +11,7 @@
 
 mod circular_modules_hello; //~ERROR: circular modules
 
-pub fn hi_str() -> ~str {
+pub fn hi_str() -> StrBuf {
   "Hi!".to_owned()
 }
 
diff --git a/src/test/compile-fail/class-cast-to-trait.rs b/src/test/compile-fail/class-cast-to-trait.rs
index c4344db027b..b28d9dabbb9 100644
--- a/src/test/compile-fail/class-cast-to-trait.rs
+++ b/src/test/compile-fail/class-cast-to-trait.rs
@@ -17,7 +17,7 @@ struct cat {
   meows : uint,
 
   how_hungry : int,
-  name : ~str,
+  name : StrBuf,
 }
 
 impl cat {
@@ -49,7 +49,7 @@ impl cat {
     }
 }
 
-fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
+fn cat(in_x : uint, in_y : int, in_name: StrBuf) -> cat {
     cat {
         meows: in_x,
         how_hungry: in_y,
@@ -58,6 +58,6 @@ fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
 }
 
 fn main() {
-  let nyan: Box<noisy> = box cat(0, 2, "nyan".to_owned()) as Box<noisy>;
+  let nyan: Box<noisy> = box cat(0, 2, "nyan".to_strbuf()) as Box<noisy>;
   nyan.eat(); //~ ERROR does not implement any method in scope named `eat`
 }
diff --git a/src/test/compile-fail/disallowed-deconstructing-destructing-struct-let.rs b/src/test/compile-fail/disallowed-deconstructing-destructing-struct-let.rs
index 40bb63907c9..acf825f8913 100644
--- a/src/test/compile-fail/disallowed-deconstructing-destructing-struct-let.rs
+++ b/src/test/compile-fail/disallowed-deconstructing-destructing-struct-let.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 struct X {
-    x: ~str,
+    x: StrBuf,
 }
 
 impl Drop for X {
@@ -18,13 +18,13 @@ impl Drop for X {
     }
 }
 
-fn unwrap(x: X) -> ~str {
+fn unwrap(x: X) -> StrBuf {
     let X { x: y } = x; //~ ERROR cannot move out of type
     y
 }
 
 fn main() {
-    let x = X { x: "hello".to_owned() };
+    let x = X { x: "hello".to_strbuf() };
     let y = unwrap(x);
     println!("contents: {}", y);
 }
diff --git a/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs b/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs
index eec665b62f9..80e624afdb8 100644
--- a/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs
+++ b/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 struct X {
-    x: ~str,
+    x: StrBuf,
 }
 
 impl Drop for X {
@@ -19,7 +19,7 @@ impl Drop for X {
 }
 
 fn main() {
-    let x = X { x: "hello".to_owned() };
+    let x = X { x: "hello".to_strbuf() };
 
     match x {
         X { x: y } => println!("contents: {}", y)
diff --git a/src/test/compile-fail/estr-subtyping.rs b/src/test/compile-fail/estr-subtyping.rs
index db86b5e092c..b2ac0612784 100644
--- a/src/test/compile-fail/estr-subtyping.rs
+++ b/src/test/compile-fail/estr-subtyping.rs
@@ -8,16 +8,16 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn wants_uniq(x: ~str) { }
+fn wants_uniq(x: StrBuf) { }
 fn wants_slice(x: &str) { }
 
-fn has_uniq(x: ~str) {
+fn has_uniq(x: StrBuf) {
    wants_uniq(x);
-   wants_slice(x);
+   wants_slice(x.as_slice());
 }
 
 fn has_slice(x: &str) {
-   wants_uniq(x); //~ ERROR mismatched types: expected `~str` but found `&str` (expected box but f
+   wants_uniq(x); //~ ERROR mismatched types
    wants_slice(x);
 }
 
diff --git a/src/test/compile-fail/generic-type-params-name-repr.rs b/src/test/compile-fail/generic-type-params-name-repr.rs
index e3d624e9452..39b6a276e70 100644
--- a/src/test/compile-fail/generic-type-params-name-repr.rs
+++ b/src/test/compile-fail/generic-type-params-name-repr.rs
@@ -28,10 +28,10 @@ fn main() {
     //~^ ERROR mismatched types: expected `Foo<int>` but found `()`
 
     // Including cases where the default is using previous type params.
-    let _: HashMap<~str, int> = ();
-    //~^ ERROR mismatched types: expected `HashMap<~str,int>` but found `()`
-    let _: HashMap<~str, int, Hash<~str>> = ();
-    //~^ ERROR mismatched types: expected `HashMap<~str,int>` but found `()`
+    let _: HashMap<StrBuf, int> = ();
+    //~^ ERROR mismatched types: expected `HashMap<std::strbuf::StrBuf,int>` but found `()`
+    let _: HashMap<StrBuf, int, Hash<StrBuf>> = ();
+    //~^ ERROR mismatched types: expected `HashMap<std::strbuf::StrBuf,int>` but found `()`
 
     // But not when there's a different type in between.
     let _: Foo<A, int, C> = ();
diff --git a/src/test/compile-fail/import.rs b/src/test/compile-fail/import.rs
index 350b0776904..654443bde24 100644
--- a/src/test/compile-fail/import.rs
+++ b/src/test/compile-fail/import.rs
@@ -16,4 +16,4 @@ use zed::baz;
 mod zed {
     pub fn bar() { println!("bar"); }
 }
-fn main(args: Vec<~str>) { bar(); }
+fn main(args: Vec<StrBuf>) { bar(); }
diff --git a/src/test/compile-fail/import2.rs b/src/test/compile-fail/import2.rs
index 8b282ba8841..11e75780306 100644
--- a/src/test/compile-fail/import2.rs
+++ b/src/test/compile-fail/import2.rs
@@ -16,4 +16,4 @@ mod baz {}
 mod zed {
     pub fn bar() { println!("bar3"); }
 }
-fn main(args: Vec<~str>) { bar(); }
+fn main(args: Vec<StrBuf>) { bar(); }
diff --git a/src/test/compile-fail/integral-indexing.rs b/src/test/compile-fail/integral-indexing.rs
index ee839893e8e..d41573b8557 100644
--- a/src/test/compile-fail/integral-indexing.rs
+++ b/src/test/compile-fail/integral-indexing.rs
@@ -10,17 +10,17 @@
 
 pub fn main() {
     let v: Vec<int> = vec!(0, 1, 2, 3, 4, 5);
-    let s: ~str = "abcdef".to_owned();
+    let s: StrBuf = "abcdef".to_strbuf();
     assert_eq!(v.as_slice()[3u], 3);
     assert_eq!(v.as_slice()[3u8], 3); //~ ERROR: mismatched types
     assert_eq!(v.as_slice()[3i8], 3); //~ ERROR: mismatched types
     assert_eq!(v.as_slice()[3u32], 3); //~ ERROR: mismatched types
     assert_eq!(v.as_slice()[3i32], 3); //~ ERROR: mismatched types
     println!("{}", v.as_slice()[3u8]); //~ ERROR: mismatched types
-    assert_eq!(s[3u], 'd' as u8);
-    assert_eq!(s[3u8], 'd' as u8); //~ ERROR: mismatched types
-    assert_eq!(s[3i8], 'd' as u8); //~ ERROR: mismatched types
-    assert_eq!(s[3u32], 'd' as u8); //~ ERROR: mismatched types
-    assert_eq!(s[3i32], 'd' as u8); //~ ERROR: mismatched types
-    println!("{}", s[3u8]); //~ ERROR: mismatched types
+    assert_eq!(s.as_slice()[3u], 'd' as u8);
+    assert_eq!(s.as_slice()[3u8], 'd' as u8); //~ ERROR: mismatched types
+    assert_eq!(s.as_slice()[3i8], 'd' as u8); //~ ERROR: mismatched types
+    assert_eq!(s.as_slice()[3u32], 'd' as u8); //~ ERROR: mismatched types
+    assert_eq!(s.as_slice()[3i32], 'd' as u8); //~ ERROR: mismatched types
+    println!("{}", s.as_slice()[3u8]); //~ ERROR: mismatched types
 }
diff --git a/src/test/compile-fail/issue-13428.rs b/src/test/compile-fail/issue-13428.rs
index 7e24d909237..ab763a2b583 100644
--- a/src/test/compile-fail/issue-13428.rs
+++ b/src/test/compile-fail/issue-13428.rs
@@ -10,16 +10,16 @@
 
 // Regression test for #13428
 
-fn foo() -> ~str {  //~ ERROR not all control paths return a value
-    format!("Hello {}",
-            "world")
+fn foo() -> StrBuf {  //~ ERROR not all control paths return a value
+    format_strbuf!("Hello {}",
+                   "world")
     // Put the trailing semicolon on its own line to test that the
     // note message gets the offending semicolon exactly
     ;   //~ NOTE consider removing this semicolon
 }
 
-fn bar() -> ~str {  //~ ERROR not all control paths return a value
-    "foobar".to_owned()
+fn bar() -> StrBuf {  //~ ERROR not all control paths return a value
+    "foobar".to_strbuf()
     ;   //~ NOTE consider removing this semicolon
 }
 
diff --git a/src/test/compile-fail/issue-2063.rs b/src/test/compile-fail/issue-2063.rs
index 4a6219aafd0..fcbe8f7b563 100644
--- a/src/test/compile-fail/issue-2063.rs
+++ b/src/test/compile-fail/issue-2063.rs
@@ -16,14 +16,14 @@
 struct t(Box<t>); //~ ERROR this type cannot be instantiated
 
 trait to_str_2 {
-    fn my_to_str() -> ~str;
+    fn my_to_str() -> StrBuf;
 }
 
 // I use an impl here because it will cause
 // the compiler to attempt autoderef and then
 // try to resolve the method.
 impl to_str_2 for t {
-    fn my_to_str() -> ~str { "t".to_owned() }
+    fn my_to_str() -> StrBuf { "t".to_strbuf() }
 }
 
 fn new_t(x: t) {
diff --git a/src/test/compile-fail/issue-3099.rs b/src/test/compile-fail/issue-3099.rs
index 85989c4a40a..365ee54645f 100644
--- a/src/test/compile-fail/issue-3099.rs
+++ b/src/test/compile-fail/issue-3099.rs
@@ -8,11 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn a(x: ~str) -> ~str {
+fn a(x: StrBuf) -> StrBuf {
     format!("First function with {}", x)
 }
 
-fn a(x: ~str, y: ~str) -> ~str { //~ ERROR duplicate definition of value `a`
+fn a(x: StrBuf, y: StrBuf) -> StrBuf { //~ ERROR duplicate definition of value `a`
     format!("Second function with {} and {}", x, y)
 }
 
diff --git a/src/test/compile-fail/issue-3601.rs b/src/test/compile-fail/issue-3601.rs
index 6ca4e22576e..15bcc53b8ce 100644
--- a/src/test/compile-fail/issue-3601.rs
+++ b/src/test/compile-fail/issue-3601.rs
@@ -10,7 +10,7 @@
 
 
 struct HTMLImageData {
-    image: Option<~str>
+    image: Option<StrBuf>
 }
 
 struct ElementData {
diff --git a/src/test/compile-fail/issue-3973.rs b/src/test/compile-fail/issue-3973.rs
index c44336aeaf5..fdf9a396963 100644
--- a/src/test/compile-fail/issue-3973.rs
+++ b/src/test/compile-fail/issue-3973.rs
@@ -22,7 +22,7 @@ impl ToStr for Point { //~ ERROR implements a method not defined in the trait
         Point { x: x, y: y }
     }
 
-    fn to_str(&self) -> ~str {
+    fn to_str(&self) -> StrBuf {
         format!("({}, {})", self.x, self.y)
     }
 }
diff --git a/src/test/compile-fail/issue-5543.rs b/src/test/compile-fail/issue-5543.rs
index f143d74d8c2..ebc82ab361d 100644
--- a/src/test/compile-fail/issue-5543.rs
+++ b/src/test/compile-fail/issue-5543.rs
@@ -13,7 +13,7 @@
 use std::io::ReaderUtil;
 use std::io::Reader;
 
-fn bar(r:@ReaderUtil) -> ~str { r.read_line() }
+fn bar(r:@ReaderUtil) -> StrBuf { r.read_line() }
 
 fn main() {
     let r : @Reader = io::stdin();
diff --git a/src/test/compile-fail/issue-6458-4.rs b/src/test/compile-fail/issue-6458-4.rs
index 1d792dba0d8..b12d2be612e 100644
--- a/src/test/compile-fail/issue-6458-4.rs
+++ b/src/test/compile-fail/issue-6458-4.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn foo(b: bool) -> Result<bool,~str> {
+fn foo(b: bool) -> Result<bool,StrBuf> {
     Err("bar".to_owned());
     //~^ ERROR: cannot determine a type for this expression: unconstrained type
 }
diff --git a/src/test/compile-fail/issue-7573.rs b/src/test/compile-fail/issue-7573.rs
index e39b2d9309b..d79bc942118 100644
--- a/src/test/compile-fail/issue-7573.rs
+++ b/src/test/compile-fail/issue-7573.rs
@@ -10,15 +10,15 @@
 
 
 pub struct CrateId {
-    local_path: ~str,
-    junk: ~str
+    local_path: StrBuf,
+    junk: StrBuf
 }
 
 impl CrateId {
     fn new(s: &str) -> CrateId {
         CrateId {
-            local_path: s.to_owned(),
-            junk: "wutevs".to_owned()
+            local_path: s.to_strbuf(),
+            junk: "wutevs".to_strbuf()
         }
     }
 }
diff --git a/src/test/compile-fail/issue-7575.rs b/src/test/compile-fail/issue-7575.rs
index 5b03e6fc226..f23e398596f 100644
--- a/src/test/compile-fail/issue-7575.rs
+++ b/src/test/compile-fail/issue-7575.rs
@@ -51,7 +51,7 @@ trait ManyImplTrait {
     }
 }
 
-impl ManyImplTrait for ~str {
+impl ManyImplTrait for StrBuf {
     fn is_str() -> bool {
         true
     }
diff --git a/src/test/compile-fail/kindck-copy.rs b/src/test/compile-fail/kindck-copy.rs
index 694b0f1dbe2..c5c14005c70 100644
--- a/src/test/compile-fail/kindck-copy.rs
+++ b/src/test/compile-fail/kindck-copy.rs
@@ -39,7 +39,7 @@ fn test<'a,T,U:Copy>(_: &'a int) {
 
     // ~ pointers are not ok
     assert_copy::<Box<int>>();   //~ ERROR does not fulfill
-    assert_copy::<~str>();   //~ ERROR does not fulfill
+    assert_copy::<StrBuf>();   //~ ERROR does not fulfill
     assert_copy::<Vec<int> >(); //~ ERROR does not fulfill
     assert_copy::<Box<&'a mut int>>(); //~ ERROR does not fulfill
 
diff --git a/src/test/compile-fail/kindck-send.rs b/src/test/compile-fail/kindck-send.rs
index 518e97515e7..c2c35e05ede 100644
--- a/src/test/compile-fail/kindck-send.rs
+++ b/src/test/compile-fail/kindck-send.rs
@@ -30,7 +30,7 @@ fn test<'a,T,U:Send>(_: &'a int) {
 
     // boxes are ok
     assert_send::<Box<int>>();
-    assert_send::<~str>();
+    assert_send::<StrBuf>();
     assert_send::<Vec<int> >();
 
     // but not if they own a bad thing
diff --git a/src/test/compile-fail/lint-unused-unsafe.rs b/src/test/compile-fail/lint-unused-unsafe.rs
index ecea33cbe8e..c33719a2fc1 100644
--- a/src/test/compile-fail/lint-unused-unsafe.rs
+++ b/src/test/compile-fail/lint-unused-unsafe.rs
@@ -51,7 +51,7 @@ fn good2() {
        sure that when purity is inherited that the source of the unsafe-ness
        is tracked correctly */
     unsafe {
-        unsafe fn what() -> Vec<~str> { fail!() }
+        unsafe fn what() -> Vec<StrBuf> { fail!() }
 
         callback(|| {
             what();
diff --git a/src/test/compile-fail/lub-if.rs b/src/test/compile-fail/lub-if.rs
index 6b5055cb1a2..fe64551a4b5 100644
--- a/src/test/compile-fail/lub-if.rs
+++ b/src/test/compile-fail/lub-if.rs
@@ -12,36 +12,36 @@
 // of the various arms, particularly in the case where regions are
 // involved.
 
-pub fn opt_str0<'a>(maybestr: &'a Option<~str>) -> &'a str {
+pub fn opt_str0<'a>(maybestr: &'a Option<StrBuf>) -> &'a str {
     if maybestr.is_none() {
         "(none)"
     } else {
-        let s: &'a str = *maybestr.get_ref();
+        let s: &'a str = maybestr.get_ref().as_slice();
         s
     }
 }
 
-pub fn opt_str1<'a>(maybestr: &'a Option<~str>) -> &'a str {
+pub fn opt_str1<'a>(maybestr: &'a Option<StrBuf>) -> &'a str {
     if maybestr.is_some() {
-        let s: &'a str = *maybestr.get_ref();
+        let s: &'a str = maybestr.get_ref().as_slice();
         s
     } else {
         "(none)"
     }
 }
 
-pub fn opt_str2<'a>(maybestr: &'a Option<~str>) -> &'static str {
+pub fn opt_str2<'a>(maybestr: &'a Option<StrBuf>) -> &'static str {
     if maybestr.is_none() { //~ ERROR mismatched types
         "(none)"
     } else {
-        let s: &'a str = *maybestr.get_ref();
+        let s: &'a str = maybestr.get_ref().as_slice();
         s
     }
 }
 
-pub fn opt_str3<'a>(maybestr: &'a Option<~str>) -> &'static str {
+pub fn opt_str3<'a>(maybestr: &'a Option<StrBuf>) -> &'static str {
     if maybestr.is_some() {  //~ ERROR mismatched types
-        let s: &'a str = *maybestr.get_ref();
+        let s: &'a str = maybestr.get_ref().as_slice();
         s
     } else {
         "(none)"
diff --git a/src/test/compile-fail/lub-match.rs b/src/test/compile-fail/lub-match.rs
index 37b9cc55dc8..932107b7878 100644
--- a/src/test/compile-fail/lub-match.rs
+++ b/src/test/compile-fail/lub-match.rs
@@ -12,40 +12,40 @@
 // of the various arms, particularly in the case where regions are
 // involved.
 
-pub fn opt_str0<'a>(maybestr: &'a Option<~str>) -> &'a str {
+pub fn opt_str0<'a>(maybestr: &'a Option<StrBuf>) -> &'a str {
     match *maybestr {
         Some(ref s) => {
-            let s: &'a str = *s;
+            let s: &'a str = s.as_slice();
             s
         }
         None => "(none)",
     }
 }
 
-pub fn opt_str1<'a>(maybestr: &'a Option<~str>) -> &'a str {
+pub fn opt_str1<'a>(maybestr: &'a Option<StrBuf>) -> &'a str {
     match *maybestr {
         None => "(none)",
         Some(ref s) => {
-            let s: &'a str = *s;
+            let s: &'a str = s.as_slice();
             s
         }
     }
 }
 
-pub fn opt_str2<'a>(maybestr: &'a Option<~str>) -> &'static str {
+pub fn opt_str2<'a>(maybestr: &'a Option<StrBuf>) -> &'static str {
     match *maybestr { //~ ERROR mismatched types
         None => "(none)",
         Some(ref s) => {
-            let s: &'a str = *s;
+            let s: &'a str = s.as_slice();
             s
         }
     }
 }
 
-pub fn opt_str3<'a>(maybestr: &'a Option<~str>) -> &'static str {
+pub fn opt_str3<'a>(maybestr: &'a Option<StrBuf>) -> &'static str {
     match *maybestr { //~ ERROR mismatched types
         Some(ref s) => {
-            let s: &'a str = *s;
+            let s: &'a str = s.as_slice();
             s
         }
         None => "(none)",
diff --git a/src/test/compile-fail/map-types.rs b/src/test/compile-fail/map-types.rs
index b59011b5880..aa8cb84481f 100644
--- a/src/test/compile-fail/map-types.rs
+++ b/src/test/compile-fail/map-types.rs
@@ -15,9 +15,9 @@ use collections::HashMap;
 // Test that trait types printed in error msgs include the type arguments.
 
 fn main() {
-    let x: Box<HashMap<~str, ~str>> = box HashMap::new();
-    let x: Box<Map<~str, ~str>> = x;
-    let y: Box<Map<uint, ~str>> = box x;
-    //~^ ERROR failed to find an implementation of trait core::container::Map<uint,~str>
-    //         for ~core::container::Map<~str,~str>:Send
+    let x: Box<HashMap<int, int>> = box HashMap::new();
+    let x: Box<Map<int, int>> = x;
+    let y: Box<Map<uint, int>> = box x;
+    //~^ ERROR failed to find an implementation of trait core::container::Map<uint,int>
+    //         for ~core::container::Map<int,int>:Send
 }
diff --git a/src/test/compile-fail/match-vec-mismatch.rs b/src/test/compile-fail/match-vec-mismatch.rs
index 17c93f596e9..56d3d76bf7c 100644
--- a/src/test/compile-fail/match-vec-mismatch.rs
+++ b/src/test/compile-fail/match-vec-mismatch.rs
@@ -9,8 +9,8 @@
 // except according to those terms.
 
 fn main() {
-    match "foo".to_owned() {
-        ['f', 'o', ..] => { } //~ ERROR mismatched types: expected `~str` but found a vector pattern
+    match "foo".to_strbuf() {
+        ['f', 'o', ..] => {} //~ ERROR mismatched types
         _ => { }
     }
 }
diff --git a/src/test/compile-fail/match-vec-unreachable.rs b/src/test/compile-fail/match-vec-unreachable.rs
index 2e3b5e399f1..128c25889d8 100644
--- a/src/test/compile-fail/match-vec-unreachable.rs
+++ b/src/test/compile-fail/match-vec-unreachable.rs
@@ -18,8 +18,10 @@ fn main() {
         _ => ()
     }
 
-    let x: Vec<~str> = vec!("foo".to_owned(), "bar".to_owned(), "baz".to_owned());
-    let x: &[~str] = x.as_slice();
+    let x: Vec<StrBuf> = vec!["foo".to_strbuf(),
+                              "bar".to_strbuf(),
+                              "baz".to_strbuf()];
+    let x: &[StrBuf] = x.as_slice();
     match x {
         [a, _, _, ..] => { println!("{}", a); }
         [_, _, _, _, _] => { } //~ ERROR unreachable pattern
diff --git a/src/test/compile-fail/minus-string.rs b/src/test/compile-fail/minus-string.rs
index 636debc77e0..b194b2d8331 100644
--- a/src/test/compile-fail/minus-string.rs
+++ b/src/test/compile-fail/minus-string.rs
@@ -8,6 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// error-pattern:cannot apply unary operator `-` to type `~str`
+// error-pattern:cannot apply unary operator `-` to type `std::strbuf::StrBuf`
 
-fn main() { -"foo".to_owned(); }
+fn main() { -"foo".to_strbuf(); }
diff --git a/src/test/compile-fail/moves-based-on-type-access-to-field.rs b/src/test/compile-fail/moves-based-on-type-access-to-field.rs
index dc2cd22e632..fcad6469bcc 100644
--- a/src/test/compile-fail/moves-based-on-type-access-to-field.rs
+++ b/src/test/compile-fail/moves-based-on-type-access-to-field.rs
@@ -11,18 +11,18 @@
 // Tests that if you move from `x.f` or `x[0]`, `x` is inaccessible.
 // Also tests that we give a more specific error message.
 
-struct Foo { f: ~str, y: int }
-fn consume(_s: ~str) {}
+struct Foo { f: StrBuf, y: int }
+fn consume(_s: StrBuf) {}
 fn touch<A>(_a: &A) {}
 
 fn f10() {
-    let x = Foo { f: "hi".to_owned(), y: 3 };
+    let x = Foo { f: "hi".to_strbuf(), y: 3 };
     consume(x.f);
     touch(&x.y); //~ ERROR use of partially moved value: `x`
 }
 
 fn f20() {
-    let x = vec!("hi".to_owned());
+    let x = vec!("hi".to_strbuf());
     consume(x.move_iter().next().unwrap());
     touch(x.get(0)); //~ ERROR use of moved value: `x`
 }
diff --git a/src/test/compile-fail/moves-based-on-type-exprs.rs b/src/test/compile-fail/moves-based-on-type-exprs.rs
index ea96d87855e..29b4dc573e3 100644
--- a/src/test/compile-fail/moves-based-on-type-exprs.rs
+++ b/src/test/compile-fail/moves-based-on-type-exprs.rs
@@ -14,17 +14,17 @@
 #![feature(managed_boxes)]
 
 struct Foo<A> { f: A }
-fn guard(_s: ~str) -> bool {fail!()}
+fn guard(_s: StrBuf) -> bool {fail!()}
 fn touch<A>(_a: &A) {}
 
 fn f10() {
-    let x = "hi".to_owned();
+    let x = "hi".to_strbuf();
     let _y = Foo { f:x };
     touch(&x); //~ ERROR use of moved value: `x`
 }
 
 fn f20() {
-    let x = "hi".to_owned();
+    let x = "hi".to_strbuf();
     let _y = (x, 3);
     touch(&x); //~ ERROR use of moved value: `x`
 }
@@ -36,8 +36,8 @@ fn f21() {
 }
 
 fn f30(cond: bool) {
-    let x = "hi".to_owned();
-    let y = "ho".to_owned();
+    let x = "hi".to_strbuf();
+    let y = "ho".to_strbuf();
     let _y = if cond {
         x
     } else {
@@ -48,8 +48,8 @@ fn f30(cond: bool) {
 }
 
 fn f40(cond: bool) {
-    let x = "hi".to_owned();
-    let y = "ho".to_owned();
+    let x = "hi".to_strbuf();
+    let y = "ho".to_strbuf();
     let _y = match cond {
         true => x,
         false => y
@@ -59,8 +59,8 @@ fn f40(cond: bool) {
 }
 
 fn f50(cond: bool) {
-    let x = "hi".to_owned();
-    let y = "ho".to_owned();
+    let x = "hi".to_strbuf();
+    let y = "ho".to_strbuf();
     let _y = match cond {
         _ if guard(x) => 10,
         true => 10,
@@ -71,31 +71,31 @@ fn f50(cond: bool) {
 }
 
 fn f70() {
-    let x = "hi".to_owned();
+    let x = "hi".to_strbuf();
     let _y = [x];
     touch(&x); //~ ERROR use of moved value: `x`
 }
 
 fn f80() {
-    let x = "hi".to_owned();
+    let x = "hi".to_strbuf();
     let _y = vec!(x);
     touch(&x); //~ ERROR use of moved value: `x`
 }
 
 fn f100() {
-    let x = vec!("hi".to_owned());
+    let x = vec!("hi".to_strbuf());
     let _y = x.move_iter().next().unwrap();
     touch(&x); //~ ERROR use of moved value: `x`
 }
 
 fn f110() {
-    let x = vec!("hi".to_owned());
+    let x = vec!("hi".to_strbuf());
     let _y = [x.move_iter().next().unwrap(), ..1];
     touch(&x); //~ ERROR use of moved value: `x`
 }
 
 fn f120() {
-    let mut x = vec!("hi".to_owned(), "ho".to_owned());
+    let mut x = vec!("hi".to_strbuf(), "ho".to_strbuf());
     x.as_mut_slice().swap(0, 1);
     touch(x.get(0));
     touch(x.get(1));
diff --git a/src/test/compile-fail/moves-based-on-type-match-bindings.rs b/src/test/compile-fail/moves-based-on-type-match-bindings.rs
index 59918b51e4c..83b7658a473 100644
--- a/src/test/compile-fail/moves-based-on-type-match-bindings.rs
+++ b/src/test/compile-fail/moves-based-on-type-match-bindings.rs
@@ -13,7 +13,7 @@
 // terms of the binding, not the discriminant.
 
 struct Foo<A> { f: A }
-fn guard(_s: ~str) -> bool {fail!()}
+fn guard(_s: StrBuf) -> bool {fail!()}
 fn touch<A>(_a: &A) {}
 
 fn f10() {
diff --git a/src/test/compile-fail/multitrait.rs b/src/test/compile-fail/multitrait.rs
index a57e7ebe6a0..a0c007a2627 100644
--- a/src/test/compile-fail/multitrait.rs
+++ b/src/test/compile-fail/multitrait.rs
@@ -14,5 +14,5 @@ struct S {
 
 impl Cmp, ToStr for S { //~ ERROR: expected `{` but found `,`
   fn eq(&&other: S) { false }
-  fn to_str(&self) -> ~str { "hi".to_owned() }
+  fn to_str(&self) -> StrBuf { "hi".to_owned() }
 }
diff --git a/src/test/compile-fail/unsendable-class.rs b/src/test/compile-fail/unsendable-class.rs
index a30337aba68..a0e3a15dfa5 100644
--- a/src/test/compile-fail/unsendable-class.rs
+++ b/src/test/compile-fail/unsendable-class.rs
@@ -15,10 +15,10 @@
 
 struct foo {
   i: int,
-  j: @~str,
+  j: @StrBuf,
 }
 
-fn foo(i:int, j: @~str) -> foo {
+fn foo(i:int, j: @StrBuf) -> foo {
     foo {
         i: i,
         j: j
@@ -26,7 +26,7 @@ fn foo(i:int, j: @~str) -> foo {
 }
 
 fn main() {
-  let cat = "kitty".to_owned();
+  let cat = "kitty".to_strbuf();
   let (tx, _) = channel(); //~ ERROR does not fulfill `Send`
   tx.send(foo(42, @(cat))); //~ ERROR does not fulfill `Send`
 }
diff --git a/src/test/debuginfo/issue11600.rs b/src/test/debuginfo/issue11600.rs
index 426a40bf8bd..915ccab7700 100644
--- a/src/test/debuginfo/issue11600.rs
+++ b/src/test/debuginfo/issue11600.rs
@@ -13,7 +13,7 @@
 // ignore-test
 
 fn main() {
-    let args : ~[~str] = ::std::os::args();
+    let args : ~[StrBuf] = ::std::os::args();
     ::std::io::println(args[0]);
 }
 
@@ -25,6 +25,6 @@ fn main() {
 // compile-flags:-g
 // gdb-command:list
 // gdb-check:1[...]fn main() {
-// gdb-check:2[...]let args : ~[~str] = ::std::os::args();
+// gdb-check:2[...]let args : ~[StrBuf] = ::std::os::args();
 // gdb-check:3[...]::std::io::println(args[0]);
 // gdb-check:4[...]}
diff --git a/src/test/pretty/closure-reform-pretty.rs b/src/test/pretty/closure-reform-pretty.rs
index a9d0d1f67d5..d18627c1ba1 100644
--- a/src/test/pretty/closure-reform-pretty.rs
+++ b/src/test/pretty/closure-reform-pretty.rs
@@ -13,7 +13,7 @@
 
 // pp-exact
 
-fn call_it(f: proc(~str) -> ~str) { }
+fn call_it(f: proc(StrBuf) -> StrBuf) { }
 
 fn call_this(f: |&str|: Send) { }
 
diff --git a/src/test/run-fail/binop-fail-2.rs b/src/test/run-fail/binop-fail-2.rs
index 1186c5008f7..680481ad491 100644
--- a/src/test/run-fail/binop-fail-2.rs
+++ b/src/test/run-fail/binop-fail-2.rs
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 // error-pattern:quux
-fn my_err(s: ~str) -> ! { println!("{}", s); fail!("quux"); }
-fn main() { 3u == my_err("bye".to_owned()); }
+fn my_err(s: StrBuf) -> ! { println!("{}", s); fail!("quux"); }
+fn main() { 3u == my_err("bye".to_strbuf()); }
diff --git a/src/test/run-fail/binop-fail.rs b/src/test/run-fail/binop-fail.rs
index 1186c5008f7..680481ad491 100644
--- a/src/test/run-fail/binop-fail.rs
+++ b/src/test/run-fail/binop-fail.rs
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 // error-pattern:quux
-fn my_err(s: ~str) -> ! { println!("{}", s); fail!("quux"); }
-fn main() { 3u == my_err("bye".to_owned()); }
+fn my_err(s: StrBuf) -> ! { println!("{}", s); fail!("quux"); }
+fn main() { 3u == my_err("bye".to_strbuf()); }
diff --git a/src/test/run-fail/fmt-fail.rs b/src/test/run-fail/fmt-fail.rs
index 9c7979efb6c..37955561c08 100644
--- a/src/test/run-fail/fmt-fail.rs
+++ b/src/test/run-fail/fmt-fail.rs
@@ -10,4 +10,7 @@
 
 // error-pattern:meh
 
-fn main() { let str_var: ~str = "meh".to_owned(); fail!("{}", str_var); }
+fn main() {
+    let str_var: StrBuf = "meh".to_strbuf();
+    fail!("{}", str_var);
+}
diff --git a/src/test/run-fail/if-cond-bot.rs b/src/test/run-fail/if-cond-bot.rs
index f300a1fa715..ef8a38df178 100644
--- a/src/test/run-fail/if-cond-bot.rs
+++ b/src/test/run-fail/if-cond-bot.rs
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 // error-pattern:quux
-fn my_err(s: ~str) -> ! { println!("{}", s); fail!("quux"); }
-fn main() { if my_err("bye".to_owned()) { } }
+fn my_err(s: StrBuf) -> ! { println!("{}", s); fail!("quux"); }
+fn main() { if my_err("bye".to_strbuf()) { } }
diff --git a/src/test/run-fail/match-bot-fail.rs b/src/test/run-fail/match-bot-fail.rs
index 9728c84b900..d75466a1738 100644
--- a/src/test/run-fail/match-bot-fail.rs
+++ b/src/test/run-fail/match-bot-fail.rs
@@ -13,7 +13,7 @@
 #![allow(unreachable_code)]
 #![allow(unused_variable)]
 
-fn foo(s: ~str) { }
+fn foo(s: StrBuf) { }
 
 fn main() {
     let i =
diff --git a/src/test/run-fail/result-get-fail.rs b/src/test/run-fail/result-get-fail.rs
index 0a3746e4465..613957980de 100644
--- a/src/test/run-fail/result-get-fail.rs
+++ b/src/test/run-fail/result-get-fail.rs
@@ -13,5 +13,5 @@
 use std::result;
 
 fn main() {
-    println!("{:?}", result::Err::<int,~str>("kitty".to_owned()).unwrap());
+    println!("{:?}", result::Err::<int,StrBuf>("kitty".to_strbuf()).unwrap());
 }
diff --git a/src/test/run-fail/rhs-type.rs b/src/test/run-fail/rhs-type.rs
index 584be2d89b7..d224393b2ea 100644
--- a/src/test/run-fail/rhs-type.rs
+++ b/src/test/run-fail/rhs-type.rs
@@ -15,7 +15,7 @@
 #![allow(unreachable_code)]
 #![allow(unused_variable)]
 
-struct T { t: ~str }
+struct T { t: StrBuf }
 
 fn main() {
     let pth = fail!("bye");
diff --git a/src/test/run-fail/str-overrun.rs b/src/test/run-fail/str-overrun.rs
index 9f7b03ac2ea..879a14896d6 100644
--- a/src/test/run-fail/str-overrun.rs
+++ b/src/test/run-fail/str-overrun.rs
@@ -11,8 +11,8 @@
 
 // error-pattern:index out of bounds: the len is 5 but the index is 5
 fn main() {
-    let s: ~str = "hello".to_owned();
+    let s: StrBuf = "hello".to_strbuf();
 
     // Bounds-check failure.
-    assert_eq!(s[5], 0x0 as u8);
+    assert_eq!(s.as_slice()[5], 0x0 as u8);
 }
diff --git a/src/test/run-fail/unwind-lambda.rs b/src/test/run-fail/unwind-lambda.rs
index ddaddcec390..d3be456f342 100644
--- a/src/test/run-fail/unwind-lambda.rs
+++ b/src/test/run-fail/unwind-lambda.rs
@@ -13,17 +13,17 @@
 // error-pattern:fail
 
 fn main() {
-    let cheese = "roquefort".to_owned();
-    let carrots = @"crunchy".to_owned();
+    let cheese = "roquefort".to_strbuf();
+    let carrots = @"crunchy".to_strbuf();
 
-    let result: |@~str, |~str||: 'static = (|tasties, macerate| {
+    let result: |@StrBuf, |StrBuf||: 'static = (|tasties, macerate| {
         macerate((*tasties).clone());
     });
     result(carrots, |food| {
-        let mush = food + cheese;
+        let mush = format_strbuf!("{}{}", food, cheese);
         let cheese = cheese.clone();
         let f: || = || {
-            let _chew = mush + cheese;
+            let _chew = format_strbuf!("{}{}", mush, cheese);
             fail!("so yummy")
         };
         f();
diff --git a/src/test/run-make/unicode-input/span_length.rs b/src/test/run-make/unicode-input/span_length.rs
index 13f141008b7..d5614975215 100644
--- a/src/test/run-make/unicode-input/span_length.rs
+++ b/src/test/run-make/unicode-input/span_length.rs
@@ -48,7 +48,7 @@ fn main() {
             let _ = write!(&mut File::create(&main_file).unwrap(),
                            r"\#![feature(non_ascii_idents)] fn main() \{ {} \}",
                            // random string of length n
-                           range(0, n).map(|_| random_char()).collect::<~str>());
+                           range(0, n).map(|_| random_char()).collect::<StrBuf>());
         }
 
         // rustc is passed to us with --out-dir and -L etc., so we
diff --git a/src/test/run-pass-fulldeps/qquote.rs b/src/test/run-pass-fulldeps/qquote.rs
index 3b3e4066e0c..4b8aed0a187 100644
--- a/src/test/run-pass-fulldeps/qquote.rs
+++ b/src/test/run-pass-fulldeps/qquote.rs
@@ -75,7 +75,7 @@ fn main() {
 }
 
 fn check_pp<T>(cx: fake_ext_ctxt,
-               expr: T, f: |pprust::ps, T|, expect: ~str) {
+               expr: T, f: |pprust::ps, T|, expect: StrBuf) {
     let s = io::with_str_writer(|wr| {
         let pp = pprust::rust_printer(wr, cx.parse_sess().interner);
         f(pp, expr);
diff --git a/src/test/run-pass/alias-uninit-value.rs b/src/test/run-pass/alias-uninit-value.rs
index ab395466afc..a78622a37a2 100644
--- a/src/test/run-pass/alias-uninit-value.rs
+++ b/src/test/run-pass/alias-uninit-value.rs
@@ -14,10 +14,10 @@
 
 enum sty { ty_nil, }
 
-struct RawT {struct_: sty, cname: Option<~str>, hash: uint}
+struct RawT {struct_: sty, cname: Option<StrBuf>, hash: uint}
 
-fn mk_raw_ty(st: sty, cname: Option<~str>) -> RawT {
+fn mk_raw_ty(st: sty, cname: Option<StrBuf>) -> RawT {
     return RawT {struct_: st, cname: cname, hash: 0u};
 }
 
-pub fn main() { mk_raw_ty(ty_nil, None::<~str>); }
+pub fn main() { mk_raw_ty(ty_nil, None::<StrBuf>); }
diff --git a/src/test/run-pass/autobind.rs b/src/test/run-pass/autobind.rs
index 5dad14c7d99..445abf4ca49 100644
--- a/src/test/run-pass/autobind.rs
+++ b/src/test/run-pass/autobind.rs
@@ -15,6 +15,7 @@ fn g(act: |Vec<int> | -> int) -> int { return act(vec!(1, 2, 3)); }
 
 pub fn main() {
     assert_eq!(g(f), 1);
-    let f1: |Vec<~str> | -> ~str = f;
-    assert_eq!(f1(vec!("x".to_owned(), "y".to_owned(), "z".to_owned())), "x".to_owned());
+    let f1: |Vec<StrBuf>| -> StrBuf = f;
+    assert_eq!(f1(vec!["x".to_strbuf(), "y".to_strbuf(), "z".to_strbuf()]),
+               "x".to_strbuf());
 }
diff --git a/src/test/run-pass/autoref-intermediate-types-issue-3585.rs b/src/test/run-pass/autoref-intermediate-types-issue-3585.rs
index ca11fb355c0..778704a4b96 100644
--- a/src/test/run-pass/autoref-intermediate-types-issue-3585.rs
+++ b/src/test/run-pass/autoref-intermediate-types-issue-3585.rs
@@ -11,22 +11,22 @@
 #![feature(managed_boxes)]
 
 trait Foo {
-    fn foo(&self) -> ~str;
+    fn foo(&self) -> StrBuf;
 }
 
 impl<T:Foo> Foo for @T {
-    fn foo(&self) -> ~str {
-        format!("@{}", (**self).foo())
+    fn foo(&self) -> StrBuf {
+        format_strbuf!("@{}", (**self).foo())
     }
 }
 
 impl Foo for uint {
-    fn foo(&self) -> ~str {
-        format!("{}", *self)
+    fn foo(&self) -> StrBuf {
+        format_strbuf!("{}", *self)
     }
 }
 
 pub fn main() {
     let x = @3u;
-    assert_eq!(x.foo(), "@3".to_owned());
+    assert_eq!(x.foo(), "@3".to_strbuf());
 }
diff --git a/src/test/run-pass/backtrace.rs b/src/test/run-pass/backtrace.rs
index 53fe91cff37..260ce69f821 100644
--- a/src/test/run-pass/backtrace.rs
+++ b/src/test/run-pass/backtrace.rs
@@ -36,14 +36,21 @@ fn double() {
 }
 
 fn runtest(me: &str) {
-    let mut env = os::env().move_iter().collect::<Vec<(~str, ~str)>>();
-    match env.iter().position(|&(ref s, _)| "RUST_BACKTRACE" == *s) {
+    let mut env = os::env().move_iter()
+                           .map(|(ref k, ref v)| {
+                               (k.to_strbuf(), v.to_strbuf())
+                           }).collect::<Vec<(StrBuf,StrBuf)>>();
+    match env.iter()
+             .position(|&(ref s, _)| "RUST_BACKTRACE" == s.as_slice()) {
         Some(i) => { env.remove(i); }
         None => {}
     }
-    env.push(("RUST_BACKTRACE".to_owned(), "1".to_owned()));
+    env.push(("RUST_BACKTRACE".to_strbuf(), "1".to_strbuf()));
 
     // Make sure that the stack trace is printed
+    let env = env.iter()
+                 .map(|&(ref k, ref v)| (k.to_owned(), v.to_owned()))
+                 .collect::<Vec<_>>();
     let mut p = Process::configure(ProcessConfig {
         program: me,
         args: ["fail".to_owned()],
diff --git a/src/test/run-pass/block-explicit-types.rs b/src/test/run-pass/block-explicit-types.rs
index 8df2679aa53..f60510dc802 100644
--- a/src/test/run-pass/block-explicit-types.rs
+++ b/src/test/run-pass/block-explicit-types.rs
@@ -9,6 +9,6 @@
 // except according to those terms.
 
 pub fn main() {
-    fn as_buf<T>(s: ~str, f: |~str| -> T) -> T { f(s) }
-    as_buf("foo".to_owned(), |foo: ~str| -> () println!("{}", foo) );
+    fn as_buf<T>(s: StrBuf, f: |StrBuf| -> T) -> T { f(s) }
+    as_buf("foo".to_strbuf(), |foo: StrBuf| -> () println!("{}", foo) );
 }
diff --git a/src/test/run-pass/borrowed-ptr-pattern-2.rs b/src/test/run-pass/borrowed-ptr-pattern-2.rs
index c961f59f981..c80246d27e6 100644
--- a/src/test/run-pass/borrowed-ptr-pattern-2.rs
+++ b/src/test/run-pass/borrowed-ptr-pattern-2.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn foo(s: &~str) -> bool {
+fn foo(s: &StrBuf) -> bool {
     match s.as_slice() {
         "kitty" => true,
         _ => false
@@ -16,6 +16,6 @@ fn foo(s: &~str) -> bool {
 }
 
 pub fn main() {
-    assert!(foo(&"kitty".to_owned()));
-    assert!(!foo(&"gata".to_owned()));
+    assert!(foo(&"kitty".to_strbuf()));
+    assert!(!foo(&"gata".to_strbuf()));
 }
diff --git a/src/test/run-pass/bug-7183-generics.rs b/src/test/run-pass/bug-7183-generics.rs
index 86fde76fb75..5f536026ea6 100644
--- a/src/test/run-pass/bug-7183-generics.rs
+++ b/src/test/run-pass/bug-7183-generics.rs
@@ -9,35 +9,36 @@
 // except according to those terms.
 
 trait Speak {
-    fn say(&self, s:&str) -> ~str;
-    fn hi(&self) -> ~str { hello(self) }
+    fn say(&self, s:&str) -> StrBuf;
+    fn hi(&self) -> StrBuf { hello(self) }
 }
 
-fn hello<S:Speak>(s:&S) -> ~str{
+fn hello<S:Speak>(s:&S) -> StrBuf{
     s.say("hello")
 }
 
 impl Speak for int {
-    fn say(&self, s:&str) -> ~str {
-        format!("{}: {}", s, *self)
+    fn say(&self, s:&str) -> StrBuf {
+        format_strbuf!("{}: {}", s, *self)
     }
 }
 
 impl<T: Speak> Speak for Option<T> {
-    fn say(&self, s:&str) -> ~str {
+    fn say(&self, s:&str) -> StrBuf {
         match *self {
-            None => format!("{} - none", s),
-            Some(ref x) => { "something!".to_owned() + x.say(s) }
+            None => format_strbuf!("{} - none", s),
+            Some(ref x) => { format_strbuf!("something!{}", x.say(s)) }
         }
     }
 }
 
 
 pub fn main() {
-    assert_eq!(3.hi(), "hello: 3".to_owned());
-    assert_eq!(Some(Some(3)).hi(), "something!something!hello: 3".to_owned());
-    assert_eq!(None::<int>.hi(), "hello - none".to_owned());
+    assert_eq!(3.hi(), "hello: 3".to_strbuf());
+    assert_eq!(Some(Some(3)).hi(),
+               "something!something!hello: 3".to_strbuf());
+    assert_eq!(None::<int>.hi(), "hello - none".to_strbuf());
 
-    assert_eq!(Some(None::<int>).hi(), "something!hello - none".to_owned());
-    assert_eq!(Some(3).hi(), "something!hello: 3".to_owned());
+    assert_eq!(Some(None::<int>).hi(), "something!hello - none".to_strbuf());
+    assert_eq!(Some(3).hi(), "something!hello: 3".to_strbuf());
 }
diff --git a/src/test/run-pass/c-stack-returning-int64.rs b/src/test/run-pass/c-stack-returning-int64.rs
index 0b38c7fa1dd..501d36886a4 100644
--- a/src/test/run-pass/c-stack-returning-int64.rs
+++ b/src/test/run-pass/c-stack-returning-int64.rs
@@ -21,15 +21,16 @@ mod mlibc {
     }
 }
 
-fn atol(s: ~str) -> int {
-    s.with_c_str(|x| unsafe { mlibc::atol(x) as int })
+fn atol(s: StrBuf) -> int {
+    s.as_slice().with_c_str(|x| unsafe { mlibc::atol(x) as int })
 }
 
-fn atoll(s: ~str) -> i64 {
-    s.with_c_str(|x| unsafe { mlibc::atoll(x) as i64 })
+fn atoll(s: StrBuf) -> i64 {
+    s.as_slice().with_c_str(|x| unsafe { mlibc::atoll(x) as i64 })
 }
 
 pub fn main() {
-    assert_eq!(atol("1024".to_owned()) * 10, atol("10240".to_owned()));
-    assert!((atoll("11111111111111111".to_owned()) * 10) == atoll("111111111111111110".to_owned()));
+    assert_eq!(atol("1024".to_strbuf()) * 10, atol("10240".to_strbuf()));
+    assert!((atoll("11111111111111111".to_strbuf()) * 10) ==
+             atoll("111111111111111110".to_strbuf()));
 }
diff --git a/src/test/run-pass/child-outlives-parent.rs b/src/test/run-pass/child-outlives-parent.rs
index d32eb03e101..c85b4b06387 100644
--- a/src/test/run-pass/child-outlives-parent.rs
+++ b/src/test/run-pass/child-outlives-parent.rs
@@ -12,8 +12,8 @@
 
 use std::task;
 
-fn child2(_s: ~str) { }
+fn child2(_s: StrBuf) { }
 
 pub fn main() {
-    let _x = task::spawn(proc() child2("hi".to_owned()));
+    let _x = task::spawn(proc() child2("hi".to_strbuf()));
 }
diff --git a/src/test/run-pass/class-attributes-1.rs b/src/test/run-pass/class-attributes-1.rs
index 75c3f1a06e2..55cf41d73d5 100644
--- a/src/test/run-pass/class-attributes-1.rs
+++ b/src/test/run-pass/class-attributes-1.rs
@@ -11,7 +11,7 @@
 // pp-exact - Make sure we actually print the attributes
 
 struct cat {
-    name: ~str,
+    name: StrBuf,
 }
 
 impl Drop for cat {
@@ -21,6 +21,6 @@ impl Drop for cat {
 
 
 #[cat_maker]
-fn cat(name: ~str) -> cat { cat{name: name,} }
+fn cat(name: StrBuf) -> cat { cat{name: name,} }
 
-pub fn main() { let _kitty = cat("Spotty".to_owned()); }
+pub fn main() { let _kitty = cat("Spotty".to_strbuf()); }
diff --git a/src/test/run-pass/class-attributes-2.rs b/src/test/run-pass/class-attributes-2.rs
index d506fa6eb33..b1ed70278ef 100644
--- a/src/test/run-pass/class-attributes-2.rs
+++ b/src/test/run-pass/class-attributes-2.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 struct cat {
-  name: ~str,
+  name: StrBuf,
 }
 
 impl Drop for cat {
@@ -26,12 +26,12 @@ impl Drop for cat {
 /**
 Maybe it should technically be a kitten_maker.
 */
-fn cat(name: ~str) -> cat {
+fn cat(name: StrBuf) -> cat {
     cat {
         name: name
     }
 }
 
 pub fn main() {
-  let _kitty = cat("Spotty".to_owned());
+  let _kitty = cat("Spotty".to_strbuf());
 }
diff --git a/src/test/run-pass/class-cast-to-trait-cross-crate-2.rs b/src/test/run-pass/class-cast-to-trait-cross-crate-2.rs
index c6c78283e19..df9b30697d9 100644
--- a/src/test/run-pass/class-cast-to-trait-cross-crate-2.rs
+++ b/src/test/run-pass/class-cast-to-trait-cross-crate-2.rs
@@ -14,13 +14,13 @@ extern crate cci_class_cast;
 use std::to_str::ToStr;
 use cci_class_cast::kitty::cat;
 
-fn print_out(thing: Box<ToStr>, expected: ~str) {
+fn print_out(thing: Box<ToStr>, expected: StrBuf) {
   let actual = thing.to_str();
   println!("{}", actual);
-  assert_eq!(actual, expected);
+  assert_eq!(actual.to_strbuf(), expected);
 }
 
 pub fn main() {
-  let nyan: Box<ToStr> = box cat(0u, 2, "nyan".to_owned()) as Box<ToStr>;
-  print_out(nyan, "nyan".to_owned());
+  let nyan: Box<ToStr> = box cat(0u, 2, "nyan".to_strbuf()) as Box<ToStr>;
+  print_out(nyan, "nyan".to_strbuf());
 }
diff --git a/src/test/run-pass/class-cast-to-trait-multiple-types.rs b/src/test/run-pass/class-cast-to-trait-multiple-types.rs
index 701a6d44bf5..486a505350b 100644
--- a/src/test/run-pass/class-cast-to-trait-multiple-types.rs
+++ b/src/test/run-pass/class-cast-to-trait-multiple-types.rs
@@ -53,7 +53,7 @@ struct cat {
   meows: uint,
 
   how_hungry: int,
-  name: ~str,
+  name: StrBuf,
 }
 
 impl noisy for cat {
@@ -79,7 +79,7 @@ impl cat {
     }
 }
 
-fn cat(in_x: uint, in_y: int, in_name: ~str) -> cat {
+fn cat(in_x: uint, in_y: int, in_name: StrBuf) -> cat {
     cat {
         meows: in_x,
         how_hungry: in_y,
@@ -93,7 +93,7 @@ fn annoy_neighbors(critter: &mut noisy) {
 }
 
 pub fn main() {
-  let mut nyan: cat = cat(0u, 2, "nyan".to_owned());
+  let mut nyan: cat = cat(0u, 2, "nyan".to_strbuf());
   let mut whitefang: dog = dog();
   annoy_neighbors(&mut nyan);
   annoy_neighbors(&mut whitefang);
diff --git a/src/test/run-pass/class-cast-to-trait.rs b/src/test/run-pass/class-cast-to-trait.rs
index fb479b5937a..99070b97372 100644
--- a/src/test/run-pass/class-cast-to-trait.rs
+++ b/src/test/run-pass/class-cast-to-trait.rs
@@ -19,7 +19,7 @@ trait noisy {
 struct cat {
   meows: uint,
   how_hungry: int,
-  name: ~str,
+  name: StrBuf,
 }
 
 impl noisy for cat {
@@ -50,7 +50,7 @@ impl cat {
     }
 }
 
-fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
+fn cat(in_x : uint, in_y : int, in_name: StrBuf) -> cat {
     cat {
         meows: in_x,
         how_hungry: in_y,
@@ -60,7 +60,7 @@ fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
 
 
 pub fn main() {
-    let mut nyan = cat(0u, 2, "nyan".to_owned());
+    let mut nyan = cat(0u, 2, "nyan".to_strbuf());
     let mut nyan: &mut noisy = &mut nyan;
     nyan.speak();
 }
diff --git a/src/test/run-pass/class-exports.rs b/src/test/run-pass/class-exports.rs
index 96270577ce2..a7039ca708d 100644
--- a/src/test/run-pass/class-exports.rs
+++ b/src/test/run-pass/class-exports.rs
@@ -17,14 +17,14 @@ use kitty::cat;
 mod kitty {
     pub struct cat {
         meows: uint,
-        name: ~str,
+        name: StrBuf,
     }
 
     impl cat {
-        pub fn get_name(&self) -> ~str { self.name.clone() }
+        pub fn get_name(&self) -> StrBuf { self.name.clone() }
     }
 
-    pub fn cat(in_name: ~str) -> cat {
+    pub fn cat(in_name: StrBuf) -> cat {
         cat {
             name: in_name,
             meows: 0u
@@ -33,5 +33,6 @@ mod kitty {
 }
 
 pub fn main() {
-  assert_eq!(cat("Spreckles".to_owned()).get_name(), "Spreckles".to_owned());
+  assert_eq!(cat("Spreckles".to_strbuf()).get_name(),
+                 "Spreckles".to_strbuf());
 }
diff --git a/src/test/run-pass/class-impl-very-parameterized-trait.rs b/src/test/run-pass/class-impl-very-parameterized-trait.rs
index 360e82cf8fd..f02d41df21e 100644
--- a/src/test/run-pass/class-impl-very-parameterized-trait.rs
+++ b/src/test/run-pass/class-impl-very-parameterized-trait.rs
@@ -114,9 +114,9 @@ impl<T> cat<T> {
 }
 
 pub fn main() {
-    let mut nyan: cat<~str> = cat::new(0, 2, "nyan".to_owned());
+    let mut nyan: cat<StrBuf> = cat::new(0, 2, "nyan".to_strbuf());
     for _ in range(1u, 5) { nyan.speak(); }
-    assert!(*nyan.find(&1).unwrap() == "nyan".to_owned());
+    assert!(*nyan.find(&1).unwrap() == "nyan".to_strbuf());
     assert_eq!(nyan.find(&10), None);
     let mut spotty: cat<cat_type> = cat::new(2, 57, tuxedo);
     for _ in range(0u, 6) { spotty.speak(); }
diff --git a/src/test/run-pass/class-implement-trait-cross-crate.rs b/src/test/run-pass/class-implement-trait-cross-crate.rs
index c068c226f4d..e3a1829597e 100644
--- a/src/test/run-pass/class-implement-trait-cross-crate.rs
+++ b/src/test/run-pass/class-implement-trait-cross-crate.rs
@@ -16,7 +16,7 @@ struct cat {
   meows: uint,
 
   how_hungry : int,
-  name : ~str,
+  name : StrBuf,
 }
 
 impl cat {
@@ -47,7 +47,7 @@ impl cat {
     }
 }
 
-fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
+fn cat(in_x : uint, in_y : int, in_name: StrBuf) -> cat {
     cat {
         meows: in_x,
         how_hungry: in_y,
@@ -57,7 +57,7 @@ fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
 
 
 pub fn main() {
-  let mut nyan = cat(0u, 2, "nyan".to_owned());
+  let mut nyan = cat(0u, 2, "nyan".to_strbuf());
   nyan.eat();
   assert!((!nyan.eat()));
   for _ in range(1u, 10u) { nyan.speak(); };
diff --git a/src/test/run-pass/class-implement-traits.rs b/src/test/run-pass/class-implement-traits.rs
index 3739e350d79..92dc231bf7a 100644
--- a/src/test/run-pass/class-implement-traits.rs
+++ b/src/test/run-pass/class-implement-traits.rs
@@ -18,7 +18,7 @@ struct cat {
     meows : uint,
 
     how_hungry : int,
-    name : ~str,
+    name : StrBuf,
 }
 
 impl cat {
@@ -48,7 +48,7 @@ impl noisy for cat {
     fn speak(&mut self) { self.meow(); }
 }
 
-fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
+fn cat(in_x : uint, in_y : int, in_name: StrBuf) -> cat {
     cat {
         meows: in_x,
         how_hungry: in_y,
@@ -62,7 +62,7 @@ fn make_speak<C:noisy>(mut c: C) {
 }
 
 pub fn main() {
-    let mut nyan = cat(0u, 2, "nyan".to_owned());
+    let mut nyan = cat(0u, 2, "nyan".to_strbuf());
     nyan.eat();
     assert!((!nyan.eat()));
     for _ in range(1u, 10u) {
diff --git a/src/test/run-pass/class-separate-impl.rs b/src/test/run-pass/class-separate-impl.rs
index 417c927701d..874cf1233b8 100644
--- a/src/test/run-pass/class-separate-impl.rs
+++ b/src/test/run-pass/class-separate-impl.rs
@@ -14,7 +14,7 @@ struct cat {
     meows : uint,
 
     how_hungry : int,
-    name : ~str,
+    name : StrBuf,
 }
 
 impl cat {
@@ -43,7 +43,7 @@ impl cat {
     }
 }
 
-fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
+fn cat(in_x : uint, in_y : int, in_name: StrBuf) -> cat {
     cat {
         meows: in_x,
         how_hungry: in_y,
@@ -57,13 +57,13 @@ impl fmt::Show for cat {
     }
 }
 
-fn print_out(thing: Box<ToStr>, expected: ~str) {
+fn print_out(thing: Box<ToStr>, expected: StrBuf) {
   let actual = thing.to_str();
   println!("{}", actual);
-  assert_eq!(actual, expected);
+  assert_eq!(actual.to_strbuf(), expected);
 }
 
 pub fn main() {
-  let nyan: Box<ToStr> = box cat(0u, 2, "nyan".to_owned()) as Box<ToStr>;
-  print_out(nyan, "nyan".to_owned());
+  let nyan: Box<ToStr> = box cat(0u, 2, "nyan".to_strbuf()) as Box<ToStr>;
+  print_out(nyan, "nyan".to_strbuf());
 }
diff --git a/src/test/run-pass/class-str-field.rs b/src/test/run-pass/class-str-field.rs
index c1ecbd9b1d2..438020bab29 100644
--- a/src/test/run-pass/class-str-field.rs
+++ b/src/test/run-pass/class-str-field.rs
@@ -10,16 +10,16 @@
 
 struct cat {
 
-  name : ~str,
+  name : StrBuf,
 
 }
 
-fn cat(in_name: ~str) -> cat {
+fn cat(in_name: StrBuf) -> cat {
     cat {
         name: in_name
     }
 }
 
 pub fn main() {
-  let _nyan = cat("nyan".to_owned());
+  let _nyan = cat("nyan".to_strbuf());
 }
diff --git a/src/test/run-pass/classes-cross-crate.rs b/src/test/run-pass/classes-cross-crate.rs
index d1b47e45ccf..554fb607b15 100644
--- a/src/test/run-pass/classes-cross-crate.rs
+++ b/src/test/run-pass/classes-cross-crate.rs
@@ -13,7 +13,7 @@ extern crate cci_class_4;
 use cci_class_4::kitties::cat;
 
 pub fn main() {
-    let mut nyan = cat(0u, 2, "nyan".to_owned());
+    let mut nyan = cat(0u, 2, "nyan".to_strbuf());
     nyan.eat();
     assert!((!nyan.eat()));
     for _ in range(1u, 10u) { nyan.speak(); };
diff --git a/src/test/run-pass/classes.rs b/src/test/run-pass/classes.rs
index d54a29cde06..33360df56e9 100644
--- a/src/test/run-pass/classes.rs
+++ b/src/test/run-pass/classes.rs
@@ -12,7 +12,7 @@ struct cat {
     meows : uint,
 
     how_hungry : int,
-    name : ~str,
+    name : StrBuf,
 }
 
 impl cat {
@@ -40,7 +40,7 @@ impl cat {
     }
 }
 
-fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
+fn cat(in_x : uint, in_y : int, in_name: StrBuf) -> cat {
     cat {
         meows: in_x,
         how_hungry: in_y,
@@ -49,7 +49,7 @@ fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
 }
 
 pub fn main() {
-  let mut nyan = cat(0u, 2, "nyan".to_owned());
+  let mut nyan = cat(0u, 2, "nyan".to_strbuf());
   nyan.eat();
   assert!((!nyan.eat()));
   for _ in range(1u, 10u) { nyan.speak(); };
diff --git a/src/test/run-pass/closure-reform.rs b/src/test/run-pass/closure-reform.rs
index 202ec7edb19..47ca20b6ee8 100644
--- a/src/test/run-pass/closure-reform.rs
+++ b/src/test/run-pass/closure-reform.rs
@@ -14,8 +14,8 @@
 use std::mem;
 use std::io::stdio::println;
 
-fn call_it(f: proc(~str) -> ~str) {
-    println!("{}", f("Fred".to_owned()))
+fn call_it(f: proc(StrBuf) -> StrBuf) {
+    println!("{}", f("Fred".to_strbuf()))
 }
 
 fn call_a_thunk(f: ||) {
@@ -48,17 +48,17 @@ fn call_bare_again(f: extern "Rust" fn(&str)) {
 pub fn main() {
     // Procs
 
-    let greeting = "Hello ".to_owned();
+    let greeting = "Hello ".to_strbuf();
     call_it(proc(s) {
-        greeting + s
+        format_strbuf!("{}{}", greeting, s)
     });
 
-    let greeting = "Goodbye ".to_owned();
-    call_it(proc(s) greeting + s);
+    let greeting = "Goodbye ".to_strbuf();
+    call_it(proc(s) format_strbuf!("{}{}", greeting, s));
 
-    let greeting = "How's life, ".to_owned();
-    call_it(proc(s: ~str) -> ~str {
-        greeting + s
+    let greeting = "How's life, ".to_strbuf();
+    call_it(proc(s: StrBuf) -> StrBuf {
+        format_strbuf!("{}{}", greeting, s)
     });
 
     // Closures
diff --git a/src/test/run-pass/complex.rs b/src/test/run-pass/complex.rs
index 3ade33b4375..0d06ff9610c 100644
--- a/src/test/run-pass/complex.rs
+++ b/src/test/run-pass/complex.rs
@@ -15,18 +15,18 @@ type t = int;
 
 fn nothing() { }
 
-fn putstr(_s: ~str) { }
+fn putstr(_s: StrBuf) { }
 
 fn putint(_i: int) {
     let mut i: int = 33;
-    while i < 36 { putstr("hi".to_owned()); i = i + 1; }
+    while i < 36 { putstr("hi".to_strbuf()); i = i + 1; }
 }
 
 fn zerg(i: int) -> int { return i; }
 
 fn foo(x: int) -> int {
     let mut y: t = x + 2;
-    putstr("hello".to_owned());
+    putstr("hello".to_strbuf());
     while y < 10 { putint(y); if y * 3 == 4 { y = y + 2; nothing(); } }
     let mut z: t;
     z = 0x55;
diff --git a/src/test/run-pass/conditional-compile.rs b/src/test/run-pass/conditional-compile.rs
index ebb495de88b..19ed116cc5c 100644
--- a/src/test/run-pass/conditional-compile.rs
+++ b/src/test/run-pass/conditional-compile.rs
@@ -108,8 +108,8 @@ mod test_foreign_items {
     pub mod rustrt {
         extern {
             #[cfg(bogus)]
-            pub fn write() -> ~str;
-            pub fn write() -> ~str;
+            pub fn write() -> StrBuf;
+            pub fn write() -> StrBuf;
         }
     }
 }
diff --git a/src/test/run-pass/const-enum-structlike.rs b/src/test/run-pass/const-enum-structlike.rs
index 56cfcfae7a6..712b3344210 100644
--- a/src/test/run-pass/const-enum-structlike.rs
+++ b/src/test/run-pass/const-enum-structlike.rs
@@ -11,7 +11,7 @@
 #![feature(struct_variant)]
 
 enum E {
-    S0 { s: ~str },
+    S0 { s: StrBuf },
     S1 { u: uint }
 }
 
diff --git a/src/test/run-pass/crate-method-reexport-grrrrrrr.rs b/src/test/run-pass/crate-method-reexport-grrrrrrr.rs
index 82b33d02214..56f6871ed54 100644
--- a/src/test/run-pass/crate-method-reexport-grrrrrrr.rs
+++ b/src/test/run-pass/crate-method-reexport-grrrrrrr.rs
@@ -24,5 +24,5 @@ pub fn main() {
     let x = @();
     x.cx();
     let y = ();
-    y.add("hi".to_owned());
+    y.add("hi".to_strbuf());
 }
diff --git a/src/test/run-pass/deriving-hash.rs b/src/test/run-pass/deriving-hash.rs
index ce24fa71607..5b61b095fb6 100644
--- a/src/test/run-pass/deriving-hash.rs
+++ b/src/test/run-pass/deriving-hash.rs
@@ -15,13 +15,21 @@ use std::hash::Hash;
 #[deriving(Hash)]
 struct Person {
     id: uint,
-    name: ~str,
+    name: StrBuf,
     phone: uint,
 }
 
 fn main() {
-    let person1 = Person { id: 5, name: "Janet".to_owned(), phone: 555_666_7777 };
-    let person2 = Person { id: 5, name: "Bob".to_owned(), phone: 555_666_7777 };
+    let person1 = Person {
+        id: 5,
+        name: "Janet".to_strbuf(),
+        phone: 555_666_7777
+    };
+    let person2 = Person {
+        id: 5,
+        name: "Bob".to_strbuf(),
+        phone: 555_666_7777
+    };
     assert!(hash::hash(&person1) == hash::hash(&person1));
     assert!(hash::hash(&person1) != hash::hash(&person2));
 }
diff --git a/src/test/run-pass/deriving-show-2.rs b/src/test/run-pass/deriving-show-2.rs
index 9811caacda0..59ab75ddaaf 100644
--- a/src/test/run-pass/deriving-show-2.rs
+++ b/src/test/run-pass/deriving-show-2.rs
@@ -17,7 +17,7 @@ enum A {}
 #[deriving(Show)]
 enum B { B1, B2, B3 }
 #[deriving(Show)]
-enum C { C1(int), C2(B), C3(~str) }
+enum C { C1(int), C2(B), C3(StrBuf) }
 #[deriving(Show)]
 enum D { D1{ a: int } }
 #[deriving(Show)]
diff --git a/src/test/run-pass/deriving-via-extension-struct-tuple.rs b/src/test/run-pass/deriving-via-extension-struct-tuple.rs
index fc425dd7076..835741ab7e3 100644
--- a/src/test/run-pass/deriving-via-extension-struct-tuple.rs
+++ b/src/test/run-pass/deriving-via-extension-struct-tuple.rs
@@ -9,12 +9,12 @@
 // except according to those terms.
 
 #[deriving(Eq, Show)]
-struct Foo(int, int, ~str);
+struct Foo(int, int, StrBuf);
 
 pub fn main() {
-  let a1 = Foo(5, 6, "abc".to_owned());
-  let a2 = Foo(5, 6, "abc".to_owned());
-  let b = Foo(5, 7, "def".to_owned());
+  let a1 = Foo(5, 6, "abc".to_strbuf());
+  let a2 = Foo(5, 6, "abc".to_strbuf());
+  let b = Foo(5, 7, "def".to_strbuf());
 
   assert!(a1 == a1);
   assert!(a2 == a1);
diff --git a/src/test/run-pass/drop-on-ret.rs b/src/test/run-pass/drop-on-ret.rs
index 0ab0788fcf7..e2d14239598 100644
--- a/src/test/run-pass/drop-on-ret.rs
+++ b/src/test/run-pass/drop-on-ret.rs
@@ -13,7 +13,7 @@
 
 fn f() -> int {
     if true {
-        let _s: ~str = "should not leak".to_owned();
+        let _s: StrBuf = "should not leak".to_strbuf();
         return 1;
     }
     return 0;
diff --git a/src/test/run-pass/enum-disr-val-pretty.rs b/src/test/run-pass/enum-disr-val-pretty.rs
index 5397d5e65e4..26d2fce3fa8 100644
--- a/src/test/run-pass/enum-disr-val-pretty.rs
+++ b/src/test/run-pass/enum-disr-val-pretty.rs
@@ -13,13 +13,13 @@
 enum color { red = 1, green, blue, imaginary = -1, }
 
 pub fn main() {
-    test_color(red, 1, "red".to_owned());
-    test_color(green, 2, "green".to_owned());
-    test_color(blue, 3, "blue".to_owned());
-    test_color(imaginary, -1, "imaginary".to_owned());
+    test_color(red, 1, "red".to_strbuf());
+    test_color(green, 2, "green".to_strbuf());
+    test_color(blue, 3, "blue".to_strbuf());
+    test_color(imaginary, -1, "imaginary".to_strbuf());
 }
 
-fn test_color(color: color, val: int, _name: ~str) {
+fn test_color(color: color, val: int, _name: StrBuf) {
     assert!(color as int == val);
     assert!(color as f64 == val as f64);
 }
diff --git a/src/test/run-pass/enum-variants.rs b/src/test/run-pass/enum-variants.rs
index 363b44384af..5327a29733e 100644
--- a/src/test/run-pass/enum-variants.rs
+++ b/src/test/run-pass/enum-variants.rs
@@ -13,13 +13,13 @@
 #![feature(struct_variant)]
 
 enum Animal {
-    Dog (~str, f64),
-    Cat { name: ~str, weight: f64 }
+    Dog (StrBuf, f64),
+    Cat { name: StrBuf, weight: f64 }
 }
 
 pub fn main() {
-    let mut a: Animal = Dog("Cocoa".to_owned(), 37.2);
-    a = Cat{ name: "Spotty".to_owned(), weight: 2.7 };
+    let mut a: Animal = Dog("Cocoa".to_strbuf(), 37.2);
+    a = Cat{ name: "Spotty".to_strbuf(), weight: 2.7 };
     // permuting the fields should work too
-    let _c = Cat { weight: 3.1, name: "Spreckles".to_owned() };
+    let _c = Cat { weight: 3.1, name: "Spreckles".to_strbuf() };
 }
diff --git a/src/test/run-pass/estr-uniq.rs b/src/test/run-pass/estr-uniq.rs
index e879453f7c9..85a796a686b 100644
--- a/src/test/run-pass/estr-uniq.rs
+++ b/src/test/run-pass/estr-uniq.rs
@@ -11,10 +11,10 @@
 #![allow(dead_assignment)]
 
 pub fn main() {
-    let x : ~str = "hello".to_owned();
-    let _y : ~str = "there".to_owned();
-    let mut z = "thing".to_owned();
+    let x : StrBuf = "hello".to_strbuf();
+    let _y : StrBuf = "there".to_strbuf();
+    let mut z = "thing".to_strbuf();
     z = x;
-    assert_eq!(z[0], ('h' as u8));
-    assert_eq!(z[4], ('o' as u8));
+    assert_eq!(z.as_slice()[0], ('h' as u8));
+    assert_eq!(z.as_slice()[4], ('o' as u8));
 }
diff --git a/src/test/run-pass/explicit_self_xcrate_exe.rs b/src/test/run-pass/explicit_self_xcrate_exe.rs
index f536b055c6c..4e6b038f8ed 100644
--- a/src/test/run-pass/explicit_self_xcrate_exe.rs
+++ b/src/test/run-pass/explicit_self_xcrate_exe.rs
@@ -14,6 +14,6 @@ extern crate explicit_self_xcrate;
 use explicit_self_xcrate::{Foo, Bar};
 
 pub fn main() {
-    let x = Bar { x: "hello".to_owned() };
+    let x = Bar { x: "hello".to_strbuf() };
     x.f();
 }
diff --git a/src/test/run-pass/foreign-fn-linkname.rs b/src/test/run-pass/foreign-fn-linkname.rs
index 76902470c06..d57031c81e7 100644
--- a/src/test/run-pass/foreign-fn-linkname.rs
+++ b/src/test/run-pass/foreign-fn-linkname.rs
@@ -22,9 +22,9 @@ mod mlibc {
     }
 }
 
-fn strlen(str: ~str) -> uint {
+fn strlen(str: StrBuf) -> uint {
     // C string is terminated with a zero
-    str.with_c_str(|buf| {
+    str.as_slice().with_c_str(|buf| {
         unsafe {
             mlibc::my_strlen(buf) as uint
         }
@@ -32,6 +32,6 @@ fn strlen(str: ~str) -> uint {
 }
 
 pub fn main() {
-    let len = strlen("Rust".to_owned());
+    let len = strlen("Rust".to_strbuf());
     assert_eq!(len, 4u);
 }
diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs
index 32ce8e6f542..33a53809856 100644
--- a/src/test/run-pass/hashmap-memory.rs
+++ b/src/test/run-pass/hashmap-memory.rs
@@ -20,20 +20,22 @@ extern crate collections;
    This originally came from the word-count benchmark.
 */
 
-pub fn map(filename: ~str, emit: map_reduce::putter) { emit(filename, "1".to_owned()); }
+pub fn map(filename: StrBuf, emit: map_reduce::putter) {
+    emit(filename, "1".to_strbuf());
+}
 
 mod map_reduce {
     use collections::HashMap;
     use std::str;
     use std::task;
 
-    pub type putter<'a> = |~str, ~str|: 'a;
+    pub type putter<'a> = |StrBuf, StrBuf|: 'a;
 
-    pub type mapper = extern fn(~str, putter);
+    pub type mapper = extern fn(StrBuf, putter);
 
     enum ctrl_proto { find_reducer(Vec<u8>, Sender<int>), mapper_done, }
 
-    fn start_mappers(ctrl: Sender<ctrl_proto>, inputs: Vec<~str>) {
+    fn start_mappers(ctrl: Sender<ctrl_proto>, inputs: Vec<StrBuf>) {
         for i in inputs.iter() {
             let ctrl = ctrl.clone();
             let i = i.clone();
@@ -41,12 +43,12 @@ mod map_reduce {
         }
     }
 
-    fn map_task(ctrl: Sender<ctrl_proto>, input: ~str) {
+    fn map_task(ctrl: Sender<ctrl_proto>, input: StrBuf) {
         let mut intermediates = HashMap::new();
 
-        fn emit(im: &mut HashMap<~str, int>,
-                ctrl: Sender<ctrl_proto>, key: ~str,
-                _val: ~str) {
+        fn emit(im: &mut HashMap<StrBuf, int>,
+                ctrl: Sender<ctrl_proto>, key: StrBuf,
+                _val: StrBuf) {
             if im.contains_key(&key) {
                 return;
             }
@@ -64,13 +66,13 @@ mod map_reduce {
         ctrl_clone.send(mapper_done);
     }
 
-    pub fn map_reduce(inputs: Vec<~str>) {
+    pub fn map_reduce(inputs: Vec<StrBuf>) {
         let (tx, rx) = channel();
 
         // This task becomes the master control task. It spawns others
         // to do the rest.
 
-        let mut reducers: HashMap<~str, int>;
+        let mut reducers: HashMap<StrBuf, int>;
 
         reducers = HashMap::new();
 
@@ -83,8 +85,8 @@ mod map_reduce {
               mapper_done => { num_mappers -= 1; }
               find_reducer(k, cc) => {
                 let mut c;
-                match reducers.find(&str::from_utf8(k.as_slice()).unwrap()
-                                                                 .to_owned()) {
+                match reducers.find(&str::from_utf8(
+                        k.as_slice()).unwrap().to_strbuf()) {
                   Some(&_c) => { c = _c; }
                   None => { c = 0; }
                 }
@@ -96,5 +98,6 @@ mod map_reduce {
 }
 
 pub fn main() {
-    map_reduce::map_reduce(vec!("../src/test/run-pass/hashmap-memory.rs".to_owned()));
+    map_reduce::map_reduce(
+        vec!("../src/test/run-pass/hashmap-memory.rs".to_strbuf()));
 }
diff --git a/src/test/run-pass/html-literals.rs b/src/test/run-pass/html-literals.rs
index ebecfb2c78a..13211e0d3d1 100644
--- a/src/test/run-pass/html-literals.rs
+++ b/src/test/run-pass/html-literals.rs
@@ -41,7 +41,7 @@ macro_rules! parse_node (
     ) => (
         parse_node!(
             [$(: $tags ($(:$tag_nodes),*))*];
-            [$(:$head_nodes,)* :tag(stringify!($head).to_owned(),
+            [$(:$head_nodes,)* :tag(stringify!($head).to_strbuf(),
                                     vec!($($nodes),*))];
             $($rest)*
         )
@@ -66,7 +66,7 @@ macro_rules! parse_node (
     ) => (
         parse_node!(
             [$(: $tags ($(:$tag_nodes),*))*];
-            [$(:$nodes,)* :text(".".to_owned())];
+            [$(:$nodes,)* :text(".".to_strbuf())];
             $($rest)*
         )
     );
@@ -78,7 +78,7 @@ macro_rules! parse_node (
     ) => (
         parse_node!(
             [$(: $tags ($(:$tag_nodes),*))*];
-            [$(:$nodes,)* :text(stringify!($word).to_owned())];
+            [$(:$nodes,)* :text(stringify!($word).to_strbuf())];
             $($rest)*
         )
     );
@@ -98,6 +98,6 @@ pub fn main() {
 }
 
 enum HTMLFragment {
-    tag(~str, Vec<HTMLFragment> ),
-    text(~str),
+    tag(StrBuf, Vec<HTMLFragment> ),
+    text(StrBuf),
 }
diff --git a/src/test/run-pass/issue-10228.rs b/src/test/run-pass/issue-10228.rs
index 70590876856..ce02f16634f 100644
--- a/src/test/run-pass/issue-10228.rs
+++ b/src/test/run-pass/issue-10228.rs
@@ -13,7 +13,7 @@ enum StdioContainer {
 }
 
 struct Test<'a> {
-    args: &'a [~str],
+    args: &'a [StrBuf],
     io: &'a [StdioContainer]
 }
 
diff --git a/src/test/run-pass/issue-13304.rs b/src/test/run-pass/issue-13304.rs
index fc1825d22cd..36db5a64555 100644
--- a/src/test/run-pass/issue-13304.rs
+++ b/src/test/run-pass/issue-13304.rs
@@ -35,22 +35,25 @@ fn main() {
             rx.recv();
         }
     } else {
-        parent("green".to_owned());
-        parent("native".to_owned());
+        parent("green".to_strbuf());
+        parent("native".to_strbuf());
         let (tx, rx) = channel();
         native::task::spawn(proc() {
-            parent("green".to_owned());
-            parent("native".to_owned());
+            parent("green".to_strbuf());
+            parent("native".to_strbuf());
             tx.send(());
         });
         rx.recv();
     }
 }
 
-fn parent(flavor: ~str) {
+fn parent(flavor: StrBuf) {
     let args = os::args();
     let args = args.as_slice();
-    let mut p = io::Process::new(args[0].as_slice(), ["child".to_owned(), flavor]).unwrap();
+    let mut p = io::Process::new(args[0].as_slice(), [
+        "child".to_owned(),
+        flavor.to_owned()
+    ]).unwrap();
     p.stdin.get_mut_ref().write_str("test1\ntest2\ntest3").unwrap();
     let out = p.wait_with_output().unwrap();
     assert!(out.status.success());
diff --git a/src/test/run-pass/issue-1701.rs b/src/test/run-pass/issue-1701.rs
index 965b875a9e6..cef46d56b7d 100644
--- a/src/test/run-pass/issue-1701.rs
+++ b/src/test/run-pass/issue-1701.rs
@@ -10,22 +10,22 @@
 
 enum pattern { tabby, tortoiseshell, calico }
 enum breed { beagle, rottweiler, pug }
-type name = ~str;
+type name = StrBuf;
 enum ear_kind { lop, upright }
 enum animal { cat(pattern), dog(breed), rabbit(name, ear_kind), tiger }
 
-fn noise(a: animal) -> Option<~str> {
+fn noise(a: animal) -> Option<StrBuf> {
     match a {
-      cat(..)    => { Some("meow".to_owned()) }
-      dog(..)    => { Some("woof".to_owned()) }
+      cat(..)    => { Some("meow".to_strbuf()) }
+      dog(..)    => { Some("woof".to_strbuf()) }
       rabbit(..) => { None }
-      tiger(..)  => { Some("roar".to_owned()) }
+      tiger(..)  => { Some("roar".to_strbuf()) }
     }
 }
 
 pub fn main() {
-    assert_eq!(noise(cat(tabby)), Some("meow".to_owned()));
-    assert_eq!(noise(dog(pug)), Some("woof".to_owned()));
-    assert_eq!(noise(rabbit("Hilbert".to_owned(), upright)), None);
-    assert_eq!(noise(tiger), Some("roar".to_owned()));
+    assert_eq!(noise(cat(tabby)), Some("meow".to_strbuf()));
+    assert_eq!(noise(dog(pug)), Some("woof".to_strbuf()));
+    assert_eq!(noise(rabbit("Hilbert".to_strbuf(), upright)), None);
+    assert_eq!(noise(tiger), Some("roar".to_strbuf()));
 }
diff --git a/src/test/run-pass/issue-2631-b.rs b/src/test/run-pass/issue-2631-b.rs
index ce67b4c3fda..8216e341135 100644
--- a/src/test/run-pass/issue-2631-b.rs
+++ b/src/test/run-pass/issue-2631-b.rs
@@ -20,8 +20,8 @@ use std::cell::RefCell;
 use collections::HashMap;
 
 pub fn main() {
-  let v = vec!(@"hi".to_owned());
+  let v = vec!(@"hi".to_strbuf());
   let mut m: req::header_map = HashMap::new();
-  m.insert("METHOD".to_owned(), @RefCell::new(v));
+  m.insert("METHOD".to_strbuf(), @RefCell::new(v));
   request::<int>(&m);
 }
diff --git a/src/test/run-pass/issue-2804-2.rs b/src/test/run-pass/issue-2804-2.rs
index 597a709201f..57eb0df560f 100644
--- a/src/test/run-pass/issue-2804-2.rs
+++ b/src/test/run-pass/issue-2804-2.rs
@@ -16,8 +16,8 @@ extern crate collections;
 
 use collections::HashMap;
 
-fn add_interfaces(managed_ip: ~str, device: HashMap<~str, int>)  {
-     println!("{}, {:?}", managed_ip, device.get(&"interfaces".to_owned()));
+fn add_interfaces(managed_ip: StrBuf, device: HashMap<StrBuf, int>)  {
+     println!("{}, {:?}", managed_ip, device.get(&"interfaces".to_strbuf()));
 }
 
 pub fn main() {}
diff --git a/src/test/run-pass/issue-2804.rs b/src/test/run-pass/issue-2804.rs
index dfd34fcf591..9405c62a184 100644
--- a/src/test/run-pass/issue-2804.rs
+++ b/src/test/run-pass/issue-2804.rs
@@ -21,11 +21,11 @@ enum object {
     int_value(i64),
 }
 
-fn lookup(table: Box<json::Object>, key: ~str, default: ~str) -> ~str
+fn lookup(table: Box<json::Object>, key: StrBuf, default: StrBuf) -> StrBuf
 {
-    match table.find(&key) {
+    match table.find(&key.to_owned()) {
         option::Some(&json::String(ref s)) => {
-            (*s).clone()
+            (*s).to_strbuf()
         }
         option::Some(value) => {
             println!("{} was expected to be a string but is a {:?}", key, value);
@@ -37,25 +37,27 @@ fn lookup(table: Box<json::Object>, key: ~str, default: ~str) -> ~str
     }
 }
 
-fn add_interface(_store: int, managed_ip: ~str, data: json::Json) -> (~str, object)
+fn add_interface(_store: int, managed_ip: StrBuf, data: json::Json) -> (StrBuf, object)
 {
     match &data {
         &json::Object(ref interface) => {
-            let name = lookup((*interface).clone(), "ifDescr".to_owned(), "".to_owned());
-            let label = format!("{}-{}", managed_ip, name);
+            let name = lookup((*interface).clone(),
+                              "ifDescr".to_strbuf(),
+                              "".to_strbuf());
+            let label = format_strbuf!("{}-{}", managed_ip, name);
 
             (label, bool_value(false))
         }
         _ => {
             println!("Expected dict for {} interfaces but found {:?}", managed_ip, data);
-            ("gnos:missing-interface".to_owned(), bool_value(true))
+            ("gnos:missing-interface".to_strbuf(), bool_value(true))
         }
     }
 }
 
-fn add_interfaces(store: int, managed_ip: ~str, device: HashMap<~str, json::Json>)
--> Vec<(~str, object)> {
-    match device.get(&"interfaces".to_owned())
+fn add_interfaces(store: int, managed_ip: StrBuf, device: HashMap<StrBuf, json::Json>)
+-> Vec<(StrBuf, object)> {
+    match device.get(&"interfaces".to_strbuf())
     {
         &json::List(ref interfaces) =>
         {
@@ -66,7 +68,7 @@ fn add_interfaces(store: int, managed_ip: ~str, device: HashMap<~str, json::Json
         _ =>
         {
             println!("Expected list for {} interfaces but found {:?}", managed_ip,
-                   device.get(&"interfaces".to_owned()));
+                   device.get(&"interfaces".to_strbuf()));
             Vec::new()
         }
     }
diff --git a/src/test/run-pass/issue-3037.rs b/src/test/run-pass/issue-3037.rs
index ef403a6c9cb..0a6482c26b9 100644
--- a/src/test/run-pass/issue-3037.rs
+++ b/src/test/run-pass/issue-3037.rs
@@ -10,7 +10,7 @@
 
 enum what { }
 
-fn what_to_str(x: what) -> ~str
+fn what_to_str(x: what) -> StrBuf
 {
     match x {
     }
diff --git a/src/test/run-pass/issue-3389.rs b/src/test/run-pass/issue-3389.rs
index 404b066ac10..5eefd5ef08a 100644
--- a/src/test/run-pass/issue-3389.rs
+++ b/src/test/run-pass/issue-3389.rs
@@ -10,11 +10,11 @@
 
 
 struct trie_node {
-    content: Vec<~str> ,
+    content: Vec<StrBuf> ,
     children: Vec<trie_node> ,
 }
 
-fn print_str_vector(vector: Vec<~str> ) {
+fn print_str_vector(vector: Vec<StrBuf> ) {
     for string in vector.iter() {
         println!("{}", *string);
     }
@@ -25,8 +25,8 @@ pub fn main() {
         content: Vec::new(),
         children: Vec::new()
     };
-    let v = vec!("123".to_owned(), "abc".to_owned());
-    node.content = vec!("123".to_owned(), "abc".to_owned());
+    let v = vec!("123".to_strbuf(), "abc".to_strbuf());
+    node.content = vec!("123".to_strbuf(), "abc".to_strbuf());
     print_str_vector(v);
     print_str_vector(node.content.clone());
 
diff --git a/src/test/run-pass/issue-3424.rs b/src/test/run-pass/issue-3424.rs
index 5a27009d058..6423ab1cb64 100644
--- a/src/test/run-pass/issue-3424.rs
+++ b/src/test/run-pass/issue-3424.rs
@@ -15,11 +15,13 @@ use std::path::{Path};
 use std::path;
 use std::result;
 
-type rsrc_loader = proc(path: &Path) -> result::Result<~str, ~str>;
+type rsrc_loader = proc(path: &Path) -> result::Result<StrBuf, StrBuf>;
 
 fn tester()
 {
-    let loader: rsrc_loader = proc(_path) {result::Ok("more blah".to_owned())};
+    let loader: rsrc_loader = proc(_path) {
+        result::Ok("more blah".to_strbuf())
+    };
 
     let path = path::Path::new("blah");
     assert!(loader(&path).is_ok());
diff --git a/src/test/run-pass/issue-3556.rs b/src/test/run-pass/issue-3556.rs
index abc21901a03..910f7c328a7 100644
--- a/src/test/run-pass/issue-3556.rs
+++ b/src/test/run-pass/issue-3556.rs
@@ -11,12 +11,12 @@
 #![feature(managed_boxes)]
 
 enum Token {
-    Text(@~str),
-    ETag(@Vec<~str> , @~str),
-    UTag(@Vec<~str> , @~str),
-    Section(@Vec<~str> , bool, @Vec<Token> , @~str, @~str, @~str, @~str, @~str),
-    IncompleteSection(@Vec<~str> , bool, @~str, bool),
-    Partial(@~str, @~str, @~str),
+    Text(@StrBuf),
+    ETag(@Vec<StrBuf> , @StrBuf),
+    UTag(@Vec<StrBuf> , @StrBuf),
+    Section(@Vec<StrBuf> , bool, @Vec<Token> , @StrBuf, @StrBuf, @StrBuf, @StrBuf, @StrBuf),
+    IncompleteSection(@Vec<StrBuf> , bool, @StrBuf, bool),
+    Partial(@StrBuf, @StrBuf, @StrBuf),
 }
 
 fn check_strs(actual: &str, expected: &str) -> bool
@@ -35,10 +35,13 @@ pub fn main()
 // assert!(check_strs(fmt!("%?", ETag(@~["foo".to_owned()], @"bar".to_owned())),
 //                    "ETag(@~[ ~\"foo\" ], @~\"bar\")"));
 
-    let t = Text(@"foo".to_owned());
-    let u = Section(@vec!("alpha".to_owned()), true, @vec!(t), @"foo".to_owned(),
-                    @"foo".to_owned(), @"foo".to_owned(), @"foo".to_owned(),
-                    @"foo".to_owned());
+    let t = Text(@"foo".to_strbuf());
+    let u = Section(@vec!("alpha".to_strbuf()),
+                          true,
+                          @vec!(t),
+                          @"foo".to_strbuf(),
+                    @"foo".to_strbuf(), @"foo".to_strbuf(), @"foo".to_strbuf(),
+                    @"foo".to_strbuf());
     let v = format!("{:?}", u);    // this is the line that causes the seg fault
     assert!(v.len() > 0);
 }
diff --git a/src/test/run-pass/issue-3563-3.rs b/src/test/run-pass/issue-3563-3.rs
index 85299472458..ac2ce615fee 100644
--- a/src/test/run-pass/issue-3563-3.rs
+++ b/src/test/run-pass/issue-3563-3.rs
@@ -100,8 +100,10 @@ impl fmt::Show for AsciiArt {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         // Convert each line into a string.
         let lines = self.lines.iter()
-                              .map(|line| str::from_chars(line.as_slice()))
-                              .collect::<Vec<~str>>();
+                              .map(|line| {
+                                  str::from_chars(line.as_slice()).to_strbuf()
+                              })
+                              .collect::<Vec<StrBuf>>();
 
         // Concatenate the lines together using a new-line.
         write!(f.buf, "{}", lines.connect("\n"))
diff --git a/src/test/run-pass/issue-3609.rs b/src/test/run-pass/issue-3609.rs
index 95bbf77024c..f1fd83b179f 100644
--- a/src/test/run-pass/issue-3609.rs
+++ b/src/test/run-pass/issue-3609.rs
@@ -15,10 +15,10 @@ type SamplesFn = proc(samples: &RingBuffer):Send;
 
 enum Msg
 {
-    GetSamples(~str, SamplesFn), // sample set name, callback which receives samples
+    GetSamples(StrBuf, SamplesFn), // sample set name, callback which receives samples
 }
 
-fn foo(name: ~str, samples_chan: Sender<Msg>) {
+fn foo(name: StrBuf, samples_chan: Sender<Msg>) {
     task::spawn(proc() {
         let mut samples_chan = samples_chan;
         let callback: SamplesFn = proc(buffer) {
diff --git a/src/test/run-pass/issue-3702.rs b/src/test/run-pass/issue-3702.rs
index 84414461e96..9ee34d58c37 100644
--- a/src/test/run-pass/issue-3702.rs
+++ b/src/test/run-pass/issue-3702.rs
@@ -11,7 +11,7 @@
 
 pub fn main() {
   trait Text {
-    fn to_str(&self) -> ~str;
+    fn to_str(&self) -> StrBuf;
   }
 
   fn to_string(t: Box<Text>) {
diff --git a/src/test/run-pass/issue-3935.rs b/src/test/run-pass/issue-3935.rs
index 36a5396e6cf..ef24a8cd9d1 100644
--- a/src/test/run-pass/issue-3935.rs
+++ b/src/test/run-pass/issue-3935.rs
@@ -10,12 +10,12 @@
 
 #[deriving(Eq)]
 struct Bike {
-    name: ~str,
+    name: StrBuf,
 }
 
 pub fn main() {
-    let town_bike = Bike { name: "schwinn".to_owned() };
-    let my_bike = Bike { name: "surly".to_owned() };
+    let town_bike = Bike { name: "schwinn".to_strbuf() };
+    let my_bike = Bike { name: "surly".to_strbuf() };
 
     assert!(town_bike != my_bike);
 }
diff --git a/src/test/run-pass/issue-4241.rs b/src/test/run-pass/issue-4241.rs
index f3e37921ba4..0f7219d7901 100644
--- a/src/test/run-pass/issue-4241.rs
+++ b/src/test/run-pass/issue-4241.rs
@@ -24,8 +24,8 @@ enum Result {
   Int(int),
   Data(~[u8]),
   List(~[Result]),
-  Error(~str),
-  Status(~str)
+  Error(StrBuf),
+  Status(StrBuf)
 }
 
 priv fn parse_data(len: uint, io: @io::Reader) -> Result {
@@ -55,7 +55,7 @@ priv fn parse_list(len: uint, io: @io::Reader) -> Result {
     return List(list);
 }
 
-priv fn chop(s: ~str) -> ~str {
+priv fn chop(s: StrBuf) -> StrBuf {
   s.slice(0, s.len() - 1).to_owned()
 }
 
@@ -96,7 +96,7 @@ priv fn parse_response(io: @io::Reader) -> Result {
     }
 }
 
-priv fn cmd_to_str(cmd: ~[~str]) -> ~str {
+priv fn cmd_to_str(cmd: ~[StrBuf]) -> StrBuf {
   let mut res = "*".to_owned();
   res.push_str(cmd.len().to_str());
   res.push_str("\r\n");
@@ -107,7 +107,7 @@ priv fn cmd_to_str(cmd: ~[~str]) -> ~str {
   res
 }
 
-fn query(cmd: ~[~str], sb: TcpSocketBuf) -> Result {
+fn query(cmd: ~[StrBuf], sb: TcpSocketBuf) -> Result {
   let cmd = cmd_to_str(cmd);
   //println!("{}", cmd);
   sb.write_str(cmd);
@@ -115,7 +115,7 @@ fn query(cmd: ~[~str], sb: TcpSocketBuf) -> Result {
   res
 }
 
-fn query2(cmd: ~[~str]) -> Result {
+fn query2(cmd: ~[StrBuf]) -> Result {
   let _cmd = cmd_to_str(cmd);
     io::with_str_reader("$3\r\nXXX\r\n".to_owned())(|sb| {
     let res = parse_response(@sb as @io::Reader);
diff --git a/src/test/run-pass/issue-4541.rs b/src/test/run-pass/issue-4541.rs
index f05b1932b73..73df5d206d3 100644
--- a/src/test/run-pass/issue-4541.rs
+++ b/src/test/run-pass/issue-4541.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn parse_args() -> ~str {
+fn parse_args() -> StrBuf {
     let args = ::std::os::args();
     let args = args.as_slice();
     let mut n = 0;
@@ -17,13 +17,13 @@ fn parse_args() -> ~str {
         match args[n].as_slice() {
             "-v" => (),
             s => {
-                return s.into_owned();
+                return s.to_strbuf();
             }
         }
         n += 1;
     }
 
-    return "".to_owned()
+    return "".to_strbuf()
 }
 
 pub fn main() {
diff --git a/src/test/run-pass/issue-5008-borrowed-traitobject-method-call.rs b/src/test/run-pass/issue-5008-borrowed-traitobject-method-call.rs
index 08676495e31..57cae2fdf71 100644
--- a/src/test/run-pass/issue-5008-borrowed-traitobject-method-call.rs
+++ b/src/test/run-pass/issue-5008-borrowed-traitobject-method-call.rs
@@ -16,20 +16,20 @@ It fixes itself if the &Trait is changed to @Trait.
 */
 
 trait Debuggable {
-    fn debug_name(&self) -> ~str;
+    fn debug_name(&self) -> StrBuf;
 }
 
 #[deriving(Clone)]
 struct Thing {
-name: ~str,
+    name: StrBuf,
 }
 
 impl Thing {
-    fn new() -> Thing { Thing { name: "dummy".to_owned() } }
+    fn new() -> Thing { Thing { name: "dummy".to_strbuf() } }
 }
 
 impl Debuggable for Thing {
-    fn debug_name(&self) -> ~str { self.name.clone() }
+    fn debug_name(&self) -> StrBuf { self.name.clone() }
 }
 
 fn print_name(x: &Debuggable)
diff --git a/src/test/run-pass/issue-5353.rs b/src/test/run-pass/issue-5353.rs
index 845d1a18c2a..ade2815fd2d 100644
--- a/src/test/run-pass/issue-5353.rs
+++ b/src/test/run-pass/issue-5353.rs
@@ -11,13 +11,13 @@
 static INVALID_ENUM : u32 = 0;
 static INVALID_VALUE : u32 = 1;
 
-fn gl_err_str(err: u32) -> ~str
+fn gl_err_str(err: u32) -> StrBuf
 {
   match err
   {
-    INVALID_ENUM => { "Invalid enum".to_owned() },
-    INVALID_VALUE => { "Invalid value".to_owned() },
-    _ => { "Unknown error".to_owned() }
+    INVALID_ENUM => { "Invalid enum".to_strbuf() },
+    INVALID_VALUE => { "Invalid value".to_strbuf() },
+    _ => { "Unknown error".to_strbuf() }
   }
 }
 
diff --git a/src/test/run-pass/issue-5550.rs b/src/test/run-pass/issue-5550.rs
index b3d22ab1a37..d4962784b9a 100644
--- a/src/test/run-pass/issue-5550.rs
+++ b/src/test/run-pass/issue-5550.rs
@@ -11,7 +11,7 @@
 #![allow(dead_assignment)]
 
 pub fn main() {
-    let s: ~str = "foobar".to_owned();
-    let mut t: &str = s;
+    let s: StrBuf = "foobar".to_strbuf();
+    let mut t: &str = s.as_slice();
     t = t.slice(0, 3); // for master: str::view(t, 0, 3) maybe
 }
diff --git a/src/test/run-pass/issue-5666.rs b/src/test/run-pass/issue-5666.rs
index a3dc1fae7f1..2238c30f6e8 100644
--- a/src/test/run-pass/issue-5666.rs
+++ b/src/test/run-pass/issue-5666.rs
@@ -10,23 +10,23 @@
 
 
 struct Dog {
-    name : ~str
+    name : StrBuf
 }
 
 trait Barks {
-    fn bark(&self) -> ~str;
+    fn bark(&self) -> StrBuf;
 }
 
 impl Barks for Dog {
-    fn bark(&self) -> ~str {
-        return format!("woof! (I'm {})", self.name);
+    fn bark(&self) -> StrBuf {
+        return format!("woof! (I'm {})", self.name).to_strbuf();
     }
 }
 
 
 pub fn main() {
-    let snoopy = box Dog{name: "snoopy".to_owned()};
-    let bubbles = box Dog{name: "bubbles".to_owned()};
+    let snoopy = box Dog{name: "snoopy".to_strbuf()};
+    let bubbles = box Dog{name: "bubbles".to_strbuf()};
     let barker = [snoopy as Box<Barks>, bubbles as Box<Barks>];
 
     for pup in barker.iter() {
diff --git a/src/test/run-pass/issue-8506.rs b/src/test/run-pass/issue-8506.rs
index 1c3e0f36707..ecf066d86bc 100644
--- a/src/test/run-pass/issue-8506.rs
+++ b/src/test/run-pass/issue-8506.rs
@@ -12,7 +12,7 @@
 
 enum Either {
     One,
-    Other(~str,~str)
+    Other(StrBuf,StrBuf)
 }
 
 static one : Either = One;
diff --git a/src/test/run-pass/issue-8578.rs b/src/test/run-pass/issue-8578.rs
index fcc9278b4c5..383eede5c14 100644
--- a/src/test/run-pass/issue-8578.rs
+++ b/src/test/run-pass/issue-8578.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 pub struct UninterpretedOption_NamePart {
-    name_part: Option<~str>,
+    name_part: Option<StrBuf>,
 }
 
 impl<'a> UninterpretedOption_NamePart {
diff --git a/src/test/run-pass/issue-8898.rs b/src/test/run-pass/issue-8898.rs
index 54e0c30c1d2..77edc07ace0 100644
--- a/src/test/run-pass/issue-8898.rs
+++ b/src/test/run-pass/issue-8898.rs
@@ -10,8 +10,8 @@
 
 #![feature(managed_boxes)]
 
-fn assert_repr_eq<T>(obj : T, expected : ~str) {
-    assert_eq!(expected, format!("{:?}", obj));
+fn assert_repr_eq<T>(obj : T, expected : StrBuf) {
+    assert_eq!(expected, format_strbuf!("{:?}", obj));
 }
 
 pub fn main() {
@@ -21,10 +21,10 @@ pub fn main() {
     let slice = x.slice(0,1);
     let z = @x;
 
-    assert_repr_eq(abc, "[1, 2, 3]".to_owned());
-    assert_repr_eq(tf, "[true, false]".to_owned());
-    assert_repr_eq(x, "[(), ()]".to_owned());
-    assert_repr_eq(slice, "&[()]".to_owned());
-    assert_repr_eq(&x, "&[(), ()]".to_owned());
-    assert_repr_eq(z, "@[(), ()]".to_owned());
+    assert_repr_eq(abc, "[1, 2, 3]".to_strbuf());
+    assert_repr_eq(tf, "[true, false]".to_strbuf());
+    assert_repr_eq(x, "[(), ()]".to_strbuf());
+    assert_repr_eq(slice, "&[()]".to_strbuf());
+    assert_repr_eq(&x, "&[(), ()]".to_strbuf());
+    assert_repr_eq(z, "@[(), ()]".to_strbuf());
 }
diff --git a/src/test/run-pass/issue-9047.rs b/src/test/run-pass/issue-9047.rs
index 70b6eec83af..0cdceb23517 100644
--- a/src/test/run-pass/issue-9047.rs
+++ b/src/test/run-pass/issue-9047.rs
@@ -8,12 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn decode() -> ~str {
+fn decode() -> StrBuf {
     'outer: loop {
         let mut ch_start: uint;
         break 'outer;
     }
-    "".to_owned()
+    "".to_strbuf()
 }
 
 pub fn main() {
diff --git a/src/test/run-pass/issue-9259.rs b/src/test/run-pass/issue-9259.rs
index b03213272cb..8cdd5d31002 100644
--- a/src/test/run-pass/issue-9259.rs
+++ b/src/test/run-pass/issue-9259.rs
@@ -9,14 +9,14 @@
 // except according to those terms.
 
 struct A<'a> {
-    a: &'a [~str],
-    b: Option<&'a [~str]>,
+    a: &'a [StrBuf],
+    b: Option<&'a [StrBuf]>,
 }
 
 pub fn main() {
-    let b = &["foo".to_owned()];
+    let b = &["foo".to_strbuf()];
     let a = A {
-        a: &["test".to_owned()],
+        a: &["test".to_strbuf()],
         b: Some(b),
     };
     assert_eq!(a.b.get_ref()[0].as_slice(), "foo");
diff --git a/src/test/run-pass/issue-9394-inherited-trait-calls.rs b/src/test/run-pass/issue-9394-inherited-trait-calls.rs
index af8be3a7f11..cd9154f2748 100644
--- a/src/test/run-pass/issue-9394-inherited-trait-calls.rs
+++ b/src/test/run-pass/issue-9394-inherited-trait-calls.rs
@@ -9,62 +9,62 @@
 // except according to those terms.
 
 trait Base: Base2 + Base3{
-    fn foo(&self) -> ~str;
-    fn foo1(&self) -> ~str;
-    fn foo2(&self) -> ~str{
-        "base foo2".to_owned()
+    fn foo(&self) -> StrBuf;
+    fn foo1(&self) -> StrBuf;
+    fn foo2(&self) -> StrBuf{
+        "base foo2".to_strbuf()
     }
 }
 
 trait Base2: Base3{
-    fn baz(&self) -> ~str;
+    fn baz(&self) -> StrBuf;
 }
 
 trait Base3{
-    fn root(&self) -> ~str;
+    fn root(&self) -> StrBuf;
 }
 
 trait Super: Base{
-    fn bar(&self) -> ~str;
+    fn bar(&self) -> StrBuf;
 }
 
 struct X;
 
 impl Base for X {
-    fn foo(&self) -> ~str{
-        "base foo".to_owned()
+    fn foo(&self) -> StrBuf{
+        "base foo".to_strbuf()
     }
-    fn foo1(&self) -> ~str{
-        "base foo1".to_owned()
+    fn foo1(&self) -> StrBuf{
+        "base foo1".to_strbuf()
     }
 
 }
 
 impl Base2 for X {
-    fn baz(&self) -> ~str{
-        "base2 baz".to_owned()
+    fn baz(&self) -> StrBuf{
+        "base2 baz".to_strbuf()
     }
 }
 
 impl Base3 for X {
-    fn root(&self) -> ~str{
-        "base3 root".to_owned()
+    fn root(&self) -> StrBuf{
+        "base3 root".to_strbuf()
     }
 }
 
 impl Super for X {
-    fn bar(&self) -> ~str{
-        "super bar".to_owned()
+    fn bar(&self) -> StrBuf{
+        "super bar".to_strbuf()
     }
 }
 
 pub fn main() {
     let n = X;
     let s = &n as &Super;
-    assert_eq!(s.bar(),"super bar".to_owned());
-    assert_eq!(s.foo(),"base foo".to_owned());
-    assert_eq!(s.foo1(),"base foo1".to_owned());
-    assert_eq!(s.foo2(),"base foo2".to_owned());
-    assert_eq!(s.baz(),"base2 baz".to_owned());
-    assert_eq!(s.root(),"base3 root".to_owned());
+    assert_eq!(s.bar(),"super bar".to_strbuf());
+    assert_eq!(s.foo(),"base foo".to_strbuf());
+    assert_eq!(s.foo1(),"base foo1".to_strbuf());
+    assert_eq!(s.foo2(),"base foo2".to_strbuf());
+    assert_eq!(s.baz(),"base2 baz".to_strbuf());
+    assert_eq!(s.root(),"base3 root".to_strbuf());
 }
diff --git a/src/test/run-pass/issue-9446.rs b/src/test/run-pass/issue-9446.rs
index b4e814e6248..319e67b67a1 100644
--- a/src/test/run-pass/issue-9446.rs
+++ b/src/test/run-pass/issue-9446.rs
@@ -8,10 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-struct Wrapper(~str);
+struct Wrapper(StrBuf);
 
 impl Wrapper {
-    pub fn new(wrapped: ~str) -> Wrapper {
+    pub fn new(wrapped: StrBuf) -> Wrapper {
         Wrapper(wrapped)
     }
 
@@ -28,12 +28,12 @@ impl Drop for Wrapper {
 pub fn main() {
     {
         // This runs without complaint.
-        let x = Wrapper::new("Bob".to_owned());
+        let x = Wrapper::new("Bob".to_strbuf());
         x.say_hi();
     }
     {
         // This fails to compile, circa 0.8-89-gc635fba.
         // error: internal compiler error: drop_ty_immediate: non-box ty
-        Wrapper::new("Bob".to_owned()).say_hi();
+        Wrapper::new("Bob".to_strbuf()).say_hi();
     }
 }
diff --git a/src/test/run-pass/istr.rs b/src/test/run-pass/istr.rs
index 7201ce31bcd..e4e7b052cf3 100644
--- a/src/test/run-pass/istr.rs
+++ b/src/test/run-pass/istr.rs
@@ -11,37 +11,27 @@
 use std::strbuf::StrBuf;
 
 fn test_stack_assign() {
-    let s: ~str = "a".to_owned();
+    let s: StrBuf = "a".to_strbuf();
     println!("{}", s.clone());
-    let t: ~str = "a".to_owned();
+    let t: StrBuf = "a".to_strbuf();
     assert!(s == t);
-    let u: ~str = "b".to_owned();
+    let u: StrBuf = "b".to_strbuf();
     assert!((s != u));
 }
 
-fn test_heap_lit() { "a big string".to_owned(); }
+fn test_heap_lit() { "a big string".to_strbuf(); }
 
 fn test_heap_assign() {
-    let s: ~str = "a big ol' string".to_owned();
-    let t: ~str = "a big ol' string".to_owned();
+    let s: StrBuf = "a big ol' string".to_strbuf();
+    let t: StrBuf = "a big ol' string".to_strbuf();
     assert!(s == t);
-    let u: ~str = "a bad ol' string".to_owned();
+    let u: StrBuf = "a bad ol' string".to_strbuf();
     assert!((s != u));
 }
 
-fn test_heap_log() { let s = "a big ol' string".to_owned(); println!("{}", s); }
-
-fn test_stack_add() {
-    assert_eq!("a".to_owned() + "b", "ab".to_owned());
-    let s: ~str = "a".to_owned();
-    assert_eq!(s + s, "aa".to_owned());
-    assert_eq!("".to_owned() + "", "".to_owned());
-}
-
-fn test_stack_heap_add() { assert!(("a".to_owned() + "bracadabra" == "abracadabra".to_owned())); }
-
-fn test_heap_add() {
-    assert_eq!("this should".to_owned() + " totally work", "this should totally work".to_owned());
+fn test_heap_log() {
+    let s = "a big ol' string".to_strbuf();
+    println!("{}", s);
 }
 
 fn test_append() {
@@ -67,8 +57,5 @@ pub fn main() {
     test_heap_lit();
     test_heap_assign();
     test_heap_log();
-    test_stack_add();
-    test_stack_heap_add();
-    test_heap_add();
     test_append();
 }
diff --git a/src/test/run-pass/last-use-in-block.rs b/src/test/run-pass/last-use-in-block.rs
index 8117c5657e9..1eedaed98bc 100644
--- a/src/test/run-pass/last-use-in-block.rs
+++ b/src/test/run-pass/last-use-in-block.rs
@@ -10,7 +10,7 @@
 
 // Issue #1818
 
-fn lp<T>(s: ~str, f: |~str| -> T) -> T {
+fn lp<T>(s: StrBuf, f: |StrBuf| -> T) -> T {
     while false {
         let r = f(s);
         return (r);
@@ -18,8 +18,8 @@ fn lp<T>(s: ~str, f: |~str| -> T) -> T {
     fail!();
 }
 
-fn apply<T>(s: ~str, f: |~str| -> T) -> T {
-    fn g<T>(s: ~str, f: |~str| -> T) -> T {f(s)}
+fn apply<T>(s: StrBuf, f: |StrBuf| -> T) -> T {
+    fn g<T>(s: StrBuf, f: |StrBuf| -> T) -> T {f(s)}
     g(s, |v| { let r = f(v); r })
 }
 
diff --git a/src/test/run-pass/log-knows-the-names-of-variants-in-std.rs b/src/test/run-pass/log-knows-the-names-of-variants-in-std.rs
index d51ce1538ef..e9e6ab02e9e 100644
--- a/src/test/run-pass/log-knows-the-names-of-variants-in-std.rs
+++ b/src/test/run-pass/log-knows-the-names-of-variants-in-std.rs
@@ -12,29 +12,23 @@
 #[deriving(Clone)]
 enum foo {
   a(uint),
-  b(~str),
+  b(StrBuf),
 }
 
-fn check_log<T>(exp: ~str, v: T) {
-    assert_eq!(exp, format!("{:?}", v));
+fn check_log<T>(exp: StrBuf, v: T) {
+    assert_eq!(exp, format_strbuf!("{:?}", v));
 }
 
 pub fn main() {
     let mut x = Some(a(22u));
-    let exp = "Some(a(22u))".to_owned();
-    let act = format!("{:?}", x);
-    assert_eq!(act, exp);
-    check_log(exp, x);
-
-    x = Some(b("hi".to_owned()));
-    let exp = "Some(b(~\"hi\"))".to_owned();
-    let act = format!("{:?}", x);
+    let exp = "Some(a(22u))".to_strbuf();
+    let act = format_strbuf!("{:?}", x);
     assert_eq!(act, exp);
     check_log(exp, x);
 
     x = None;
-    let exp = "None".to_owned();
-    let act = format!("{:?}", x);
+    let exp = "None".to_strbuf();
+    let act = format_strbuf!("{:?}", x);
     assert_eq!(act, exp);
     check_log(exp, x);
 }
diff --git a/src/test/run-pass/log-knows-the-names-of-variants.rs b/src/test/run-pass/log-knows-the-names-of-variants.rs
index 404c227c2e2..46bdb5eb766 100644
--- a/src/test/run-pass/log-knows-the-names-of-variants.rs
+++ b/src/test/run-pass/log-knows-the-names-of-variants.rs
@@ -10,7 +10,7 @@
 
 enum foo {
   a(uint),
-  b(~str),
+  b(StrBuf),
   c,
 }
 
@@ -19,8 +19,7 @@ enum bar {
 }
 
 pub fn main() {
-    assert_eq!("a(22u)".to_owned(), format!("{:?}", a(22u)));
-    assert_eq!("b(~\"hi\")".to_owned(), format!("{:?}", b("hi".to_owned())));
-    assert_eq!("c".to_owned(), format!("{:?}", c));
-    assert_eq!("d".to_owned(), format!("{:?}", d));
+    assert_eq!("a(22u)".to_strbuf(), format_strbuf!("{:?}", a(22u)));
+    assert_eq!("c".to_strbuf(), format_strbuf!("{:?}", c));
+    assert_eq!("d".to_strbuf(), format_strbuf!("{:?}", d));
 }
diff --git a/src/test/run-pass/match-borrowed_str.rs b/src/test/run-pass/match-borrowed_str.rs
index 3bbd33378d0..db1db8067a8 100644
--- a/src/test/run-pass/match-borrowed_str.rs
+++ b/src/test/run-pass/match-borrowed_str.rs
@@ -10,49 +10,49 @@
 
 #![allow(unnecessary_allocation)]
 
-fn f1(ref_string: &str) -> ~str {
+fn f1(ref_string: &str) -> StrBuf {
     match ref_string {
-        "a" => "found a".to_owned(),
-        "b" => "found b".to_owned(),
-        _ => "not found".to_owned()
+        "a" => "found a".to_strbuf(),
+        "b" => "found b".to_strbuf(),
+        _ => "not found".to_strbuf()
     }
 }
 
-fn f2(ref_string: &str) -> ~str {
+fn f2(ref_string: &str) -> StrBuf {
     match ref_string {
-        "a" => "found a".to_owned(),
-        "b" => "found b".to_owned(),
-        s => format!("not found ({})", s)
+        "a" => "found a".to_strbuf(),
+        "b" => "found b".to_strbuf(),
+        s => format_strbuf!("not found ({})", s)
     }
 }
 
-fn g1(ref_1: &str, ref_2: &str) -> ~str {
+fn g1(ref_1: &str, ref_2: &str) -> StrBuf {
     match (ref_1, ref_2) {
-        ("a", "b") => "found a,b".to_owned(),
-        ("b", "c") => "found b,c".to_owned(),
-        _ => "not found".to_owned()
+        ("a", "b") => "found a,b".to_strbuf(),
+        ("b", "c") => "found b,c".to_strbuf(),
+        _ => "not found".to_strbuf()
     }
 }
 
-fn g2(ref_1: &str, ref_2: &str) -> ~str {
+fn g2(ref_1: &str, ref_2: &str) -> StrBuf {
     match (ref_1, ref_2) {
-        ("a", "b") => "found a,b".to_owned(),
-        ("b", "c") => "found b,c".to_owned(),
-        (s1, s2) => format!("not found ({}, {})", s1, s2)
+        ("a", "b") => "found a,b".to_strbuf(),
+        ("b", "c") => "found b,c".to_strbuf(),
+        (s1, s2) => format_strbuf!("not found ({}, {})", s1, s2)
     }
 }
 
 pub fn main() {
-    assert_eq!(f1("b".to_owned()), "found b".to_owned());
-    assert_eq!(f1("c"), "not found".to_owned());
-    assert_eq!(f1("d"), "not found".to_owned());
-    assert_eq!(f2("b".to_owned()), "found b".to_owned());
-    assert_eq!(f2("c"), "not found (c)".to_owned());
-    assert_eq!(f2("d"), "not found (d)".to_owned());
-    assert_eq!(g1("b".to_owned(), "c".to_owned()), "found b,c".to_owned());
-    assert_eq!(g1("c", "d"), "not found".to_owned());
-    assert_eq!(g1("d", "e"), "not found".to_owned());
-    assert_eq!(g2("b".to_owned(), "c".to_owned()), "found b,c".to_owned());
-    assert_eq!(g2("c", "d"), "not found (c, d)".to_owned());
-    assert_eq!(g2("d", "e"), "not found (d, e)".to_owned());
+    assert_eq!(f1("b"), "found b".to_strbuf());
+    assert_eq!(f1("c"), "not found".to_strbuf());
+    assert_eq!(f1("d"), "not found".to_strbuf());
+    assert_eq!(f2("b"), "found b".to_strbuf());
+    assert_eq!(f2("c"), "not found (c)".to_strbuf());
+    assert_eq!(f2("d"), "not found (d)".to_strbuf());
+    assert_eq!(g1("b", "c"), "found b,c".to_strbuf());
+    assert_eq!(g1("c", "d"), "not found".to_strbuf());
+    assert_eq!(g1("d", "e"), "not found".to_strbuf());
+    assert_eq!(g2("b", "c"), "found b,c".to_strbuf());
+    assert_eq!(g2("c", "d"), "not found (c, d)".to_strbuf());
+    assert_eq!(g2("d", "e"), "not found (d, e)".to_strbuf());
 }
diff --git a/src/test/run-pass/match-str.rs b/src/test/run-pass/match-str.rs
index e1ae9a6a73a..e3060a6b4be 100644
--- a/src/test/run-pass/match-str.rs
+++ b/src/test/run-pass/match-str.rs
@@ -13,13 +13,13 @@
 pub fn main() {
     match "test" { "not-test" => fail!(), "test" => (), _ => fail!() }
 
-    enum t { tag1(~str), tag2, }
+    enum t { tag1(StrBuf), tag2, }
 
 
-    match tag1("test".to_owned()) {
+    match tag1("test".to_strbuf()) {
       tag2 => fail!(),
-      tag1(ref s) if "test" != *s => fail!(),
-      tag1(ref s) if "test" == *s => (),
+      tag1(ref s) if "test" != s.as_slice() => fail!(),
+      tag1(ref s) if "test" == s.as_slice() => (),
       _ => fail!()
     }
 
diff --git a/src/test/run-pass/monad.rs b/src/test/run-pass/monad.rs
index 1011734a2ad..8b3cb76817e 100644
--- a/src/test/run-pass/monad.rs
+++ b/src/test/run-pass/monad.rs
@@ -37,15 +37,18 @@ impl<A> option_monad<A> for Option<A> {
     }
 }
 
-fn transform(x: Option<int>) -> Option<~str> {
-    x.bind(|n| Some(*n + 1) ).bind(|n| Some(n.to_str()) )
+fn transform(x: Option<int>) -> Option<StrBuf> {
+    x.bind(|n| Some(*n + 1) ).bind(|n| Some(n.to_str().to_strbuf()) )
 }
 
 pub fn main() {
-    assert_eq!(transform(Some(10)), Some("11".to_owned()));
+    assert_eq!(transform(Some(10)), Some("11".to_strbuf()));
     assert_eq!(transform(None), None);
-    assert!((vec!("hi".to_owned()))
-        .bind(|x| vec!(x.clone(), *x + "!") )
-        .bind(|x| vec!(x.clone(), *x + "?") ) ==
-        vec!("hi".to_owned(), "hi?".to_owned(), "hi!".to_owned(), "hi!?".to_owned()));
+    assert!((vec!("hi".to_strbuf()))
+        .bind(|x| vec!(x.clone(), format_strbuf!("{}!", x)) )
+        .bind(|x| vec!(x.clone(), format_strbuf!("{}?", x)) ) ==
+        vec!("hi".to_strbuf(),
+             "hi?".to_strbuf(),
+             "hi!".to_strbuf(),
+             "hi!?".to_strbuf()));
 }
diff --git a/src/test/run-pass/move-self.rs b/src/test/run-pass/move-self.rs
index e31e312f4fb..276aaa3b63f 100644
--- a/src/test/run-pass/move-self.rs
+++ b/src/test/run-pass/move-self.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 struct S {
-    x: ~str
+    x: StrBuf
 }
 
 impl S {
@@ -23,6 +23,6 @@ impl S {
 }
 
 pub fn main() {
-    let x = S { x: "Hello!".to_owned() };
+    let x = S { x: "Hello!".to_strbuf() };
     x.foo();
 }
diff --git a/src/test/run-pass/nullable-pointer-iotareduction.rs b/src/test/run-pass/nullable-pointer-iotareduction.rs
index 728c0154a90..1618f11914b 100644
--- a/src/test/run-pass/nullable-pointer-iotareduction.rs
+++ b/src/test/run-pass/nullable-pointer-iotareduction.rs
@@ -76,7 +76,7 @@ pub fn main() {
     check_type!(&17: &int);
     check_type!(box 18: Box<int>);
     check_type!(@19: @int);
-    check_type!("foo".to_owned(): ~str);
+    check_type!("foo".to_strbuf(): StrBuf);
     check_type!(vec!(20, 22): Vec<int> );
     let mint: uint = unsafe { mem::transmute(main) };
     check_type!(main: fn(), |pthing| {
diff --git a/src/test/run-pass/nullable-pointer-size.rs b/src/test/run-pass/nullable-pointer-size.rs
index 0ca8efb3fdc..2309984a1f1 100644
--- a/src/test/run-pass/nullable-pointer-size.rs
+++ b/src/test/run-pass/nullable-pointer-size.rs
@@ -40,6 +40,5 @@ pub fn main() {
     check_type!(&'static int);
     check_type!(Box<int>);
     check_type!(@int);
-    check_type!(~str);
     check_type!(extern fn());
 }
diff --git a/src/test/run-pass/packed-struct-generic-size.rs b/src/test/run-pass/packed-struct-generic-size.rs
index b297fc7e13f..80f37a0fa3d 100644
--- a/src/test/run-pass/packed-struct-generic-size.rs
+++ b/src/test/run-pass/packed-struct-generic-size.rs
@@ -21,7 +21,4 @@ pub fn main() {
     assert_eq!(mem::size_of::<S<u8, u8>>(), 3);
 
     assert_eq!(mem::size_of::<S<u64, u16>>(), 11);
-
-    assert_eq!(mem::size_of::<S<~str, Vec<int> >>(),
-               1 + mem::size_of::<~str>() + mem::size_of::<Vec<int> >());
 }
diff --git a/src/test/run-pass/packed-struct-size.rs b/src/test/run-pass/packed-struct-size.rs
index fc081408229..1781f162bc4 100644
--- a/src/test/run-pass/packed-struct-size.rs
+++ b/src/test/run-pass/packed-struct-size.rs
@@ -25,11 +25,10 @@ struct S5 {
 }
 
 #[packed]
-struct S13_str {
+struct S13 {
     a: i64,
     b: f32,
     c: u8,
-    d: ~str
 }
 
 enum Foo {
@@ -61,7 +60,7 @@ static TEST_S3_Foo: S3_Foo = S3_Foo { a: 1, b: 2, c: Baz };
 pub fn main() {
     assert_eq!(mem::size_of::<S4>(), 4);
     assert_eq!(mem::size_of::<S5>(), 5);
-    assert_eq!(mem::size_of::<S13_str>(), 13 + mem::size_of::<~str>());
+    assert_eq!(mem::size_of::<S13>(), 13);
     assert_eq!(mem::size_of::<S3_Foo>(), 3 + mem::size_of::<Foo>());
     assert_eq!(mem::size_of::<S7_Option>(), 7 + mem::size_of::<Option<@f64>>());
 }
diff --git a/src/test/run-pass/packed-tuple-struct-size.rs b/src/test/run-pass/packed-tuple-struct-size.rs
index 059d92b477c..9036df0bbd1 100644
--- a/src/test/run-pass/packed-tuple-struct-size.rs
+++ b/src/test/run-pass/packed-tuple-struct-size.rs
@@ -19,7 +19,7 @@ struct S4(u8,[u8, .. 3]);
 struct S5(u8, u32);
 
 #[packed]
-struct S13_str(i64, f32, u8, ~str);
+struct S13(i64, f32, u8);
 
 enum Foo {
     Bar = 1,
@@ -37,8 +37,7 @@ pub fn main() {
 
     assert_eq!(mem::size_of::<S5>(), 5);
 
-    assert_eq!(mem::size_of::<S13_str>(),
-               13 + mem::size_of::<~str>());
+    assert_eq!(mem::size_of::<S13>(), 13);
 
     assert_eq!(mem::size_of::<S3_Foo>(),
                3 + mem::size_of::<Foo>());
diff --git a/src/test/run-pass/rec-auto.rs b/src/test/run-pass/rec-auto.rs
index b0cd9e60ed7..19b5268001d 100644
--- a/src/test/run-pass/rec-auto.rs
+++ b/src/test/run-pass/rec-auto.rs
@@ -14,10 +14,10 @@
 
 // Issue #50.
 
-struct X { foo: ~str, bar: ~str }
+struct X { foo: StrBuf, bar: StrBuf }
 
 pub fn main() {
-    let x = X {foo: "hello".to_owned(), bar: "world".to_owned()};
+    let x = X {foo: "hello".to_strbuf(), bar: "world".to_strbuf()};
     println!("{}", x.foo.clone());
     println!("{}", x.bar.clone());
 }
diff --git a/src/test/run-pass/reexported-static-methods-cross-crate.rs b/src/test/run-pass/reexported-static-methods-cross-crate.rs
index 213665245a8..17ed80da03c 100644
--- a/src/test/run-pass/reexported-static-methods-cross-crate.rs
+++ b/src/test/run-pass/reexported-static-methods-cross-crate.rs
@@ -20,5 +20,5 @@ pub fn main() {
     assert_eq!(42, Foo::foo());
     assert_eq!(84, Baz::bar());
     assert!(Boz::boz(1));
-    assert_eq!("bort()".to_owned(), Bort::bort());
+    assert_eq!("bort()".to_strbuf(), Bort::bort());
 }
diff --git a/src/test/run-pass/reflect-visit-type.rs b/src/test/run-pass/reflect-visit-type.rs
index a131b21957d..d05bc560088 100644
--- a/src/test/run-pass/reflect-visit-type.rs
+++ b/src/test/run-pass/reflect-visit-type.rs
@@ -13,37 +13,37 @@
 use std::intrinsics::{TyDesc, get_tydesc, visit_tydesc, TyVisitor, Disr, Opaque};
 
 struct MyVisitor {
-    types: Vec<~str> ,
+    types: Vec<StrBuf> ,
 }
 
 impl TyVisitor for MyVisitor {
     fn visit_bot(&mut self) -> bool {
-        self.types.push("bot".to_owned());
+        self.types.push("bot".to_strbuf());
         println!("visited bot type");
         true
     }
     fn visit_nil(&mut self) -> bool {
-        self.types.push("nil".to_owned());
+        self.types.push("nil".to_strbuf());
         println!("visited nil type");
         true
     }
     fn visit_bool(&mut self) -> bool {
-        self.types.push("bool".to_owned());
+        self.types.push("bool".to_strbuf());
         println!("visited bool type");
         true
     }
     fn visit_int(&mut self) -> bool {
-        self.types.push("int".to_owned());
+        self.types.push("int".to_strbuf());
         println!("visited int type");
         true
     }
     fn visit_i8(&mut self) -> bool {
-        self.types.push("i8".to_owned());
+        self.types.push("i8".to_strbuf());
         println!("visited i8 type");
         true
     }
     fn visit_i16(&mut self) -> bool {
-        self.types.push("i16".to_owned());
+        self.types.push("i16".to_strbuf());
         println!("visited i16 type");
         true
     }
@@ -76,9 +76,9 @@ impl TyVisitor for MyVisitor {
 
     fn visit_evec_box(&mut self, _mtbl: uint, _inner: *TyDesc) -> bool { true }
     fn visit_evec_uniq(&mut self, _mtbl: uint, inner: *TyDesc) -> bool {
-        self.types.push("[".to_owned());
+        self.types.push("[".to_strbuf());
         unsafe { visit_tydesc(inner, &mut *self as &mut TyVisitor); }
-        self.types.push("]".to_owned());
+        self.types.push("]".to_strbuf());
         true
     }
     fn visit_evec_slice(&mut self, _mtbl: uint, _inner: *TyDesc) -> bool { true }
@@ -155,7 +155,7 @@ pub fn main() {
         println!("type: {}", (*s).clone());
     }
 
-    let vec_types: Vec<~str> = v.types.clone().move_iter().collect();
-    assert_eq!(vec_types, vec!("bool".to_owned(), "int".to_owned(),
-                               "i8".to_owned(), "i16".to_owned()));
+    let vec_types: Vec<StrBuf> = v.types.clone().move_iter().collect();
+    assert_eq!(vec_types, vec!("bool".to_strbuf(), "int".to_strbuf(),
+                               "i8".to_strbuf(), "i16".to_strbuf()));
 }
diff --git a/src/test/run-pass/repeated-vector-syntax.rs b/src/test/run-pass/repeated-vector-syntax.rs
index 9538a097ab4..38f0f12267b 100644
--- a/src/test/run-pass/repeated-vector-syntax.rs
+++ b/src/test/run-pass/repeated-vector-syntax.rs
@@ -10,11 +10,6 @@
 
 #![feature(managed_boxes)]
 
-#[deriving(Clone)]
-struct Foo {
-    a: ~str,
-}
-
 pub fn main() {
     let x = [ [true], ..512 ];
     let y = [ 0, ..1 ];
diff --git a/src/test/run-pass/ret-bang.rs b/src/test/run-pass/ret-bang.rs
index 23b40972cde..fab8998afbe 100644
--- a/src/test/run-pass/ret-bang.rs
+++ b/src/test/run-pass/ret-bang.rs
@@ -11,10 +11,14 @@
 
 
 
-fn my_err(s: ~str) -> ! { println!("{:?}", s); fail!(); }
+fn my_err(s: StrBuf) -> ! { println!("{}", s); fail!(); }
 
 fn okay(i: uint) -> int {
-    if i == 3u { my_err("I don't like three".to_owned()); } else { return 42; }
+    if i == 3u {
+        my_err("I don't like three".to_strbuf());
+    } else {
+        return 42;
+    }
 }
 
 pub fn main() { okay(4u); }
diff --git a/src/test/run-pass/send_str_treemap.rs b/src/test/run-pass/send_str_treemap.rs
index e4a935eae7f..b6dcf06cae0 100644
--- a/src/test/run-pass/send_str_treemap.rs
+++ b/src/test/run-pass/send_str_treemap.rs
@@ -61,8 +61,8 @@ pub fn main() {
     assert_eq!(map.find(&Owned("def".to_owned())), Some(&d));
 
     assert!(map.pop(&Slice("foo")).is_some());
-    assert_eq!(map.move_iter().map(|(k, v)| k.to_str() + v.to_str())
-                              .collect::<Vec<~str>>()
+    assert_eq!(map.move_iter().map(|(k, v)| format_strbuf!("{}{}", k, v))
+                              .collect::<Vec<StrBuf>>()
                               .concat(),
                "abc50bcd51cde52def53".to_owned());
 }
diff --git a/src/test/run-pass/shape_intrinsic_tag_then_rec.rs b/src/test/run-pass/shape_intrinsic_tag_then_rec.rs
index e0a0a7357fc..7f5e92e71f2 100644
--- a/src/test/run-pass/shape_intrinsic_tag_then_rec.rs
+++ b/src/test/run-pass/shape_intrinsic_tag_then_rec.rs
@@ -41,7 +41,7 @@ type ty_ = uint;
 #[deriving(Clone)]
 struct Path_ {
     global: bool,
-    idents: Vec<~str> ,
+    idents: Vec<StrBuf> ,
     types: Vec<@ty>,
 }
 
@@ -59,7 +59,7 @@ pub fn main() {
     let t: @ty = @Spanned { data: 3u, span: sp };
     let p_: Path_ = Path_ {
         global: true,
-        idents: vec!("hi".to_owned()),
+        idents: vec!("hi".to_strbuf()),
         types: vec!(t),
     };
     let p: path = Spanned { data: p_, span: sp };
diff --git a/src/test/run-pass/spawn-fn.rs b/src/test/run-pass/spawn-fn.rs
index 17427be0597..dff99cbe366 100644
--- a/src/test/run-pass/spawn-fn.rs
+++ b/src/test/run-pass/spawn-fn.rs
@@ -10,15 +10,19 @@
 
 use std::task;
 
-fn x(s: ~str, n: int) {
+fn x(s: StrBuf, n: int) {
     println!("{:?}", s);
     println!("{:?}", n);
 }
 
 pub fn main() {
-    task::spawn(proc() x("hello from first spawned fn".to_owned(), 65) );
-    task::spawn(proc() x("hello from second spawned fn".to_owned(), 66) );
-    task::spawn(proc() x("hello from third spawned fn".to_owned(), 67) );
+    task::spawn(proc() x("hello from first spawned fn".to_strbuf(), 65) );
+    task::spawn(proc() x("hello from second spawned fn".to_strbuf(), 66) );
+    task::spawn(proc() x("hello from third spawned fn".to_strbuf(), 67) );
     let mut i: int = 30;
-    while i > 0 { i = i - 1; println!("parent sleeping"); task::deschedule(); }
+    while i > 0 {
+        i = i - 1;
+        println!("parent sleeping");
+        task::deschedule();
+    }
 }
diff --git a/src/test/run-pass/spawn-types.rs b/src/test/run-pass/spawn-types.rs
index 830dce1d3cb..b2fc1d272e8 100644
--- a/src/test/run-pass/spawn-types.rs
+++ b/src/test/run-pass/spawn-types.rs
@@ -18,11 +18,11 @@ use std::task;
 
 type ctx = Sender<int>;
 
-fn iotask(_tx: &ctx, ip: ~str) {
-    assert_eq!(ip, "localhost".to_owned());
+fn iotask(_tx: &ctx, ip: StrBuf) {
+    assert_eq!(ip, "localhost".to_strbuf());
 }
 
 pub fn main() {
     let (tx, _rx) = channel::<int>();
-    task::spawn(proc() iotask(&tx, "localhost".to_owned()) );
+    task::spawn(proc() iotask(&tx, "localhost".to_strbuf()) );
 }
diff --git a/src/test/run-pass/static-impl.rs b/src/test/run-pass/static-impl.rs
index 9eb04d5dac1..2bf3510bce1 100644
--- a/src/test/run-pass/static-impl.rs
+++ b/src/test/run-pass/static-impl.rs
@@ -21,16 +21,18 @@ mod a {
 
 mod b {
     use plus;
-    impl plus for ~str { fn plus(&self) -> int { 200 } }
+    impl plus for StrBuf { fn plus(&self) -> int { 200 } }
 }
 
 trait uint_utils {
-    fn str(&self) -> ~str;
+    fn str(&self) -> StrBuf;
     fn multi(&self, f: |uint|);
 }
 
 impl uint_utils for uint {
-    fn str(&self) -> ~str { self.to_str() }
+    fn str(&self) -> StrBuf {
+        self.to_str().to_strbuf()
+    }
     fn multi(&self, f: |uint|) {
         let mut c = 0u;
         while c < *self { f(c); c += 1u; }
@@ -57,9 +59,9 @@ impl<T> vec_utils<T> for Vec<T> {
 
 pub fn main() {
     assert_eq!(10u.plus(), 30);
-    assert_eq!(("hi".to_owned()).plus(), 200);
+    assert_eq!(("hi".to_strbuf()).plus(), 200);
 
-    assert_eq!((vec!(1)).length_().str(), "1".to_owned());
+    assert_eq!((vec!(1)).length_().str(), "1".to_strbuf());
     let vect = vec!(3, 4).map_(|a| *a + 4);
     assert_eq!(*vect.get(0), 7);
     let vect = (vec!(3, 4)).map_::<uint>(|a| *a as uint + 4u);
diff --git a/src/test/run-pass/static-method-xcrate.rs b/src/test/run-pass/static-method-xcrate.rs
index 3c482d2f91b..7cf1a15ab3e 100644
--- a/src/test/run-pass/static-method-xcrate.rs
+++ b/src/test/run-pass/static-method-xcrate.rs
@@ -15,8 +15,8 @@ extern crate static_methods_crate;
 use static_methods_crate::read;
 
 pub fn main() {
-    let result: int = read("5".to_owned());
+    let result: int = read("5".to_strbuf());
     assert_eq!(result, 5);
-    assert_eq!(read::readMaybe("false".to_owned()), Some(false));
-    assert_eq!(read::readMaybe("foo".to_owned()), None::<bool>);
+    assert_eq!(read::readMaybe("false".to_strbuf()), Some(false));
+    assert_eq!(read::readMaybe("foo".to_strbuf()), None::<bool>);
 }
diff --git a/src/test/run-pass/str-concat.rs b/src/test/run-pass/str-concat.rs
index 7fcf54bf26b..cecde7f8838 100644
--- a/src/test/run-pass/str-concat.rs
+++ b/src/test/run-pass/str-concat.rs
@@ -12,9 +12,9 @@
 
 
 pub fn main() {
-    let a: ~str = "hello".to_owned();
-    let b: ~str = "world".to_owned();
-    let s: ~str = a + b;
+    let a: StrBuf = "hello".to_strbuf();
+    let b: StrBuf = "world".to_strbuf();
+    let s: StrBuf = format_strbuf!("{}{}", a, b);
     println!("{}", s.clone());
-    assert_eq!(s[9], 'd' as u8);
+    assert_eq!(s.as_slice()[9], 'd' as u8);
 }
diff --git a/src/test/run-pass/str-multiline.rs b/src/test/run-pass/str-multiline.rs
index fd74237c50d..e42c89e67f4 100644
--- a/src/test/run-pass/str-multiline.rs
+++ b/src/test/run-pass/str-multiline.rs
@@ -9,13 +9,13 @@
 // except according to those terms.
 
 pub fn main() {
-    let a: ~str = "this \
-is a test".to_owned();
-    let b: ~str =
+    let a: StrBuf = "this \
+is a test".to_strbuf();
+    let b: StrBuf =
         "this \
               is \
               another \
-              test".to_owned();
-    assert_eq!(a, "this is a test".to_owned());
-    assert_eq!(b, "this is another test".to_owned());
+              test".to_strbuf();
+    assert_eq!(a, "this is a test".to_strbuf());
+    assert_eq!(b, "this is another test".to_strbuf());
 }
diff --git a/src/test/run-pass/string-self-append.rs b/src/test/run-pass/string-self-append.rs
index 8a5d2d83ac6..619ee761e9c 100644
--- a/src/test/run-pass/string-self-append.rs
+++ b/src/test/run-pass/string-self-append.rs
@@ -10,13 +10,13 @@
 
 pub fn main() {
     // Make sure we properly handle repeated self-appends.
-    let mut a: ~str = "A".to_owned();
+    let mut a: StrBuf = "A".to_strbuf();
     let mut i = 20;
     let mut expected_len = 1u;
     while i > 0 {
         println!("{}", a.len());
         assert_eq!(a.len(), expected_len);
-        a = a + a; // FIXME(#3387)---can't write a += a
+        a = format_strbuf!("{}{}", a, a);
         i -= 1;
         expected_len *= 2u;
     }
diff --git a/src/test/run-pass/struct-literal-dtor.rs b/src/test/run-pass/struct-literal-dtor.rs
index d4c7f951b4e..6f1eec8346a 100644
--- a/src/test/run-pass/struct-literal-dtor.rs
+++ b/src/test/run-pass/struct-literal-dtor.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 struct foo {
-    x: ~str,
+    x: StrBuf,
 }
 
 impl Drop for foo {
@@ -19,5 +19,7 @@ impl Drop for foo {
 }
 
 pub fn main() {
-    let _z = foo { x: "Hello".to_owned() };
+    let _z = foo {
+        x: "Hello".to_strbuf()
+    };
 }
diff --git a/src/test/run-pass/struct-order-of-eval-1.rs b/src/test/run-pass/struct-order-of-eval-1.rs
index cba4d337f29..e48ad05ef58 100644
--- a/src/test/run-pass/struct-order-of-eval-1.rs
+++ b/src/test/run-pass/struct-order-of-eval-1.rs
@@ -8,9 +8,15 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-struct S { f0: ~str, f1: int }
+struct S { f0: StrBuf, f1: int }
 
 pub fn main() {
-    let s = "Hello, world!".to_owned();
-    let _s = S { f0: s.to_owned(), ..S { f0: s, f1: 23 } };
+    let s = "Hello, world!".to_strbuf();
+    let _s = S {
+        f0: s.to_strbuf(),
+        ..S {
+            f0: s,
+            f1: 23
+        }
+    };
 }
diff --git a/src/test/run-pass/struct-order-of-eval-2.rs b/src/test/run-pass/struct-order-of-eval-2.rs
index d9325238178..9b2414325a5 100644
--- a/src/test/run-pass/struct-order-of-eval-2.rs
+++ b/src/test/run-pass/struct-order-of-eval-2.rs
@@ -8,9 +8,15 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-struct S { f0: ~str, f1: ~str }
+struct S {
+    f0: StrBuf,
+    f1: StrBuf,
+}
 
 pub fn main() {
-    let s = "Hello, world!".to_owned();
-    let _s = S { f1: s.to_owned(), f0: s };
+    let s = "Hello, world!".to_strbuf();
+    let _s = S {
+        f1: s.to_strbuf(),
+        f0: s
+    };
 }
diff --git a/src/test/run-pass/swap-overlapping.rs b/src/test/run-pass/swap-overlapping.rs
index 2e10c934778..706f5787c4e 100644
--- a/src/test/run-pass/swap-overlapping.rs
+++ b/src/test/run-pass/swap-overlapping.rs
@@ -15,7 +15,7 @@ use std::ptr;
 pub fn main() {
     let mut test = TestDescAndFn {
         desc: TestDesc {
-            name: DynTestName("test".to_owned()),
+            name: DynTestName("test".to_strbuf()),
             should_fail: false
         },
         testfn: DynTestFn(proc() ()),
@@ -30,7 +30,7 @@ fn do_swap(test: &mut TestDescAndFn) {
 }
 
 pub enum TestName {
-    DynTestName(~str)
+    DynTestName(StrBuf)
 }
 
 pub enum TestFn {
diff --git a/src/test/run-pass/syntax-extension-source-utils.rs b/src/test/run-pass/syntax-extension-source-utils.rs
index a50c447f0eb..017b17d0e9c 100644
--- a/src/test/run-pass/syntax-extension-source-utils.rs
+++ b/src/test/run-pass/syntax-extension-source-utils.rs
@@ -15,7 +15,7 @@
 
 pub mod m1 {
     pub mod m2 {
-        pub fn where_am_i() -> ~str { (module_path!()).to_owned() }
+        pub fn where_am_i() -> StrBuf { (module_path!()).to_strbuf() }
     }
 }
 
@@ -26,16 +26,19 @@ pub fn main() {
     //assert!((col!() == 11));
     assert_eq!(indirect_line!(), 27);
     assert!((file!().to_owned().ends_with("syntax-extension-source-utils.rs")));
-    assert_eq!(stringify!((2*3) + 5).to_owned(), "( 2 * 3 ) + 5".to_owned());
-    assert!(include!("syntax-extension-source-utils-files/includeme.fragment").to_owned()
-           == "victory robot 6".to_owned());
+    assert_eq!(stringify!((2*3) + 5).to_strbuf(), "( 2 * 3 ) + 5".to_strbuf());
+    assert!(include!("syntax-extension-source-utils-files/includeme.\
+                      fragment").to_strbuf()
+           == "victory robot 6".to_strbuf());
 
     assert!(
-        include_str!("syntax-extension-source-utils-files/includeme.fragment").to_owned()
+        include_str!("syntax-extension-source-utils-files/includeme.\
+                      fragment").to_strbuf()
+        .as_slice()
         .starts_with("/* this is for "));
     assert!(
         include_bin!("syntax-extension-source-utils-files/includeme.fragment")
         [1] == (42 as u8)); // '*'
     // The Windows tests are wrapped in an extra module for some reason
-    assert!((m1::m2::where_am_i().ends_with("m1::m2")));
+    assert!((m1::m2::where_am_i().as_slice().ends_with("m1::m2")));
 }
diff --git a/src/test/run-pass/tag-variant-disr-val.rs b/src/test/run-pass/tag-variant-disr-val.rs
index e31b289f541..40c5f623986 100644
--- a/src/test/run-pass/tag-variant-disr-val.rs
+++ b/src/test/run-pass/tag-variant-disr-val.rs
@@ -27,17 +27,17 @@ impl Eq for color {
 }
 
 pub fn main() {
-    test_color(red, 0xff0000, "red".to_owned());
-    test_color(green, 0x00ff00, "green".to_owned());
-    test_color(blue, 0x0000ff, "blue".to_owned());
-    test_color(black, 0x000000, "black".to_owned());
-    test_color(white, 0xFFFFFF, "white".to_owned());
-    test_color(imaginary, -1, "imaginary".to_owned());
-    test_color(purple, 2, "purple".to_owned());
-    test_color(orange, 4, "orange".to_owned());
+    test_color(red, 0xff0000, "red".to_strbuf());
+    test_color(green, 0x00ff00, "green".to_strbuf());
+    test_color(blue, 0x0000ff, "blue".to_strbuf());
+    test_color(black, 0x000000, "black".to_strbuf());
+    test_color(white, 0xFFFFFF, "white".to_strbuf());
+    test_color(imaginary, -1, "imaginary".to_strbuf());
+    test_color(purple, 2, "purple".to_strbuf());
+    test_color(orange, 4, "orange".to_strbuf());
 }
 
-fn test_color(color: color, val: int, name: ~str) {
+fn test_color(color: color, val: int, name: StrBuf) {
     //assert!(unsafe::transmute(color) == val);
     assert_eq!(color as int, val);
     assert_eq!(color as f64, val as f64);
@@ -45,27 +45,27 @@ fn test_color(color: color, val: int, name: ~str) {
     assert!(get_color_if(color) == name);
 }
 
-fn get_color_alt(color: color) -> ~str {
+fn get_color_alt(color: color) -> StrBuf {
     match color {
-      red => {"red".to_owned()}
-      green => {"green".to_owned()}
-      blue => {"blue".to_owned()}
-      black => {"black".to_owned()}
-      white => {"white".to_owned()}
-      imaginary => {"imaginary".to_owned()}
-      purple => {"purple".to_owned()}
-      orange => {"orange".to_owned()}
+      red => {"red".to_strbuf()}
+      green => {"green".to_strbuf()}
+      blue => {"blue".to_strbuf()}
+      black => {"black".to_strbuf()}
+      white => {"white".to_strbuf()}
+      imaginary => {"imaginary".to_strbuf()}
+      purple => {"purple".to_strbuf()}
+      orange => {"orange".to_strbuf()}
     }
 }
 
-fn get_color_if(color: color) -> ~str {
-    if color == red {"red".to_owned()}
-    else if color == green {"green".to_owned()}
-    else if color == blue {"blue".to_owned()}
-    else if color == black {"black".to_owned()}
-    else if color == white {"white".to_owned()}
-    else if color == imaginary {"imaginary".to_owned()}
-    else if color == purple {"purple".to_owned()}
-    else if color == orange {"orange".to_owned()}
-    else {"unknown".to_owned()}
+fn get_color_if(color: color) -> StrBuf {
+    if color == red {"red".to_strbuf()}
+    else if color == green {"green".to_strbuf()}
+    else if color == blue {"blue".to_strbuf()}
+    else if color == black {"black".to_strbuf()}
+    else if color == white {"white".to_strbuf()}
+    else if color == imaginary {"imaginary".to_strbuf()}
+    else if color == purple {"purple".to_strbuf()}
+    else if color == orange {"orange".to_strbuf()}
+    else {"unknown".to_strbuf()}
 }
diff --git a/src/test/run-pass/tail-call-arg-leak.rs b/src/test/run-pass/tail-call-arg-leak.rs
index fab5bb02afa..e90fe27823b 100644
--- a/src/test/run-pass/tail-call-arg-leak.rs
+++ b/src/test/run-pass/tail-call-arg-leak.rs
@@ -12,6 +12,8 @@
 
 
 // use of tail calls causes arg slot leaks, issue #160.
-fn inner(dummy: ~str, b: bool) { if b { return inner(dummy, false); } }
+fn inner(dummy: StrBuf, b: bool) { if b { return inner(dummy, false); } }
 
-pub fn main() { inner("hi".to_owned(), true); }
+pub fn main() {
+    inner("hi".to_strbuf(), true);
+}
diff --git a/src/test/run-pass/task-comm-10.rs b/src/test/run-pass/task-comm-10.rs
index 9bd5110cccf..b298f2edf01 100644
--- a/src/test/run-pass/task-comm-10.rs
+++ b/src/test/run-pass/task-comm-10.rs
@@ -11,18 +11,18 @@
 
 use std::task;
 
-fn start(tx: &Sender<Sender<~str>>) {
+fn start(tx: &Sender<Sender<StrBuf>>) {
     let (tx2, rx) = channel();
     tx.send(tx2);
 
     let mut a;
     let mut b;
     a = rx.recv();
-    assert!(a == "A".to_owned());
-    println!("{:?}", a);
+    assert!(a == "A".to_strbuf());
+    println!("{}", a);
     b = rx.recv();
-    assert!(b == "B".to_owned());
-    println!("{:?}", b);
+    assert!(b == "B".to_strbuf());
+    println!("{}", b);
 }
 
 pub fn main() {
@@ -30,7 +30,7 @@ pub fn main() {
     let _child = task::spawn(proc() { start(&tx) });
 
     let mut c = rx.recv();
-    c.send("A".to_owned());
-    c.send("B".to_owned());
+    c.send("A".to_strbuf());
+    c.send("B".to_strbuf());
     task::deschedule();
 }
diff --git a/src/test/run-pass/task-life-0.rs b/src/test/run-pass/task-life-0.rs
index b0974676d07..378effa8a18 100644
--- a/src/test/run-pass/task-life-0.rs
+++ b/src/test/run-pass/task-life-0.rs
@@ -11,9 +11,9 @@
 use std::task;
 
 pub fn main() {
-    task::spawn(proc() child("Hello".to_owned()) );
+    task::spawn(proc() child("Hello".to_strbuf()) );
 }
 
-fn child(_s: ~str) {
+fn child(_s: StrBuf) {
 
 }
diff --git a/src/test/run-pass/trait-bounds-in-arc.rs b/src/test/run-pass/trait-bounds-in-arc.rs
index 98dd3772a4f..b5ed021ec6a 100644
--- a/src/test/run-pass/trait-bounds-in-arc.rs
+++ b/src/test/run-pass/trait-bounds-in-arc.rs
@@ -25,43 +25,54 @@ trait Pet {
 
 struct Catte {
     num_whiskers: uint,
-    name: ~str,
+    name: StrBuf,
 }
 
 struct Dogge {
     bark_decibels: uint,
     tricks_known: uint,
-    name: ~str,
+    name: StrBuf,
 }
 
 struct Goldfyshe {
     swim_speed: uint,
-    name: ~str,
+    name: StrBuf,
 }
 
 impl Pet for Catte {
-    fn name(&self, blk: |&str|) { blk(self.name) }
+    fn name(&self, blk: |&str|) { blk(self.name.as_slice()) }
     fn num_legs(&self) -> uint { 4 }
     fn of_good_pedigree(&self) -> bool { self.num_whiskers >= 4 }
 }
 impl Pet for Dogge {
-    fn name(&self, blk: |&str|) { blk(self.name) }
+    fn name(&self, blk: |&str|) { blk(self.name.as_slice()) }
     fn num_legs(&self) -> uint { 4 }
     fn of_good_pedigree(&self) -> bool {
         self.bark_decibels < 70 || self.tricks_known > 20
     }
 }
 impl Pet for Goldfyshe {
-    fn name(&self, blk: |&str|) { blk(self.name) }
+    fn name(&self, blk: |&str|) { blk(self.name.as_slice()) }
     fn num_legs(&self) -> uint { 0 }
     fn of_good_pedigree(&self) -> bool { self.swim_speed >= 500 }
 }
 
 pub fn main() {
-    let catte = Catte { num_whiskers: 7, name: "alonzo_church".to_owned() };
-    let dogge1 = Dogge { bark_decibels: 100, tricks_known: 42, name: "alan_turing".to_owned() };
-    let dogge2 = Dogge { bark_decibels: 55,  tricks_known: 11, name: "albert_einstein".to_owned() };
-    let fishe = Goldfyshe { swim_speed: 998, name: "alec_guinness".to_owned() };
+    let catte = Catte { num_whiskers: 7, name: "alonzo_church".to_strbuf() };
+    let dogge1 = Dogge {
+        bark_decibels: 100,
+        tricks_known: 42,
+        name: "alan_turing".to_strbuf(),
+    };
+    let dogge2 = Dogge {
+        bark_decibels: 55,
+        tricks_known: 11,
+        name: "albert_einstein".to_strbuf(),
+    };
+    let fishe = Goldfyshe {
+        swim_speed: 998,
+        name: "alec_guinness".to_strbuf(),
+    };
     let arc = Arc::new(vec!(box catte  as Box<Pet:Share+Send>,
                             box dogge1 as Box<Pet:Share+Send>,
                             box fishe  as Box<Pet:Share+Send>,
diff --git a/src/test/run-pass/trait-cast.rs b/src/test/run-pass/trait-cast.rs
index 3d303bf1e5b..d6aaefe868f 100644
--- a/src/test/run-pass/trait-cast.rs
+++ b/src/test/run-pass/trait-cast.rs
@@ -22,33 +22,38 @@ struct TreeR {
 }
 
 trait to_str {
-    fn to_str_(&self) -> ~str;
+    fn to_str_(&self) -> StrBuf;
 }
 
 impl<T:to_str> to_str for Option<T> {
-    fn to_str_(&self) -> ~str {
+    fn to_str_(&self) -> StrBuf {
         match *self {
-          None => { "none".to_owned() }
-          Some(ref t) => { "some(".to_owned() + t.to_str_() + ")".to_owned() }
+          None => { "none".to_strbuf() }
+          Some(ref t) => format_strbuf!("some({})", t.to_str_()),
         }
     }
 }
 
 impl to_str for int {
-    fn to_str_(&self) -> ~str { self.to_str() }
+    fn to_str_(&self) -> StrBuf {
+        self.to_str().to_strbuf()
+    }
 }
 
 impl to_str for Tree {
-    fn to_str_(&self) -> ~str {
+    fn to_str_(&self) -> StrBuf {
         let Tree(t) = *self;
         let this = t.borrow();
         let (l, r) = (this.left, this.right);
         let val = &this.val;
-        format!("[{}, {}, {}]", val.to_str_(), l.to_str_(), r.to_str_())
+        format_strbuf!("[{}, {}, {}]",
+                       val.to_str_(),
+                       l.to_str_(),
+                       r.to_str_())
     }
 }
 
-fn foo<T:to_str>(x: T) -> ~str { x.to_str_() }
+fn foo<T:to_str>(x: T) -> StrBuf { x.to_str_() }
 
 pub fn main() {
     let t1 = Tree(@RefCell::new(TreeR{left: None,
@@ -57,7 +62,8 @@ pub fn main() {
     let t2 = Tree(@RefCell::new(TreeR{left: Some(t1),
                                       right: Some(t1),
                                       val: box 2 as Box<to_str:Send>}));
-    let expected = "[2, some([1, none, none]), some([1, none, none])]".to_owned();
+    let expected =
+        "[2, some([1, none, none]), some([1, none, none])]".to_strbuf();
     assert!(t2.to_str_() == expected);
     assert!(foo(t2) == expected);
 
diff --git a/src/test/run-pass/trait-generic.rs b/src/test/run-pass/trait-generic.rs
index 4b745ba5e3e..269c1d4094e 100644
--- a/src/test/run-pass/trait-generic.rs
+++ b/src/test/run-pass/trait-generic.rs
@@ -11,16 +11,16 @@
 
 
 trait to_str {
-    fn to_string(&self) -> ~str;
+    fn to_string(&self) -> StrBuf;
 }
 impl to_str for int {
-    fn to_string(&self) -> ~str { self.to_str() }
+    fn to_string(&self) -> StrBuf { self.to_str().to_strbuf() }
 }
-impl to_str for ~str {
-    fn to_string(&self) -> ~str { self.clone() }
+impl to_str for StrBuf {
+    fn to_string(&self) -> StrBuf { self.clone() }
 }
 impl to_str for () {
-    fn to_string(&self) -> ~str { "()".to_owned() }
+    fn to_string(&self) -> StrBuf { "()".to_strbuf() }
 }
 
 trait map<T> {
@@ -37,17 +37,17 @@ impl<T> map<T> for Vec<T> {
     }
 }
 
-fn foo<U, T: map<U>>(x: T) -> Vec<~str> {
-    x.map(|_e| "hi".to_owned() )
+fn foo<U, T: map<U>>(x: T) -> Vec<StrBuf> {
+    x.map(|_e| "hi".to_strbuf() )
 }
-fn bar<U:to_str,T:map<U>>(x: T) -> Vec<~str> {
+fn bar<U:to_str,T:map<U>>(x: T) -> Vec<StrBuf> {
     x.map(|_e| _e.to_string() )
 }
 
 pub fn main() {
-    assert_eq!(foo(vec!(1)), vec!("hi".to_owned()));
-    assert_eq!(bar::<int, Vec<int> >(vec!(4, 5)), vec!("4".to_owned(), "5".to_owned()));
-    assert_eq!(bar::<~str, Vec<~str> >(vec!("x".to_owned(), "y".to_owned())),
-               vec!("x".to_owned(), "y".to_owned()));
-    assert_eq!(bar::<(), Vec<()>>(vec!(())), vec!("()".to_owned()));
+    assert_eq!(foo(vec!(1)), vec!("hi".to_strbuf()));
+    assert_eq!(bar::<int, Vec<int> >(vec!(4, 5)), vec!("4".to_strbuf(), "5".to_strbuf()));
+    assert_eq!(bar::<StrBuf, Vec<StrBuf> >(vec!("x".to_strbuf(), "y".to_strbuf())),
+               vec!("x".to_strbuf(), "y".to_strbuf()));
+    assert_eq!(bar::<(), Vec<()>>(vec!(())), vec!("()".to_strbuf()));
 }
diff --git a/src/test/run-pass/trait-to-str.rs b/src/test/run-pass/trait-to-str.rs
index 794f810165d..5d22199e4a5 100644
--- a/src/test/run-pass/trait-to-str.rs
+++ b/src/test/run-pass/trait-to-str.rs
@@ -11,30 +11,34 @@
 
 
 trait to_str {
-    fn to_string(&self) -> ~str;
+    fn to_string(&self) -> StrBuf;
 }
 
 impl to_str for int {
-    fn to_string(&self) -> ~str { self.to_str() }
+    fn to_string(&self) -> StrBuf { self.to_str().to_strbuf() }
 }
 
 impl<T:to_str> to_str for Vec<T> {
-    fn to_string(&self) -> ~str {
-        format!("[{}]", self.iter().map(|e| e.to_string()).collect::<Vec<~str>>().connect(", "))
+    fn to_string(&self) -> StrBuf {
+        format_strbuf!("[{}]",
+                       self.iter()
+                           .map(|e| e.to_string())
+                           .collect::<Vec<StrBuf>>()
+                           .connect(", "))
     }
 }
 
 pub fn main() {
-    assert!(1.to_string() == "1".to_owned());
-    assert!((vec!(2, 3, 4)).to_string() == "[2, 3, 4]".to_owned());
+    assert!(1.to_string() == "1".to_strbuf());
+    assert!((vec!(2, 3, 4)).to_string() == "[2, 3, 4]".to_strbuf());
 
-    fn indirect<T:to_str>(x: T) -> ~str {
-        x.to_string() + "!"
+    fn indirect<T:to_str>(x: T) -> StrBuf {
+        format_strbuf!("{}!", x.to_string())
     }
-    assert!(indirect(vec!(10, 20)) == "[10, 20]!".to_owned());
+    assert!(indirect(vec!(10, 20)) == "[10, 20]!".to_strbuf());
 
-    fn indirect2<T:to_str>(x: T) -> ~str {
+    fn indirect2<T:to_str>(x: T) -> StrBuf {
         indirect(x)
     }
-    assert!(indirect2(vec!(1)) == "[1]!".to_owned());
+    assert!(indirect2(vec!(1)) == "[1]!".to_strbuf());
 }
diff --git a/src/test/run-pass/traits-default-method-macro.rs b/src/test/run-pass/traits-default-method-macro.rs
index 2a60e774645..db5be5f938a 100644
--- a/src/test/run-pass/traits-default-method-macro.rs
+++ b/src/test/run-pass/traits-default-method-macro.rs
@@ -10,8 +10,8 @@
 
 
 trait Foo {
-    fn bar(&self) -> ~str {
-        format!("test")
+    fn bar(&self) -> StrBuf {
+        format_strbuf!("test")
     }
 }
 
@@ -24,5 +24,5 @@ impl Foo for Baz {
 
 pub fn main() {
     let q = Quux;
-    assert_eq!(q.bar(), "test".to_owned());
+    assert_eq!(q.bar(), "test".to_strbuf());
 }
diff --git a/src/test/run-pass/utf8.rs b/src/test/run-pass/utf8.rs
index debb1c3812a..a12483c1d78 100644
--- a/src/test/run-pass/utf8.rs
+++ b/src/test/run-pass/utf8.rs
@@ -24,27 +24,27 @@ pub fn main() {
     assert_eq!(pi as int, '\u03a0' as int);
     assert_eq!('\x0a' as int, '\n' as int);
 
-    let bhutan: ~str = "འབྲུག་ཡུལ།".to_owned();
-    let japan: ~str = "日本".to_owned();
-    let uzbekistan: ~str = "Ўзбекистон".to_owned();
-    let austria: ~str = "Österreich".to_owned();
-
-    let bhutan_e: ~str =
-        "\u0f60\u0f56\u0fb2\u0f74\u0f42\u0f0b\u0f61\u0f74\u0f63\u0f0d".to_owned();
-    let japan_e: ~str = "\u65e5\u672c".to_owned();
-    let uzbekistan_e: ~str =
-        "\u040e\u0437\u0431\u0435\u043a\u0438\u0441\u0442\u043e\u043d".to_owned();
-    let austria_e: ~str = "\u00d6sterreich".to_owned();
+    let bhutan: StrBuf = "འབྲུག་ཡུལ།".to_strbuf();
+    let japan: StrBuf = "日本".to_strbuf();
+    let uzbekistan: StrBuf = "Ўзбекистон".to_strbuf();
+    let austria: StrBuf = "Österreich".to_strbuf();
+
+    let bhutan_e: StrBuf =
+        "\u0f60\u0f56\u0fb2\u0f74\u0f42\u0f0b\u0f61\u0f74\u0f63\u0f0d".to_strbuf();
+    let japan_e: StrBuf = "\u65e5\u672c".to_strbuf();
+    let uzbekistan_e: StrBuf =
+        "\u040e\u0437\u0431\u0435\u043a\u0438\u0441\u0442\u043e\u043d".to_strbuf();
+    let austria_e: StrBuf = "\u00d6sterreich".to_strbuf();
 
     let oo: char = 'Ö';
     assert_eq!(oo as int, 0xd6);
 
-    fn check_str_eq(a: ~str, b: ~str) {
+    fn check_str_eq(a: StrBuf, b: StrBuf) {
         let mut i: int = 0;
-        for ab in a.bytes() {
+        for ab in a.as_slice().bytes() {
             println!("{}", i);
             println!("{}", ab);
-            let bb: u8 = b[i as uint];
+            let bb: u8 = b.as_slice()[i as uint];
             println!("{}", bb);
             assert_eq!(ab, bb);
             i += 1;
diff --git a/src/test/run-pass/utf8_chars.rs b/src/test/run-pass/utf8_chars.rs
index a418cd0ae02..2e0e1af43b4 100644
--- a/src/test/run-pass/utf8_chars.rs
+++ b/src/test/run-pass/utf8_chars.rs
@@ -13,15 +13,15 @@ use std::str;
 pub fn main() {
     // Chars of 1, 2, 3, and 4 bytes
     let chs: Vec<char> = vec!('e', 'é', '€', '\U00010000');
-    let s: ~str = str::from_chars(chs.as_slice());
-    let schs: Vec<char> = s.chars().collect();
+    let s: StrBuf = str::from_chars(chs.as_slice()).to_strbuf();
+    let schs: Vec<char> = s.as_slice().chars().collect();
 
     assert!(s.len() == 10u);
-    assert!(s.char_len() == 4u);
+    assert!(s.as_slice().char_len() == 4u);
     assert!(schs.len() == 4u);
-    assert!(str::from_chars(schs.as_slice()) == s);
-    assert!(s.char_at(0u) == 'e');
-    assert!(s.char_at(1u) == 'é');
+    assert!(str::from_chars(schs.as_slice()).to_strbuf() == s);
+    assert!(s.as_slice().char_at(0u) == 'e');
+    assert!(s.as_slice().char_at(1u) == 'é');
 
     assert!((str::is_utf8(s.as_bytes())));
     // invalid prefix
diff --git a/src/test/run-pass/variant-attributes.rs b/src/test/run-pass/variant-attributes.rs
index 2b200c8af30..e26c592a064 100644
--- a/src/test/run-pass/variant-attributes.rs
+++ b/src/test/run-pass/variant-attributes.rs
@@ -34,6 +34,6 @@ enum crew_of_enterprise_d {
     geordi_la_forge,
 }
 
-fn boldly_go(_crew_member: crew_of_enterprise_d, _where: ~str) { }
+fn boldly_go(_crew_member: crew_of_enterprise_d, _where: StrBuf) { }
 
-pub fn main() { boldly_go(worf, "where no one has gone before".to_owned()); }
+pub fn main() { boldly_go(worf, "where no one has gone before".to_strbuf()); }
diff --git a/src/test/run-pass/vec-tail-matching.rs b/src/test/run-pass/vec-tail-matching.rs
index 0703955f211..8d2f29d9b09 100644
--- a/src/test/run-pass/vec-tail-matching.rs
+++ b/src/test/run-pass/vec-tail-matching.rs
@@ -10,29 +10,29 @@
 
 
 struct Foo {
-    string: ~str
+    string: StrBuf
 }
 
 pub fn main() {
     let x = [
-        Foo { string: "foo".to_owned() },
-        Foo { string: "bar".to_owned() },
-        Foo { string: "baz".to_owned() }
+        Foo { string: "foo".to_strbuf() },
+        Foo { string: "bar".to_strbuf() },
+        Foo { string: "baz".to_strbuf() }
     ];
     match x {
         [ref first, ..tail] => {
-            assert!(first.string == "foo".to_owned());
+            assert!(first.string == "foo".to_strbuf());
             assert_eq!(tail.len(), 2);
-            assert!(tail[0].string == "bar".to_owned());
-            assert!(tail[1].string == "baz".to_owned());
+            assert!(tail[0].string == "bar".to_strbuf());
+            assert!(tail[1].string == "baz".to_strbuf());
 
             match tail {
                 [Foo { .. }, _, Foo { .. }, .. _tail] => {
                     unreachable!();
                 }
                 [Foo { string: ref a }, Foo { string: ref b }] => {
-                    assert_eq!("bar", a.slice(0, a.len()));
-                    assert_eq!("baz", b.slice(0, b.len()));
+                    assert_eq!("bar", a.as_slice().slice(0, a.len()));
+                    assert_eq!("baz", b.as_slice().slice(0, b.len()));
                 }
                 _ => {
                     unreachable!();