Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

primary_path.borrow_mut() already borrowed in loss_recovery::timeout #1577

Open
valenting opened this issue Jan 23, 2024 · 3 comments
Open

Comments

@larseggert
Copy link
Collaborator

I'm looking at the code in question, but with my limited Rust-fu I can't tell why this error occurs. Shouldn't the borrow_mut() lifetime end with the loop block?

@martinthomson
Copy link
Member

Rust has non-lexical lifetimes, which means that in some cases a borrow might not last as long as the block in which it is found, though there is a guarantee that borrows are released at the end of a block.

Looking at the code in the immediate vicinity, the calls to borrow() or borrow_mut() on primary_path all end the borrow immediately, until the call to maybe_fire_pto(), which is passed a reference to the path RTT object. I'd look further afield. Maybe we're holding a borrow further up the stack.

@larseggert
Copy link
Collaborator

@valenting have we recently seen more crash reports like this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants