charon_lib/transform/simplify_output/
erase_body_lifetimes.rs

1use crate::llbc_ast::*;
2use crate::transform::TransformCtx;
3
4use crate::transform::ctx::TransformPass;
5
6pub struct Transform;
7impl TransformPass for Transform {
8    fn should_run(&self, options: &crate::options::TranslateOptions) -> bool {
9        options.erase_body_lifetimes
10    }
11
12    fn transform_ctx(&self, ctx: &mut TransformCtx) {
13        ctx.for_each_body(|_, body| {
14            body.dyn_visit_mut(|r: &mut Region| {
15                if r.is_body() {
16                    *r = Region::Erased;
17                }
18            });
19        });
20    }
21}