epfl-lara / rust-stainless

An experimental Rust frontend for Stainless
Apache License 2.0
6 stars 2 forks source link

Fix cfg flag usage #116

Closed yannbolliger closed 3 years ago

yannbolliger commented 3 years ago

Closes #114.

The cfg(stainless) did not work as desired previously, because it was evaluated at compilation of the macro crate instead of the compilation of the actual file to verify. This is solved by inlining the cfg(stainless) conditional code into the macro's output. The way the feature is set in stainless_frontend was inspired by MIRAI.