-
Notifications
You must be signed in to change notification settings - Fork 59
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
What are the operational semantics of unsized locals? #520
Comments
What do you expect a solution to look like? Some way to specify the runtime metadata before StorageLive, like: StorageMeta(x, Meta(y))
StorageLive(x);
x = Move(y); ? |
I don't know what StorageLive(x, Meta(y));
x = Move(y); However, that still requires the concept of an "unsized value" (the thing that is loaded from Though honestly an even better option might be to entirely desugar this to explicit pointers at the level of MIR, like: let x: *mut UnsizedType;
x = AllocaUnsizedType(Meta(y));
CopyNonoverlapping(x, y); |
Wouldn't that make borrow-check difficult? |
Maybe this should be done as a lowering pass after borrowck. Though then the MIR borrowck runs on wouldn't really have an op.sem... |
Unsized locals as they exist in MIR today have an entirely unclear operational semantics. If we intend to keep them, we should figure out a way to represent them in MIR properly; the current situation is not long-term sustainable.
The text was updated successfully, but these errors were encountered: