Issues with generics

⚓ Rust    📅 2025-10-30    👤 surdeus    👁️ 6      

surdeus

Warning

This post was published 33 days ago. The information described in this article may have changed.

Info

This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Issues with generics

i have a situation along the line of

impl<A> Trait1 for A{
       fn myfunc(&mut self){
             .................
             <A as Trait2>::fn(self) //if and only if A:Trait2
             .................
       }
}

i think i can probably find a workaround to do that but i was wondering if anyone knows of a clean maintainable solution for something like this ideally without runtime costs

5 posts - 3 participants

Read full topic

🏷️ Rust_feed