]> 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 9565919a5d8c7f5cc8b945007b9287cb2e26dac8..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.
 //
@@ -12,7 +11,7 @@
 
 mod base {
     pub trait HasNew<T> {
-        static pure fn new() -> T;
+        fn new() -> Self;
     }
 
     pub struct Foo {
@@ -20,8 +19,8 @@ pub struct Foo {
     }
 
     impl ::base::HasNew<Foo> for Foo {
-        static pure fn new() -> Foo {
-                       unsafe { io::println("Foo"); }
+        fn new() -> Foo {
+            println!("Foo");
             Foo { dummy: () }
         }
     }
@@ -31,14 +30,14 @@ pub struct Bar {
     }
 
     impl ::base::HasNew<Bar> for Bar {
-        static pure fn new() -> Bar {
-                       unsafe { io::println("Bar"); }
+        fn new() -> 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();
 }