Skip to content

Instantly share code, notes, and snippets.

@DaGenix
Last active January 3, 2016 00:19
Show Gist options
  • Save DaGenix/8381853 to your computer and use it in GitHub Desktop.
Save DaGenix/8381853 to your computer and use it in GitHub Desktop.
Conflicting implementation bug (I think)
trait T1 { }
trait T2 { }
struct S1;
impl T1 for S1 { }
impl <S: T2> T1 for S { }
fn main() {}
@DaGenix
Copy link
Author

DaGenix commented Jan 12, 2014

test2.rs:9:1: 9:26 error: conflicting implementations for trait `T1`
test2.rs:9 impl <S: T2> T1 for S { }
           ^~~~~~~~~~~~~~~~~~~~~~~~~
test2.rs:7:1: 7:19 note: note conflicting implementation here
test2.rs:7 impl T1 for S1 { }
           ^~~~~~~~~~~~~~~~~~
test2.rs:7:1: 7:19 error: conflicting implementations for trait `T1`
test2.rs:7 impl T1 for S1 { }
           ^~~~~~~~~~~~~~~~~~
test2.rs:9:1: 9:26 note: note conflicting implementation here
test2.rs:9 impl <S: T2> T1 for S { }
           ^~~~~~~~~~~~~~~~~~~~~~~~~
test2.rs:7:1: 7:19 error: failed to find an implementation of trait T2 for S1
test2.rs:7 impl T1 for S1 { }
           ^~~~~~~~~~~~~~~~~~
task 'rustc' failed at 'explicit failure', /home/enix/code/rust/src/libsyntax/diagnostic.rs:41
task '<main>' failed at 'explicit failure', /home/enix/code/rust/src/librustc/lib.rs:453

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment