Created
February 12, 2014 14:17
-
-
Save k4nar/8956309 to your computer and use it in GitHub Desktop.
Calling trait's static function from trait's implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Foo { | |
fn foo() -> int { 10 } | |
} | |
struct FooStruct; | |
impl Foo for FooStruct { | |
fn bar(&self) { | |
println!("Foo : {}", Foo::foo()); | |
} | |
} | |
fn main() { | |
let foo = FooStruct; | |
foo.foobar(); | |
} | |
// testcase.rs:9:26: 9:34 error: cannot determine a type for this bounded type parameter: unconstrained type | |
// testcase.rs:9 println!("Foo : {}", Foo::foo()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment