don't need vendoring, just 33 free-standing lines now

This commit is contained in:
nora 2022-04-23 23:42:46 +02:00
parent 6ca7ab5734
commit 7d8e5a2397
6 changed files with 13 additions and 115 deletions

View file

@ -1,38 +1,33 @@
pub trait CoolTrait {}
impl<'a, D: CoolTrait + ?Sized> CoolTrait for &'a D {}
pub fn foo(parent: Parent<'_>) {
requires_parent_fulfill_trait(parent);
requires_parent_fulfill_cool_trait(parent);
}
pub fn requires_parent_fulfill_trait(_: impl dbg_pls::DebugPls) {}
pub fn requires_parent_fulfill_cool_trait(_: impl CoolTrait) {}
pub enum Parent<'a> {
A(&'a A<'a>),
B(&'a B<'a>),
}
impl<'a> dbg_pls::DebugPls for Parent<'a>
impl<'a> CoolTrait for Parent<'a>
where
&'a A<'a>: dbg_pls::DebugPls,
&'a B<'a>: dbg_pls::DebugPls,
&'a A<'a>: CoolTrait,
&'a B<'a>: CoolTrait,
{
fn fmt(&self, f: dbg_pls::Formatter<'_>) {}
}
pub struct A<'a> {
parent: Parent<'a>,
}
impl<'a> dbg_pls::DebugPls for A<'a>
where
Parent<'a>: dbg_pls::DebugPls,
{
fn fmt(&self, f: dbg_pls::Formatter<'_>) {}
}
impl<'a> CoolTrait for A<'a> where Parent<'a>: CoolTrait {}
pub struct B<'a> {
parent: Parent<'a>,
}
impl<'a> dbg_pls::DebugPls for B<'a>
where
Parent<'a>: dbg_pls::DebugPls,
{
fn fmt(&self, f: dbg_pls::Formatter<'_>) {}
}
impl<'a> CoolTrait for B<'a> where Parent<'a>: CoolTrait {}