]> git.ipfire.org Git - thirdparty/qemu.git/commit
rust: make TryFrom macro more resilient
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 5 Jun 2025 09:12:15 +0000 (11:12 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 6 Jun 2025 12:32:54 +0000 (14:32 +0200)
commitbc2a48d647752e4f99247184f5dfe00e67a2de8f
treec4f1252b1ff23ccde65e385e4827ccc56104f39a
parent9c00ef6248bd6545f262f18f31b15fc681e88972
rust: make TryFrom macro more resilient

If the enum includes values such as "Ok", "Err", or "Error", the TryInto
macro can cause errors.  Be careful and qualify identifiers with the full
path, or in the case of TryFrom<>::Error do not use the associated type
at all.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rust/qemu-api-macros/src/lib.rs