__OwnedMutable
Summary:
This diff introduces `__OwnedMutable` annotation that can be applied to only function parameters. When calling a function the only valid values of argument for parameter with `__OwnedMutable` are:
- `Rx\move(mutably-owned-local)`
- `Rx\mutable(new-or-call-expression)`
Also this diff introduces `Rx\move` intrinsic and changes the semantics of `Rx\freeze` to be aligned with `Rx\move`. In pseudocode:
```
namespace Rx;
<<__Rx, __MutableReturn>>
function move<T>(inout T $v): T {
$tmp = $v; // grab the referenced value
unset(v); // unset local at the callsite
return $tmp; // return mutably owned value
}
<<__Rx>>
function freeze<T>(inout T $v): T {
$tmp = $v; // grab the referenced value
unset(v); // unset local at the callsite
return $tmp; // return immutable value
}
```
Reviewed By: DavidSnider
Differential Revision:
D10367849
fbshipit-source-id:
0280dc74c5d47d65341ba260ecd3693dbdeb0ba2