2015-02-12 12:42:02 -05:00
|
|
|
// Test that two distinct impls which match subtypes of one another
|
|
|
|
// yield coherence errors (or not) depending on the variance.
|
2019-02-20 12:52:23 -05:00
|
|
|
//
|
|
|
|
// Note: This scenario is currently accepted, but as part of the
|
|
|
|
// universe transition (#56105) may eventually become an error.
|
2015-02-12 12:42:02 -05:00
|
|
|
|
2020-02-06 15:59:09 -05:00
|
|
|
// check-pass
|
2019-01-04 10:19:22 +01:00
|
|
|
|
2018-11-19 10:47:34 -05:00
|
|
|
trait TheTrait {
|
2020-01-24 15:57:01 -05:00
|
|
|
fn foo(&self) {}
|
2015-02-12 12:42:02 -05:00
|
|
|
}
|
|
|
|
|
2020-01-24 15:57:01 -05:00
|
|
|
impl TheTrait for for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {}
|
2015-02-12 12:42:02 -05:00
|
|
|
|
2018-11-19 10:47:34 -05:00
|
|
|
impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 {
|
2020-05-13 15:18:50 -04:00
|
|
|
//~^ WARNING conflicting implementation
|
|
|
|
//~^^ WARNING this was previously accepted by the compiler but is being phased out
|
2015-02-12 12:42:02 -05:00
|
|
|
}
|
|
|
|
|
2020-01-24 15:57:01 -05:00
|
|
|
fn main() {}
|