Function references: expected bound lifetime parameter , found concrete lifetime [E0271]
问题 There are already a lot of threads on this topic but I fail to see if the discussed problems apply to my specific problem. I have a structure that stores a name and a callback function. Stripped down to the problem it looks like this: pub struct Command<'a> { name: &'a str, callback: &'a Fn(&[&str]) -> () } impl <'a> Command<'a> { pub fn new(name: &'a str, callback: &'a Fn(&[&str]) -> ()) -> Command<'a> { Command { name: name, callback: callback } } } What I want to do is store a callback