Rust lifetime in generic traits


#1

This is probably not new topic, I did read Rust tech doc on the topic but still couldn’t make my code to work. I’m just playing with the code and trying to get used to the language. So I have the following: https://is.gd/MXJnXT

why I’m receiving expected lifetime parameter for both traits in method declaration? I’m highly appreciate your input. I love Rust!


#2

You should write T: Namer<'a> + BirthYear<'a> + 'a instead of T: Namer + BirthYear + 'a.

Also, this forum is for internal development; your mean response time will probably be lower if you ask questions at https://users.rust-lang.org


#3

Thank you so much!