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

Method fmt

cranelift/codegen/src/ir/exception_table.rs:258–288  ·  view source on GitHub ↗
(&self, fmt: &mut Formatter<'_>)

Source from the content-addressed store, hash-verified

256
257impl<'a> Display for DisplayExceptionTable<'a> {
258 fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
259 write!(
260 fmt,
261 "{}, {}, [",
262 self.table.sig,
263 self.table.normal_return().display(self.pool)
264 )?;
265 let mut first = true;
266 for item in self.table.items() {
267 if first {
268 write!(fmt, " ")?;
269 first = false;
270 } else {
271 write!(fmt, ", ")?;
272 }
273 match item {
274 ExceptionTableItem::Tag(tag, block_call) => {
275 write!(fmt, "{}: {}", tag, block_call.display(self.pool))?;
276 }
277 ExceptionTableItem::Default(block_call) => {
278 write!(fmt, "default: {}", block_call.display(self.pool))?;
279 }
280 ExceptionTableItem::Context(ctx) => {
281 write!(fmt, "context {ctx}")?;
282 }
283 }
284 }
285 let space = if first { "" } else { " " };
286 write!(fmt, "{space}]")?;
287 Ok(())
288 }
289}

Callers

nothing calls this directly

Calls 2

OkFunction · 0.85
itemsMethod · 0.80

Tested by

no test coverage detected