Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. pub struct FooStruct<'a> {
  2. pub bars: Vec<&'a str>,
  3. }
  4.  
  5. pub trait FooTrait<'a> {
  6. fn getBars(&self) -> &'a Vec<&'a str>;
  7. }
  8.  
  9. impl<'a> FooTrait<'a> for FooStruct<'a> {
  10. fn getBars(&self) -> &'a Vec<&'a str> {
  11. &self.bars // cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement