A hack would be to do a simple noop read, like:
if last.is_some() {}
first
The problem seems to be the last last = last_mut.cdr;, since you don't use it on the last iteration.
I'd personally do that with a comment until you (or someone else) can fix it, perhaps with a linter instruction at some point. That noop code should be eliminated during the optimization step, so it shouldn't hurt performance or anything.
Edit: don't do this, just prefix the variable with an underscore as someone else mentioned.