2024-01-22 06:23:50 -06:00
|
|
|
#![deny(deref_into_dyn_supertrait)]
|
2023-11-17 16:05:42 -06:00
|
|
|
|
|
|
|
use std::ops::Deref;
|
|
|
|
|
|
|
|
trait Bar<'a> {}
|
|
|
|
trait Foo<'a>: Bar<'a> {}
|
|
|
|
|
|
|
|
impl<'a> Deref for dyn Foo<'a> {
|
2024-01-22 06:23:50 -06:00
|
|
|
//~^ ERROR this `Deref` implementation is covered by an implicit supertrait coercion
|
|
|
|
//~| WARN this will change its meaning in a future release!
|
2023-11-17 16:05:42 -06:00
|
|
|
type Target = dyn Bar<'a>;
|
|
|
|
|
|
|
|
fn deref(&self) -> &Self::Target {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|