Advertisement
Guest User

Untitled

a guest
Aug 25th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement