25 lines
366 B
Rust
25 lines
366 B
Rust
// check-pass
|
|
|
|
use std::ops::Deref;
|
|
|
|
// issue 89190
|
|
trait A {}
|
|
trait B: A {}
|
|
|
|
impl<'a> Deref for dyn 'a + B {
|
|
//~^ WARN this `Deref` implementation is covered by an implicit supertrait coercion
|
|
|
|
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() {}
|