SHARE
TWEET

Untitled

a guest Aug 25th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
  2.   --> src/lexer.rs:81:18
  3.    |
  4. 81 |         let ret = self.peek();
  5.    |                        ^^^^
  6.    |
  7. note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 74:2...
  8.   --> src/lexer.rs:74:2
  9.    |
  10. 74 |       pub fn next(&mut self) -> &Token {
  11.    |  _____^
  12. 75 | |         /*if self.index >= self.tokens.len() {
  13. 76 | |             return &Token::EOF;
  14. 77 | |         }
  15. ...  |
  16. 83 | |         return ret;
  17. 84 | |     }
  18.    | |_____^
  19. note: ...so that reference does not outlive borrowed content
  20.   --> src/lexer.rs:81:13
  21.    |
  22. 81 |         let ret = self.peek();
  23.    |                   ^^^^
  24. note: but, the lifetime must be valid for the lifetime 'a as defined on the impl at 66:6...
  25.   --> src/lexer.rs:66:6
  26.    |
  27. 66 | impl<'a> Lexer<'a> {
  28.    |      ^^
  29.    = note: ...so that the types are compatible:
  30.            expected &mut lexer::Lexer<'_>
  31.               found &mut lexer::Lexer<'a>
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