fn module_needs_anyref_metadata(aux: &WasmBindgenAux, section: &NonstandardWitSection) -> bool {
    use Instruction::*;

    // our `handleError` intrinsic uses a few pieces of metadata to store
    // indices directly into the wasm module.
    if aux.imports_with_catch.len() > 0 {
        return true;
    }

    // Look for any instructions which may use `VectorKind::Anyref`. If there
    // are any then we'll need our intrinsics/tables/etc, otherwise we shouldn't
    // ever need them.
    section.adapters.iter().any(|(_, adapter)| {
        let instructions = match &adapter.kind {
            AdapterKind::Local { instructions } => instructions,
            AdapterKind::Import { .. } => return false,
        };
        instructions.iter().any(|instr| match instr.instr {
            VectorToMemory {
                kind: VectorKind::Anyref,
                ..
            }
            | MutableSliceToMemory {
                kind: VectorKind::Anyref,
                ..
            }
            | OptionVector {
                kind: VectorKind::Anyref,
                ..
            }
            | VectorLoad {
                kind: VectorKind::Anyref,
                ..
            }
            | OptionVectorLoad {
                kind: VectorKind::Anyref,
                ..
            }
            | View {
                kind: VectorKind::Anyref,
                ..
            }
            | OptionView {
                kind: VectorKind::Anyref,
                ..
            } => true,
            _ => false,
        })
    })
}
/// This function shouldn't need to exist, see the fixme at the call-site.
This function shouldn't need to exist, see the fixme at the call-site.
This function shouldn ' t need to exist see the fixme at the call - site .
fn module_needs_anyref_metadata(aux: &WasmBindgenAux, section: &NonstandardWitSection) -> bool {
    use Instruction::*;
    // our `handleError` intrinsic uses a few pieces of metadata to store
    // indices directly into the wasm module.
    if aux.imports_with_catch.len() > 0 {
        return true;
    }
    // Look for any instructions which may use `VectorKind::Anyref`. If there
    // are any then we'll need our intrinsics/tables/etc, otherwise we shouldn't
    // ever need them.
    section.adapters.iter().any(|(_, adapter)| {
        let instructions = match &adapter.kind {
            AdapterKind::Local { instructions } => instructions,
            AdapterKind::Import { .. } => return false,
        };
        instructions.iter().any(|instr| match instr.instr {
            VectorToMemory {
                kind: VectorKind::Anyref,
                ..
            }
            | MutableSliceToMemory {
                kind: VectorKind::Anyref,
                ..
            }
            | OptionVector {
                kind: VectorKind::Anyref,
                ..
            }
            | VectorLoad {
                kind: VectorKind::Anyref,
                ..
            }
            | OptionVectorLoad {
                kind: VectorKind::Anyref,
                ..
            }
            | View {
                kind: VectorKind::Anyref,
                ..
            }
            | OptionView {
                kind: VectorKind::Anyref,
                ..
            } => true,
            _ => false,
        })
    })
}
fn module_needs_anyref_metadata ( aux : & WasmBindgenAux , section : & NonstandardWitSection ) -> bool { use Instruction :: * ; // our `handleError` intrinsic uses a few pieces of metadata to store // indices directly into the wasm module. if aux . imports_with_catch . len ( ) > 0 { return true ; } // Look for any instructions which may use `VectorKind::Anyref`. If there // are any then we'll need our intrinsics/tables/etc, otherwise we shouldn't // ever need them. section . adapters . iter ( ) . any ( | ( _ , adapter ) | { let instructions = match & adapter . kind { AdapterKind :: Local { instructions } => instructions , AdapterKind :: Import { .. } => return false , } ; instructions . iter ( ) . any ( | instr | match instr . instr { VectorToMemory { kind : VectorKind :: Anyref , .. } | MutableSliceToMemory { kind : VectorKind :: Anyref , .. } | OptionVector { kind : VectorKind :: Anyref , .. } | VectorLoad { kind : VectorKind :: Anyref , .. } | OptionVectorLoad { kind : VectorKind :: Anyref , .. } | View { kind : VectorKind :: Anyref , .. } | OptionView { kind : VectorKind :: Anyref , .. } => true , _ => false , } ) } ) }
This function shouldn't need to exist, see the fixme at the call-site.
This function shouldn ' t need to exist see the fixme at the call - site .
aux
&WasmBindgenAux
section
&NonstandardWitSection
aux
&WasmBindgenAux
section
&NonstandardWitSection