Closed
Description
use std::any::TypeId;
unsafe trait TidAble<'a>: Tid<'a> {}
trait TidExt<'a>: Tid<'a> {
fn downcast_box(self: Box<Self>) {
loop {}
}
}
impl<'a, X: ?Sized + Tid<'a>> TidExt<'a> for X {}
unsafe trait Tid<'a>: 'a {}
unsafe impl<'a, T: ?Sized + TidAble<'a>> Tid<'a> for T {}
impl<'a> dyn Tid<'a> + 'a {
fn downcast_any_box(self: Box<Self>) {
self.downcast_box();
}
}
unsafe impl<'a> TidAble<'a> for dyn Tid<'a> + 'a {}
error[E0283]: type annotations needed: cannot satisfy `dyn Tid<'a>: Tid<'_>`
--> src/lib.rs:18:14
|
18 | self.downcast_box();
Conflict between blanket impl and dyn impl. Probably fixed if we were to fix the dyn overlap problem.
Metadata
Metadata
Assignees
Type
Projects
Status
done