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