I have know Idea how trait bound work in this case
⚓ Rust 📅 2025-09-30 👤 surdeus 👁️ 9impl <T:SuperBound,'a> MyTrait<'a> for MyStruct<'a> {
fn get(&self)->&'a str;
fn set(&mut self);
}
fn fn_required_superbound(&self,T){}
fn main(){
let s = Mystruct {}
s.set() // error :-> error:type annotations needed
   //cannot satisfy `... and required bound for set()
}
in this impl , only one func require a superbound. other doesn't.
but I can't separate set(), get() from this .
why can this happen ?
and how to fix it?
2 posts - 2 participants
🏷️ Rust_feed