1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
trait Generator { fn create() -> u32; } struct Impl; impl Generator for Impl { fn create() -> u32 { 1 } } struct AnotherImpl; impl Generator for AnotherImpl { fn create() -> u32 { 2 } } fn main() { let cont: u32 = Generator::create(); //~ ERROR E0283 }