Compiler hangs, looking for workaround

⚓ Rust    📅 2025-11-02    👤 surdeus    👁️ 4      

surdeus

This code (specifically the Clone impl) makes the compiler hang indefinitely: Rust Playground

I've also tried implementing Clone manually, with the same result. (In fact, I'd rather have a bound on the impl than on the associated type.) I'd also be OK with an additional trait like pub trait CloneRel<V>: Rel<V, Eq: CloneRel<Self>>, but the compiler complains about a cycle in that case.

Any ideas for a workaround (that does not involve making V and E the same type)? Thanks.

Edit: If I delete the trait parameter, I get an error message instead of an infinite loop. That's better of course, but I wonder if it's possible to find a solution. I guess I could implement Clone for the concrete instances that come up, then.

2 posts - 2 participants

Read full topic

🏷️ Rust_feed