Use ocamlrep in PPL class rewriter ffi
commitc2b7733aca8be84ab25b6f99d8d75dfacdcd6013
authorJake Bailey (Hacklang) <jakebailey@fb.com>
Fri, 25 Oct 2019 16:06:52 +0000 (25 09:06 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 25 Oct 2019 16:09:46 +0000 (25 09:09 -0700)
tree8623f97e680013a5729d9abd575914b3b73a43d1
parente75448350dc4746402dcaeb26823294cb2ba898a
Use ocamlrep in PPL class rewriter ffi

Summary:
Now that ocamlrep can allocate via ocamlpool, replacing the Ocamlvalue trait with OcamlRep will allow us to use types which implement OcamlRep in Rust binaries. This was difficult before because implementations of Ocamlvalue linked against the OCaml runtime.

This diff uses ocamlrep in the PPL class rewriter FFI.

I did not use the `ocaml_ffi_no_panic!` macro here (`ocamlrep_ocamlpool`'s equivalent to the `caml!` macro) because the result is converted to OCaml via `ToOcaml` rather than `OcamlRep`. We use `OcamlRep` here only for the conversion of the source text argument.

Reviewed By: jewelpit

Differential Revision: D18066126

fbshipit-source-id: b721687dea627e34b95328a3967a7ed127dcbe58
hphp/hack/src/parser/ppl/rust_ppl_class_rewriter_ffi.rs