pub fn typeck_array_aggregate_element<'sbc, 'lazy: 'sbc, 'sb: 'lazy, 'ast: 'sb, 'ctx: 'sb>(
    tyc: &TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>,
    hir: &Spanned<(hir::ArrayChoices, Spanned<ExprRef>)>,
    index_ty: &'ctx Ty,
    element_ty: &'ctx Ty,
) -> Result<()> {
    let mut had_fails = false;
    for choice in &hir.value.0 {
        match typeck_array_aggregate_choice(tyc, choice, index_ty) {
            Ok(()) => (),
            Err(()) => had_fails = true,
        }
    }
    tyc.ctx.set_type_context(hir.value.1.value, element_ty);
    let ty = tyc.lazy_typeval(hir.value.1.value)?;
    tyc.must_match(element_ty, ty, hir.span);
    if had_fails {
        Err(())
    } else {
        Ok(())
    }
}
/// Check the type of an array aggregate element.
Check the type of an array aggregate element.
Check the type of an array aggregate element .
pub fn typeck_array_aggregate_element<'sbc, 'lazy: 'sbc, 'sb: 'lazy, 'ast: 'sb, 'ctx: 'sb>(
    tyc: &TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>,
    hir: &Spanned<(hir::ArrayChoices, Spanned<ExprRef>)>,
    index_ty: &'ctx Ty,
    element_ty: &'ctx Ty,
) -> Result<()> {
    let mut had_fails = false;
    for choice in &hir.value.0 {
        match typeck_array_aggregate_choice(tyc, choice, index_ty) {
            Ok(()) => (),
            Err(()) => had_fails = true,
        }
    }
    tyc.ctx.set_type_context(hir.value.1.value, element_ty);
    let ty = tyc.lazy_typeval(hir.value.1.value)?;
    tyc.must_match(element_ty, ty, hir.span);
    if had_fails {
        Err(())
    } else {
        Ok(())
    }
}
pub fn typeck_array_aggregate_element < ' sbc , ' lazy : ' sbc , ' sb : ' lazy , ' ast : ' sb , ' ctx : ' sb > ( tyc : & TypeckContext < ' sbc , ' lazy , ' sb , ' ast , ' ctx > , hir : & Spanned < ( hir :: ArrayChoices , Spanned < ExprRef > ) > , index_ty : & ' ctx Ty , element_ty : & ' ctx Ty , ) -> Result < ( ) > { let mut had_fails = false ; for choice in & hir . value . 0 { match typeck_array_aggregate_choice ( tyc , choice , index_ty ) { Ok ( ( ) ) => ( ) , Err ( ( ) ) => had_fails = true , } } tyc . ctx . set_type_context ( hir . value . 1 . value , element_ty ) ; let ty = tyc . lazy_typeval ( hir . value . 1 . value ) ? ; tyc . must_match ( element_ty , ty , hir . span ) ; if had_fails { Err ( ( ) ) } else { Ok ( ( ) ) } }
Check the type of an array aggregate element.
Check the type of an array aggregate element .
tyc
&TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>
hir
&Spanned<(hir::ArrayChoices, Spanned<ExprRef>)>
index_ty
&'ctx Ty
element_ty
&'ctx Ty
tyc
&TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>
hir
&Spanned<(hir::ArrayChoices, Spanned<ExprRef>)>
index_ty
&'ctx Ty
element_ty
&'ctx Ty