SHARE
TWEET

Untitled

a guest Oct 17th, 2019 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top