]>
Commit | Line | Data |
---|---|---|
0731742a XL |
1 | // Test that two distinct impls which match subtypes of one another |
2 | // yield coherence errors (or not) depending on the variance. | |
3 | // | |
4 | // Note: This scenario is currently accepted, but as part of the | |
5 | // universe transition (#56105) may eventually become an error. | |
6 | ||
7 | // revisions: old re | |
74b04a01 | 8 | // check-pass |
0731742a | 9 | |
0731742a | 10 | trait TheTrait { |
74b04a01 | 11 | fn foo(&self) {} |
0731742a XL |
12 | } |
13 | ||
74b04a01 | 14 | impl TheTrait for for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {} |
0731742a XL |
15 | |
16 | impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 { | |
74b04a01 XL |
17 | //[re]~^ WARNING conflicting implementation |
18 | //[re]~^^ WARNING this was previously accepted by the compiler but is being phased out | |
19 | //[old]~^^^ WARNING conflicting implementation | |
20 | //[old]~^^^^ WARNING this was previously accepted by the compiler but is being phased out | |
0731742a XL |
21 | } |
22 | ||
74b04a01 | 23 | fn main() {} |