-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
Right now, I have a simple rule that non-mutable local variables cannot be assigned ever. This is too simplistic. We should track an uninit predicate for each local variable and only allow assignment to x if uninit(x) holds. (Note that it is possible to be in a state where neither init(x) nor uninit(x) holds, if x is initialized on some paths but not others)
I tried delving into the type state module to make these changes but they proved somewhat invasive. Currently predicates are indexed by def_id, for example, but this will have to change as there would be multiple predicates associated with the def_id of each local variable. So I decided to just leave my simple-minded check and file an issue.
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.