swift
b2686982 - [ownership] Allow mark_uninitialized to only take owned/none ownership parameters.

Commit
6 years ago
[ownership] Allow mark_uninitialized to only take owned/none ownership parameters. More explicitly, this disallows guaranteed values to be passed to mark_uninitialized. From the perspective of OSSA, it only makes sense for mark_uninitialized to consume its incoming parameter since we want the underlying allocated value to have its "entire" lifetime "funnel" through the mark_uninitialized. Since if the input value is none, we still accept it, all mark_uninitialized on pointers will not be affected by this. NOTE: Today, mark_uninitialized can not even accept a borrow parameter (we severely restrict what parameters it can take). So I can not actually even write a test for this today since the verifier will run after parsing and assert. But from a modeling perspective and from the perspective of not creating confusion, specifying the ownership of mark_uninitialized more explicitly is good.
Author
Committer
Parents
Loading