> There may be some prompting that can help
Sounds like a good time to tell Claude to create a system wide memory of how to implement lifetimes and borrowing and what to NEVER do.
Claude will then make the memory file. Usually memories help a lot. I see it think about it when it reasons through code.