1 This error occurs when the compiler doesn't have enough information
2 to unambiguously choose an implementation.
13 impl Generator for Impl {
14 fn create() -> u32 { 1 }
19 impl Generator for AnotherImpl {
20 fn create() -> u32 { 2 }
24 let cont: u32 = Generator::create();
25 // error, impossible to choose one of Generator trait implementation
26 // Should it be Impl or AnotherImpl, maybe something else?
30 To resolve this error use the concrete type:
39 impl Generator for AnotherImpl {
40 fn create() -> u32 { 2 }
44 let gen1 = AnotherImpl::create();
46 // if there are multiple methods with same name (different traits)
47 let gen2 = <AnotherImpl as Generator>::create();