RefCell not dropping warning #13581
Replies: 2 comments 3 replies
-
If the compiler/Clippy could determine when a reference can be dropped, couldn't you then just use normal references and let the borrow checker deal with it? In some cases a lint could possibly give hints when a The |
Beta Was this translation helpful? Give feedback.
-
There's the lint Maybe we could allow users to specify additional paths (on top of the ones marked with |
Beta Was this translation helpful? Give feedback.
-
Hi all, I saw this lint: await_holding_refcell_ref which checks whether a
Ref
fromRefCell
is dropped before awaiting async code.But what about not dropping
Ref
in general? I see this as a potential source of bugs, probably the most common one for RefCells. For example:I assume there could exist an automatic check which detects the last usage of Ref, and suggest the user to drop it immediately. My questions are:
Beta Was this translation helpful? Give feedback.
All reactions