qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] rust: improvements to errors
@ 2025-10-31 15:25 Paolo Bonzini
  2025-10-31 15:25 ` [PATCH 1/4] rust/util: add ensure macro Paolo Bonzini
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Paolo Bonzini @ 2025-10-31 15:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-rust

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(-)

-- 
2.51.1



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-11-04 15:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-31 15:25 [PATCH 0/4] rust: improvements to errors Paolo Bonzini
2025-10-31 15:25 ` [PATCH 1/4] rust/util: add ensure macro Paolo Bonzini
2025-11-04 15:17   ` Zhao Liu
2025-10-31 15:25 ` [PATCH 2/4] rust/util: use anyhow's native chaining capabilities Paolo Bonzini
2025-11-04 15:31   ` Zhao Liu
2025-10-31 15:25 ` [PATCH 3/4] rust/util: replace Error::err_or_unit/err_or_else with Error::with_errp Paolo Bonzini
2025-11-04 15:44   ` Zhao Liu
2025-10-31 15:25 ` [PATCH 4/4] rust: pull error_fatal out of SysbusDeviceMethods::sysbus_realize Paolo Bonzini
2025-11-04 15:47   ` Zhao Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).