]> git.lizzy.rs Git - rust.git/blobdiff - src/test/compile-fail/disallowed-deconstructing-destructing-struct-let.rs
Replace all ~"" with "".to_owned()
[rust.git] / src / test / compile-fail / disallowed-deconstructing-destructing-struct-let.rs
index e550475d64f074c6ac4c5931cec5855356666205..40bb63907c9f16f20a1acbe7bce5a069e45a9389 100644 (file)
@@ -1,4 +1,3 @@
-// xfail-test #3024
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
@@ -14,18 +13,18 @@ struct X {
 }
 
 impl Drop for X {
-    fn drop(&self) {
-        error!("value: %s", self.x);
+    fn drop(&mut self) {
+        println!("value: {}", self.x);
     }
 }
 
 fn unwrap(x: X) -> ~str {
-    let X { x: y } = x; //~ ERROR cannot bind by-move within struct
+    let X { x: y } = x; //~ ERROR cannot move out of type
     y
 }
 
 fn main() {
-    let x = X { x: ~"hello" };
+    let x = X { x: "hello".to_owned() };
     let y = unwrap(x);
-    error!("contents: %s", y);
+    println!("contents: {}", y);
 }