pub fn name_hint<'a>(env: &mut Env<'a>, h: &'a Hint) -> &'a Hint {
    let bld = env.builder();
    let Hint(pos, node) = &*h;
    // TODO(hrust): complete the cases
    let newnode = match &**node {
        Hint_::Happly(x, _) => {
            if x.1 == typehints::INT {
                Some(Hint_::Hprim(Tprim::Tint))
            } else if x.1 == typehints::BOOL {
                Some(Hint_::Hprim(Tprim::Tbool))
            } else if x.1 == typehints::FLOAT {
                Some(Hint_::Hprim(Tprim::Tfloat))
            } else if x.1 == typehints::NUM {
                Some(Hint_::Hprim(Tprim::Tnum))
            } else {
                None
            }
        }
        _ => None,
    };

    match newnode {
        None => {
            return h;
        }
        Some(node) => {
            return bld.alloc(Hint(pos.clone(), Box::new(node)));
        }
    }
}
// In the OCaml code, this is done in naming.ml, in the hint_ function
In the OCaml code, this is done in naming.ml, in the hint_ function
In the OCaml code this is done in naming . ml in the hint_ function
pub fn name_hint<'a>(env: &mut Env<'a>, h: &'a Hint) -> &'a Hint {
    let bld = env.builder();
    let Hint(pos, node) = &*h;
    // TODO(hrust): complete the cases
    let newnode = match &**node {
        Hint_::Happly(x, _) => {
            if x.1 == typehints::INT {
                Some(Hint_::Hprim(Tprim::Tint))
            } else if x.1 == typehints::BOOL {
                Some(Hint_::Hprim(Tprim::Tbool))
            } else if x.1 == typehints::FLOAT {
                Some(Hint_::Hprim(Tprim::Tfloat))
            } else if x.1 == typehints::NUM {
                Some(Hint_::Hprim(Tprim::Tnum))
            } else {
                None
            }
        }
        _ => None,
    };
    match newnode {
        None => {
            return h;
        }
        Some(node) => {
            return bld.alloc(Hint(pos.clone(), Box::new(node)));
        }
    }
}
pub fn name_hint < ' a > ( env : & mut Env < ' a > , h : & ' a Hint ) -> & ' a Hint { let bld = env . builder ( ) ; let Hint ( pos , node ) = & * h ; // TODO(hrust): complete the cases let newnode = match & * * node { Hint_ :: Happly ( x , _ ) => { if x . 1 == typehints :: INT { Some ( Hint_ :: Hprim ( Tprim :: Tint ) ) } else if x . 1 == typehints :: BOOL { Some ( Hint_ :: Hprim ( Tprim :: Tbool ) ) } else if x . 1 == typehints :: FLOAT { Some ( Hint_ :: Hprim ( Tprim :: Tfloat ) ) } else if x . 1 == typehints :: NUM { Some ( Hint_ :: Hprim ( Tprim :: Tnum ) ) } else { None } } _ => None , } ; match newnode { None => { return h ; } Some ( node ) => { return bld . alloc ( Hint ( pos . clone ( ) , Box :: new ( node ) ) ) ; } } }
In the OCaml code, this is done in naming.ml, in the hint_ function
In the OCaml code this is done in naming . ml in the hint_ function
env
&mut Env<'a>
h
&'a Hint