MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / example

Method example

cranelift/codegen/src/ir/instructions.rs:846–855  ·  view source on GitHub ↗

Get an example member of this type set. This is used for error messages to avoid suggesting invalid types.

(self)

Source from the content-addressed store, hash-verified

844 ///
845 /// This is used for error messages to avoid suggesting invalid types.
846 pub fn example(self) -> Type {
847 let t = if self.ints.max().unwrap_or(0) > 5 {
848 types::I32
849 } else if self.floats.max().unwrap_or(0) > 5 {
850 types::F32
851 } else {
852 types::I8
853 };
854 t.by(1 << self.lanes.min().unwrap()).unwrap()
855 }
856}
857
858/// Operand constraints. This describes the value type constraints on a single `Value` operand.

Callers

nothing calls this directly

Calls 4

maxMethod · 0.45
unwrapMethod · 0.45
byMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected