Skip to content

rust: improvements to errors

Paolo Bonzini qemu-devel qemu-rust 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4rust/util: add ensure macrorust/hw/timer/hpet/src/device.rs rust/hw/timer/hpet/src/fw_cfg.rs rust/util/src/error.rs+86 -131 reply
2/4rust/util: use anyhow's native chaining capabilitiesrust/util/src/error.rs+59 -1011 reply
3/4rust/util: replace Error::err_or_unit/err_or_else with Error::with_errprust/util/src/error.rs+20 -321 reply
4/4rust: pull error_fatal out of SysbusDeviceMethods::sysbus_realizerust/hw/char/pl011/src/device.rs rust/hw/core/src/sysbus.rs rust/util/src/error.rs +1 more+39 -111 reply

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchZhao Liu
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] rust: improvements to errors

The first three patches are extracted from the serde work; as to the fourth, I was thinking about it for a while - it provides an extension trait for Result that makes it easy to use &error_fatal. The main advantage is to make it clear how errors are handled.

Paolo

Paolo Bonzini (4):
rust/util: add ensure macro
rust/util: use anyhow's native chaining capabilities rust/util: replace Error::err_or_unit/err_or_else with
Error::with_errp
rust: pull error_fatal out of SysbusDeviceMethods::sysbus_realize

 rust/hw/char/pl011/src/device.rs |   4 +-
 rust/hw/core/src/sysbus.rs       |  13 +-
 rust/hw/timer/hpet/src/device.rs |  21 ++-
 rust/hw/timer/hpet/src/fw_cfg.rs |   7 +-
 rust/util/src/error.rs           | 272 ++++++++++++++++++-------------
 rust/util/src/lib.rs             |   2 +-
 6 files changed, 183 insertions(+), 136 deletions(-)
Signature · 1 line
2.51.1