]> git.lizzy.rs Git - rust.git/blobdiff - src/test/compile-fail/moves-based-on-type-access-to-field.rs
Replace all ~"" with "".to_owned()
[rust.git] / src / test / compile-fail / moves-based-on-type-access-to-field.rs
index 657d5ad03e8a88aa2dac04b396f354fe3fa0c263..dc2cd22e632e05c6a25b771527f56efb3e65e20c 100644 (file)
@@ -16,13 +16,13 @@ fn consume(_s: ~str) {}
 fn touch<A>(_a: &A) {}
 
 fn f10() {
-    let x = Foo { f: ~"hi", y: 3 };
+    let x = Foo { f: "hi".to_owned(), y: 3 };
     consume(x.f);
     touch(&x.y); //~ ERROR use of partially moved value: `x`
 }
 
 fn f20() {
-    let x = vec!(~"hi");
+    let x = vec!("hi".to_owned());
     consume(x.move_iter().next().unwrap());
     touch(x.get(0)); //~ ERROR use of moved value: `x`
 }