[pbs-devel] [PATCH proxmox 12/19] router: ignore clippy lint `missing_transmute_annotations`
Shannon Sterz
s.sterz at proxmox.com
Thu Mar 6 13:43:42 CET 2025
the `ApiHandler`'s `PartialEq` implementation makes heavy use of
`transmute`. clippy wants the types to be explicitly stated here and
not inferred, to avoid potential undefined behaviour if an unexpected
type is inferred. however, the types that would be inferred here are
so complex, that the code would become illegible anyway, so ignore
this lint for now.
[1]:
https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
Signed-off-by: Shannon Sterz <s.sterz at proxmox.com>
---
proxmox-router/src/router.rs | 1 +
1 file changed, 1 insertion(+)
diff --git a/proxmox-router/src/router.rs b/proxmox-router/src/router.rs
index 0c4e78d4..49593508 100644
--- a/proxmox-router/src/router.rs
+++ b/proxmox-router/src/router.rs
@@ -495,6 +495,7 @@ impl Eq for ApiHandler {}
impl PartialEq for ApiHandler {
fn eq(&self, rhs: &Self) -> bool {
unsafe {
+ #[allow(clippy::missing_transmute_annotations)]
match (self, rhs) {
(ApiHandler::Sync(l), ApiHandler::Sync(r)) => {
core::mem::transmute::<_, usize>(l) == core::mem::transmute::<_, usize>(r)
--
2.39.5
More information about the pbs-devel
mailing list