aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[Bug] [compiler-v2] variable never used, but borrowed

Open fEst1ck opened this issue 2 years ago • 0 comments

🐛 Bug

If the destination of an assignment is never used later, it should not be borrowed later.

_x = ...
// _x is definitely not borrowed here

Hence the last two conditions https://github.com/aptos-labs/aptos-core/blob/8b42857f0a0409a8957a18e1564116526de0548a/third_party/move/move-compiler-v2/src/pipeline/explicit_drop.rs#L184

should always be true. However, the debug assertion bellow is triggered in the indicated test case.

fEst1ck avatar Dec 16 '23 05:12 fEst1ck