Closed

Description
use std::ops::Deref;
pub struct Foo<T>(T);
impl Foo<i32> {
pub fn get_i32(&self) -> i32 { self.0 }
}
impl Foo<u32> {
pub fn get_u32(&self) -> u32 { self.0 }
}
pub struct Bar(Foo<i32>);
impl Deref for Bar {
type Target = Foo<i32>;
fn deref(&self) -> &Foo<i32> {
&self.0
}
}
The Methods from Deref
for Bar
will contain both get_i32
and get_u32
, but should only contain get_i32
.