// except according to those terms.
mod a {
- pub trait Foo {
- static pub fn foo() -> Self;
- }
+ pub trait Foo {
+ fn foo() -> Self;
+ }
- impl Foo for int {
- static pub fn foo() -> int {
- 3
- }
- }
-
- impl Foo for uint {
- static pub fn foo() -> uint {
- 5u
- }
- }
+ impl Foo for int {
+ fn foo() -> int {
+ 3
+ }
+ }
+
+ impl Foo for uint {
+ fn foo() -> uint {
+ 5u
+ }
+ }
}
pub fn main() {
- let x: int = a::Foo::foo();
- let y: uint = a::Foo::foo();
- fail_unless!(x == 3);
- fail_unless!(y == 5);
+ let x: int = a::Foo::foo();
+ let y: uint = a::Foo::foo();
+ assert_eq!(x, 3);
+ assert_eq!(y, 5);
}
-