-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Closed
Labels
A-type-systemArea: Type systemArea: Type system
Description
This program is accepted, but it shouldn't be:
fn f(mut a: [Box<int>, ..2]) {
drop(a[0]);
a[1] = box 2;
drop(a[0]);
}
fn main() {
f([box 0, box 1]);
}The problem is that array paths do not incorporate the index, and thus do not refer to a unique location, unlike other LoanPaths. Strong updates to kill previous moves are only valid for paths that refer to a unique location.
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type system