pub fn inline_cast(expr: &mut Expr) {
    use crate::ast::LiteralKind::*;
    use crate::ast::ScalarKind::*;
    use crate::ast::Type::Scalar;
    expr.transform(&mut |ref mut expr| {
        if let Cast {
            kind: ref scalar_kind,
            ref child_expr,
        } = expr.kind
        {
            if let Literal(ref literal_kind) = child_expr.kind {
                return match (scalar_kind, literal_kind) {
                    (&F64, &I32Literal(a)) => {
                        Some(Expr::new_literal(F64Literal((f64::from(a)).to_bits())).unwrap())
                    }
                    (&I64, &I32Literal(a)) => {
                        Some(Expr::new_literal(I64Literal(i64::from(a))).unwrap())
                    }
                    (&F64, &I64Literal(a)) => {
                        Some(Expr::new_literal(F64Literal((a as f64).to_bits())).unwrap())
                    }
                    _ => None,
                };
            }
            if let Scalar(ref kind) = child_expr.ty {
                if kind == scalar_kind {
                    // XXX Tombstone and mem::swap here!!
                    return Some(*child_expr.clone());
                }
            }
        }
        None
    });
}
Inline casts.

This changes casts of literal values to be literal values of the casted type. It additionally
removes "self casts" (e.g., `i64(x: i64)` becomes `x`).
weld/src/optimizer/transforms/inliner.rs