Closed
Description
trait Intersect<U> {
type Output;
}
impl<T, U> Intersect<Vec<U>> for T
where
T: Intersect<U>,
{
type Output = T;
}
impl Intersect<Cuboid> for Cuboid {
type Output = Cuboid;
}
fn intersect<T, U>(_: &T, _: &U) -> T::Output
where
T: Intersect<U>,
{
todo!()
}
struct Cuboid;
impl Cuboid {
fn method(&self) {}
}
fn main() {
let x = vec![];
let y = intersect(&Cuboid, &x);
y.method();
let x: Vec<Cuboid> = x;
}
Metadata
Metadata
Assignees
Type
Projects
Status
done