style: Migrate to stable-only rustfmt configuration
- Remove nightly-only features from .rustfmt.toml and vendor/ss58-registry/rustfmt.toml - Removed features: imports_granularity, wrap_comments, comment_width, reorder_impl_items, spaces_around_ranges, binop_separator, match_arm_blocks, trailing_semicolon, trailing_comma - Format all 898 affected files with stable rustfmt - Ensures long-term reliability without nightly toolchain dependency
This commit is contained in:
@@ -45,11 +45,12 @@ impl WasmInstance for Instance {
|
||||
) -> (Result<Vec<u8>, Error>, Option<AllocationStats>) {
|
||||
let pc = match self.0.module().exports().find(|e| e.symbol() == name) {
|
||||
Some(export) => export.program_counter(),
|
||||
None =>
|
||||
None => {
|
||||
return (
|
||||
Err(format!("cannot call into the runtime: export not found: '{name}'").into()),
|
||||
None,
|
||||
),
|
||||
)
|
||||
},
|
||||
};
|
||||
|
||||
let Ok(raw_data_length) = u32::try_from(raw_data.len()) else {
|
||||
@@ -93,21 +94,24 @@ impl WasmInstance for Instance {
|
||||
|
||||
match self.0.call_typed(&mut (), pc, (data_pointer, raw_data_length)) {
|
||||
Ok(()) => {},
|
||||
Err(CallError::Trap) =>
|
||||
Err(CallError::Trap) => {
|
||||
return (
|
||||
Err(format!("call into the runtime method '{name}' failed: trap").into()),
|
||||
None,
|
||||
),
|
||||
Err(CallError::Error(err)) =>
|
||||
)
|
||||
},
|
||||
Err(CallError::Error(err)) => {
|
||||
return (
|
||||
Err(format!("call into the runtime method '{name}' failed: {err}").into()),
|
||||
None,
|
||||
),
|
||||
Err(CallError::User(err)) =>
|
||||
)
|
||||
},
|
||||
Err(CallError::User(err)) => {
|
||||
return (
|
||||
Err(format!("call into the runtime method '{name}' failed: {err}").into()),
|
||||
None,
|
||||
),
|
||||
)
|
||||
},
|
||||
Err(CallError::NotEnoughGas) => unreachable!("gas metering is never enabled"),
|
||||
Err(CallError::Step) => unreachable!("stepping is never enabled"),
|
||||
};
|
||||
@@ -190,7 +194,7 @@ fn call_host_function(caller: &mut Caller<()>, function: &dyn Function) -> Resul
|
||||
args[nth_arg] = Value::F32(caller.instance.reg(Reg::ARG_REGS[nth_reg]) as u32);
|
||||
nth_reg += 1;
|
||||
},
|
||||
ValueType::I64 =>
|
||||
ValueType::I64 => {
|
||||
if caller.instance.is_64_bit() {
|
||||
args[nth_arg] = Value::I64(caller.instance.reg(Reg::ARG_REGS[nth_reg]) as i64);
|
||||
nth_reg += 1;
|
||||
@@ -203,8 +207,9 @@ fn call_host_function(caller: &mut Caller<()>, function: &dyn Function) -> Resul
|
||||
|
||||
args[nth_arg] =
|
||||
Value::I64((u64::from(value_lo) | (u64::from(value_hi) << 32)) as i64);
|
||||
},
|
||||
ValueType::F64 =>
|
||||
}
|
||||
},
|
||||
ValueType::F64 => {
|
||||
if caller.instance.is_64_bit() {
|
||||
args[nth_arg] = Value::F64(caller.instance.reg(Reg::ARG_REGS[nth_reg]));
|
||||
nth_reg += 1;
|
||||
@@ -216,7 +221,8 @@ fn call_host_function(caller: &mut Caller<()>, function: &dyn Function) -> Resul
|
||||
nth_reg += 1;
|
||||
|
||||
args[nth_arg] = Value::F64(u64::from(value_lo) | (u64::from(value_hi) << 32));
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,20 +250,22 @@ fn call_host_function(caller: &mut Caller<()>, function: &dyn Function) -> Resul
|
||||
Value::F32(value) => {
|
||||
caller.instance.set_reg(Reg::A0, value as u64);
|
||||
},
|
||||
Value::I64(value) =>
|
||||
Value::I64(value) => {
|
||||
if caller.instance.is_64_bit() {
|
||||
caller.instance.set_reg(Reg::A0, value as u64);
|
||||
} else {
|
||||
caller.instance.set_reg(Reg::A0, value as u64);
|
||||
caller.instance.set_reg(Reg::A1, (value >> 32) as u64);
|
||||
},
|
||||
Value::F64(value) =>
|
||||
}
|
||||
},
|
||||
Value::F64(value) => {
|
||||
if caller.instance.is_64_bit() {
|
||||
caller.instance.set_reg(Reg::A0, value as u64);
|
||||
} else {
|
||||
caller.instance.set_reg(Reg::A0, value as u64);
|
||||
caller.instance.set_reg(Reg::A1, (value >> 32) as u64);
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user