Hello. I'm learning Rust, and I'm making a super-mini interpreter (mostly).
However, I get this error:
cannot borrow self.lexer as mutable more than once at a time
second mutable borrow occurs here
parser.rs(39, 30): first mutable borrow occurs here
parser.rs(17, 6): lifetime 'a defined here
parser.rs(39, 30): returning this value requires that *self is borrowed for 'a
It is almost always wrong to have an explicit lifetime parameter on self.
Given that your other parser function returns a type with lifetime 'aindependent of the lifetime of self, you should probably do the same in your second method and simply remove the 'a requirement from self.
Thanks, but I managed to resolve it. The spam detector flagged this post, so it got hidden for some time. I change many things, like I change 'a to 'static, nothing worked
when, finally after 2 hours of searching, I managed to resolve it.