2023-11-21 06:58:01 -06:00
|
|
|
// check-pass
|
2021-10-02 06:00:36 -05:00
|
|
|
|
2023-11-17 16:05:42 -06:00
|
|
|
use std::ops::Deref;
|
2021-10-02 06:00:36 -05:00
|
|
|
|
|
|
|
// issue 89190
|
|
|
|
trait A {}
|
|
|
|
trait B: A {}
|
2022-11-22 15:33:19 -06:00
|
|
|
|
2021-10-02 06:00:36 -05:00
|
|
|
impl<'a> Deref for dyn 'a + B {
|
2023-11-21 06:58:01 -06:00
|
|
|
//~^ WARN this `Deref` implementation is covered by an implicit supertrait coercion
|
2023-11-18 13:29:39 -06:00
|
|
|
|
2021-10-02 06:00:36 -05:00
|
|
|
type Target = dyn A;
|
|
|
|
fn deref(&self) -> &Self::Target {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn take_a(_: &dyn A) {}
|
|
|
|
|
|
|
|
fn whoops(b: &dyn B) {
|
|
|
|
take_a(b)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|