]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/trait-static-method-overwriting.rs
cleanup: s/impl Copy/#[derive(Copy)]/g
[rust.git] / src / test / run-pass / trait-static-method-overwriting.rs
index 1f5c33e2bc0973b39194de1947ea8718542af101..a8cea24db0c0c15ef051de3e62be26e6a8c5c601 100644 (file)
@@ -1,6 +1,5 @@
-// xfail-fast
 
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
 //
 // except according to those terms.
 
 mod base {
-    use std::io;
-
     pub trait HasNew<T> {
-        fn new() -> T;
+        fn new() -> Self;
     }
 
     pub struct Foo {
@@ -23,7 +20,7 @@ pub struct Foo {
 
     impl ::base::HasNew<Foo> for Foo {
         fn new() -> Foo {
-            unsafe { println("Foo"); }
+            println!("Foo");
             Foo { dummy: () }
         }
     }
@@ -34,13 +31,13 @@ pub struct Bar {
 
     impl ::base::HasNew<Bar> for Bar {
         fn new() -> Bar {
-            unsafe { io::println("Bar"); }
+            println!("Bar");
             Bar { dummy: () }
         }
     }
 }
 
 pub fn main() {
-    let f: base::Foo = base::HasNew::new::<base::Foo, base::Foo>();
-    let b: base::Bar = base::HasNew::new::<base::Bar, base::Bar>();
+    let _f: base::Foo = base::HasNew::<base::Foo>::new();
+    let _b: base::Bar = base::HasNew::<base::Bar>::new();
 }