/// Define additional names in the scope, e.g. for enums and physical types.
Define additional names in the scope, e.g. for enums and physical types.
Define additional names in the scope e . g . for enums and physical types .
fn define_auxiliary_names<'t>(
    data: &ast::TypeData,
    type_decl: &'t LatentNode<'t, TypeDecl2<'t>>,
    context: AllocContext<'t>,
) -> Result<()> {
    match *data {
        ast::EnumType(ref paren_elems) => {
            for (i, lit) in paren_elems.value.iter().enumerate() {
                match lit.expr.data {
                    ast::NameExpr(ref name) => context.define(
                        ResolvableName::from_primary_name(&name.primary, context)?,
                        Def2::Enum(TypeVariantDef(type_decl, i)),
                    )?,
                    _ => (),
                }
            }
        }
        ast::RangeType(_, Some(ref units)) => {
            for (i, unit) in units.iter().enumerate() {
                context.define(
                    Spanned::new(unit.0.name.into(), unit.0.span),
                    Def2::Unit(TypeVariantDef(type_decl, i)),
                )?;
            }
        }
        _ => (),
    }
    Ok(())
}
fn define_auxiliary_names < ' t > ( data : & ast :: TypeData , type_decl : & ' t LatentNode < ' t , TypeDecl2 < ' t > > , context : AllocContext < ' t > , ) -> Result < ( ) > { match * data { ast :: EnumType ( ref paren_elems ) => { for ( i , lit ) in paren_elems . value . iter ( ) . enumerate ( ) { match lit . expr . data { ast :: NameExpr ( ref name ) => context . define ( ResolvableName :: from_primary_name ( & name . primary , context ) ? , Def2 :: Enum ( TypeVariantDef ( type_decl , i ) ) , ) ? , _ => ( ) , } } } ast :: RangeType ( _ , Some ( ref units ) ) => { for ( i , unit ) in units . iter ( ) . enumerate ( ) { context . define ( Spanned :: new ( unit . 0 . name . into ( ) , unit . 0 . span ) , Def2 :: Unit ( TypeVariantDef ( type_decl , i ) ) , ) ? ; } } _ => ( ) , } Ok ( ( ) ) }
Define additional names in the scope, e.g.
Define additional names in the scope e . g .
data
&ast::TypeData
type_decl
&'t LatentNode<'t, TypeDecl2<'t>>
context
AllocContext<'t>