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

Method fmt

cranelift/codegen/src/ir/trapcode.rs:96–106  ·  view source on GitHub ↗
(&self, f: &mut Formatter)

Source from the content-addressed store, hash-verified

94
95impl Display for TrapCode {
96 fn fmt(&self, f: &mut Formatter) -> fmt::Result {
97 let identifier = match *self {
98 Self::STACK_OVERFLOW => "stk_ovf",
99 Self::HEAP_OUT_OF_BOUNDS => "heap_oob",
100 Self::INTEGER_OVERFLOW => "int_ovf",
101 Self::INTEGER_DIVISION_BY_ZERO => "int_divz",
102 Self::BAD_CONVERSION_TO_INTEGER => "bad_toint",
103 TrapCode(x) => return write!(f, "user{x}"),
104 };
105 f.write_str(identifier)
106 }
107}
108
109impl FromStr for TrapCode {

Callers

nothing calls this directly

Calls 1

write_strMethod · 0.45

Tested by

no test coverage detected