convert ffi pointer as ref
Summary:
In `lowerer_ffi`, Ocaml passes a `SyntaxTree` pointer to lowerer, the invariant is "Rust borrows a ref from Ocaml", so , `lowerer_ffi` wraps it with `Box` and leak it at the end, however, if lowerer panics `Box::Leak` won't get invoked, then boxed syntax tree will be dropped, this breaks the invariant and Ocaml caller actually will try to drop the tree again.
One solution is to avoid boxing if Rust borrows from Ocaml.
Reviewed By: dabek
Differential Revision:
D17671228
fbshipit-source-id:
7236db4f2c73314e2d63a41dc826d56a01320bed