[][src]Trait c2rust_refactor::illtyped::IlltypedFolder

pub trait IlltypedFolder<'tcx> {
    fn fix_expr(
        &mut self,
        e: &mut P<Expr>,
        actual: Ty<'tcx>,
        expected: Ty<'tcx>
    ) { ... }
fn fix_expr_cast(
        &mut self,
        e: &mut P<Expr>,
        actual: Ty<'tcx>,
        target: Ty<'tcx>
    ) { ... }
fn fix_expr_parent(&mut self, _e: &mut P<Expr>) { ... } }

Provided methods

fn fix_expr(&mut self, e: &mut P<Expr>, actual: Ty<'tcx>, expected: Ty<'tcx>)

Called on each expr e whose actual type doesn't match the expected type propagated down from its parent. Implementations should attempt to correct e to an expr that has type expected.

fn fix_expr_cast(&mut self, e: &mut P<Expr>, actual: Ty<'tcx>, target: Ty<'tcx>)

Called on each expr e that is the subject of an invalid cast: e has type actual, which cannot be cast to target. Implementations should attempt to correct e to an expr that has a type castable to target.

The default implementation dispatches to fix_expr, since fixing e to have type exactly target will certainly make the cast succeed.

fn fix_expr_parent(&mut self, _e: &mut P<Expr>)

Called on each expr e that contains a subexpr whose actual type doesn't match the expected type propagated down from e.

Loading content...

Implementations on Foreign Types

impl<'a, 'tcx, F: IlltypedFolder<'tcx>> IlltypedFolder<'tcx> for &'a mut F[src]

Loading content...

Implementors

Loading content...