From: Paolo Bonzini Date: Thu, 4 Dec 2025 09:19:00 +0000 (+0100) Subject: rust: hide panicking default associated constants from rustdoc X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34f66fdfd285eb861cefcec2ab573dbbdf71cfc2;p=thirdparty%2Fqemu.git rust: hide panicking default associated constants from rustdoc Work around rustdoc issue that panics while trying to evaluate the constants. Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- diff --git a/rust/hw/core/src/qdev.rs b/rust/hw/core/src/qdev.rs index 4e983da28b..c2ca17f6ce 100644 --- a/rust/hw/core/src/qdev.rs +++ b/rust/hw/core/src/qdev.rs @@ -132,6 +132,7 @@ unsafe extern "C" fn rust_resettable_exit_fn( /// [`bindings::PropertyInfo`] pointer for the trait implementation to be safe. pub unsafe trait QDevProp { const BASE_INFO: *const bindings::PropertyInfo; + #[doc(hidden)] // https://github.com/rust-lang/rust/issues/149635 const BIT_INFO: *const bindings::PropertyInfo = { panic!("invalid type for bit property"); }; diff --git a/rust/migration/src/vmstate.rs b/rust/migration/src/vmstate.rs index 267f9c8e05..f9d9f335b9 100644 --- a/rust/migration/src/vmstate.rs +++ b/rust/migration/src/vmstate.rs @@ -101,6 +101,7 @@ pub unsafe trait VMState { /// type for the length (i.e. if it is not `u8`, `u16`, `u32`), using it /// in a call to [`vmstate_of!`](crate::vmstate_of) will cause a /// compile-time error. + #[doc(hidden)] // https://github.com/rust-lang/rust/issues/149635 const VARRAY_FLAG: VMStateFlags = { panic!("invalid type for variable-sized array"); };