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

Method with_trap_code

cranelift/codegen/src/machinst/mod.rs:213–221  ·  view source on GitHub ↗

Configures these flags with the specified trap code `code`.

(mut self, code: Option<TrapCode>)

Source from the content-addressed store, hash-verified

211
212 /// Configures these flags with the specified trap code `code`.
213 pub const fn with_trap_code(mut self, code: Option<TrapCode>) -> Self {
214 let bits = match code {
215 Some(code) => code.as_raw().get() as u16,
216 None => 0,
217 };
218 self.bits &= !MASK_TRAP_CODE;
219 self.bits |= bits << TRAP_CODE_OFFSET;
220 self
221 }
222}
223
224impl fmt::Display for MachMemFlags {

Callers 2

newMethod · 0.45
with_notrapMethod · 0.45

Calls 2

getMethod · 0.45
as_rawMethod · 0.45

Tested by

no test coverage detected