Closed Nadrieril closed 1 month ago
https://github.com/AeneasVerif/charon/pull/284 does most of that. charon-lib
(which includes the ast definition and the control-flow reconstruction) should be pretty compatible with other rustc nightlies now. The only thing that remains would be to replace our usage of rustc internal crates for error reporting.
Did you have plans/thoughts on how Charon can be restructured so that the library can be included without including the toolchain-dependent crates in the dependencies (e.g. hax-frontend-exporter
)?
Currently, including the Charon library as a dependency brings in the dependencies used in the binaries as well.
Unfortunately, cargo doesn't allow specifying binary-specific dependencies easily:
https://github.com/rust-lang/cargo/issues/1982
The workarounds from what I understand are:
hax-frontend-exporter
an optional dependency under a feature that is only used for the binaries. One would need to pass --features X
when building the binaries though.Oh yeah, I was thinking we'd add a feature flag. Either is fine probably.
Alright, this should now work on many nightly compilers:
[dependencies]
charon = { git = "https://github.com/AeneasVerif/charon", default-features = false }
The most interesting modules are ast
which contains all the ast definitions, and transform
which contains the code for the various transformations we do after translation, including control-flow reconstruction.
I believe the current state is good enough to close this issue, lmk if not.
Awesome, thanks @Nadrieril!
We'd like other rust users to be able to use Charon code. This may involve:
rustc
optional behind a feature flag.