Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
- --> src/lexer.rs:81:18
- |
- 81 | let ret = self.peek();
- | ^^^^
- |
- note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 74:2...
- --> src/lexer.rs:74:2
- |
- 74 | pub fn next(&mut self) -> &Token {
- | _____^
- 75 | | /*if self.index >= self.tokens.len() {
- 76 | | return &Token::EOF;
- 77 | | }
- ... |
- 83 | | return ret;
- 84 | | }
- | |_____^
- note: ...so that reference does not outlive borrowed content
- --> src/lexer.rs:81:13
- |
- 81 | let ret = self.peek();
- | ^^^^
- note: but, the lifetime must be valid for the lifetime 'a as defined on the impl at 66:6...
- --> src/lexer.rs:66:6
- |
- 66 | impl<'a> Lexer<'a> {
- | ^^
- = note: ...so that the types are compatible:
- expected &mut lexer::Lexer<'_>
- found &mut lexer::Lexer<'a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement