2025-02-06 21:57:50 +01:00
|
|
|
//@ check-pass
|
|
|
|
|
#![warn(deref_into_dyn_supertrait)]
|
2023-11-17 22:05:42 +00:00
|
|
|
|
|
|
|
|
use std::ops::Deref;
|
|
|
|
|
|
|
|
|
|
trait Bar<'a> {}
|
|
|
|
|
trait Foo<'a>: Bar<'a> {}
|
|
|
|
|
|
|
|
|
|
impl<'a> Deref for dyn Foo<'a> {
|
2025-02-06 21:57:50 +01:00
|
|
|
//~^ warn: this `Deref` implementation is covered by an implicit supertrait coercion
|
2023-11-17 22:05:42 +00:00
|
|
|
type Target = dyn Bar<'a>;
|
|
|
|
|
|
|
|
|
|
fn deref(&self) -> &Self::Target {
|
|
|
|
|
todo!()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {}
|