Introduce ToOxidized trait for conversion from rupro types to oxidized_by_ref types
commit94078661deaf5846fa1de25a949939641565bffe
authorMillie Chen <milliechen@fb.com>
Thu, 24 Feb 2022 16:47:24 +0000 (24 08:47 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 24 Feb 2022 16:47:24 +0000 (24 08:47 -0800)
treec331351f134ee0dbb68a03bcfe8739eb6d6dab18
parenteffe3185648b7146a61481a887596ba6271d4a1f
Introduce ToOxidized trait for conversion from rupro types to oxidized_by_ref types

Summary:
We want to generate oxidized_by_ref values for the rupro folded decls in order to compare them against existing folded decls as measure of correctness. This diff introduces and implements the following trait for the relevant types (with some `unimplemented` to be filled out in later diffs).
```
pub trait ToOxidized<'a> {
    type Output: TrivialDrop + Clone + ToOcamlRep + 'a;

    fn to_oxidized(&self, arena: &'a bumpalo::Bump) -> Self::Output;
}
```

Differential Revision: D34325703

fbshipit-source-id: db2636ee7712bc0ebf4375a6be85a8a1b27c0cf1
hphp/hack/src/rupro/lib/decl_defs/mod.rs
hphp/hack/src/rupro/lib/decl_defs/to_oxidized.rs [new file with mode: 0644]
hphp/hack/src/rupro/lib/pos/lib.rs
hphp/hack/src/rupro/lib/pos/pos.rs
hphp/hack/src/rupro/lib/pos/symbol.rs
hphp/hack/src/rupro/lib/pos/to_oxidized.rs [new file with mode: 0644]
hphp/hack/src/rupro/lib/reason.rs
hphp/hack/src/rupro/lib/typing_defs/ty.rs
hphp/hack/src/rupro/lib/utils/core/ident.rs