A confusing lifetime error related to Rust's lifetime elision

from blog ntietz.com blog - technically a blog, | ↗ original
↗ original
Earlier this week, I ran into a confusing situation with lifetimes and the borrow checker while working on my Lox interpreter. It took me a little while to figure out, and it's an instructive situation. Here's a reduced-down version of what I was working on. It's an interpreter, so there is a scanner which produces tokens. Ideally these tokens...