From 2bc968ba1d522da010f622b47e8f2ec859467ae8 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 17 Jun 2026 11:16:02 +0100 Subject: [PATCH] build: Deny clippy::absolute_paths Removal of absolute paths is currently in progress. To avoid regressing those changes add a clippy deny at the workspace level and at the crate level override with #[expect(clippy::absolute_paths)] See: #7670 Signed-off-by: Rob Bradford --- Cargo.toml | 1 + arch/src/lib.rs | 3 +++ block/src/formats/vhdx/internal/mod.rs | 2 ++ cloud-hypervisor/src/bin/ch-remote.rs | 3 +++ cloud-hypervisor/src/lib.rs | 3 +++ cloud-hypervisor/src/main.rs | 3 +++ cloud-hypervisor/tests/integration.rs | 2 ++ cloud-hypervisor/tests/integration_cvm.rs | 2 ++ devices/src/lib.rs | 3 +++ hypervisor/src/lib.rs | 3 +++ performance-metrics/src/main.rs | 3 +++ serial_buffer/src/lib.rs | 2 ++ test_infra/src/lib.rs | 2 ++ tpm/src/lib.rs | 3 +++ virtio-devices/src/lib.rs | 3 +++ vm-migration/src/lib.rs | 3 +++ vmm/src/lib.rs | 3 +++ 17 files changed, 44 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 17ec41bfa..5f829c930 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -116,6 +116,7 @@ style = "deny" suspicious = "deny" # Individual Lints +absolute_paths = "deny" assertions_on_result_states = "deny" if_not_else = "deny" manual_string_new = "deny" diff --git a/arch/src/lib.rs b/arch/src/lib.rs index 8c067c302..86ec4f501 100644 --- a/arch/src/lib.rs +++ b/arch/src/lib.rs @@ -8,6 +8,9 @@ //! Implements platform specific functionality. //! Supported platforms: x86_64, aarch64, riscv64. +// TODO: Trim qualified paths in this crate, then drop this expectation. +#![expect(clippy::absolute_paths)] + use std::collections::BTreeMap; use std::str::FromStr; use std::sync::Arc; diff --git a/block/src/formats/vhdx/internal/mod.rs b/block/src/formats/vhdx/internal/mod.rs index a2a1d0715..e7a62a362 100644 --- a/block/src/formats/vhdx/internal/mod.rs +++ b/block/src/formats/vhdx/internal/mod.rs @@ -256,6 +256,8 @@ pub(crate) fn uuid_from_guid(buf: &[u8]) -> Uuid { } #[cfg(test)] +// TODO: Trim qualified paths in these tests, then drop this expectation. +#[expect(clippy::absolute_paths)] mod tests { use std::process::Command; diff --git a/cloud-hypervisor/src/bin/ch-remote.rs b/cloud-hypervisor/src/bin/ch-remote.rs index 4f553418a..26f327657 100644 --- a/cloud-hypervisor/src/bin/ch-remote.rs +++ b/cloud-hypervisor/src/bin/ch-remote.rs @@ -3,6 +3,9 @@ // SPDX-License-Identifier: Apache-2.0 // +// TODO: Trim qualified paths in this crate, then drop this expectation. +#![expect(clippy::absolute_paths)] + #[cfg(test)] #[path = "../test_util.rs"] mod test_util; diff --git a/cloud-hypervisor/src/lib.rs b/cloud-hypervisor/src/lib.rs index 836ed8e2e..d2f3a6a4f 100644 --- a/cloud-hypervisor/src/lib.rs +++ b/cloud-hypervisor/src/lib.rs @@ -2,6 +2,9 @@ // // SPDX-License-Identifier: Apache-2.0 +// TODO: Trim qualified paths in this crate, then drop this expectation. +#![expect(clippy::absolute_paths)] + use std::error::Error; use log::error; diff --git a/cloud-hypervisor/src/main.rs b/cloud-hypervisor/src/main.rs index 699300843..3471287a3 100644 --- a/cloud-hypervisor/src/main.rs +++ b/cloud-hypervisor/src/main.rs @@ -3,6 +3,9 @@ // SPDX-License-Identifier: Apache-2.0 // +// TODO: Trim qualified paths in this crate, then drop this expectation. +#![expect(clippy::absolute_paths)] + mod logger; #[cfg(test)] mod test_util; diff --git a/cloud-hypervisor/tests/integration.rs b/cloud-hypervisor/tests/integration.rs index e6854a7a6..43b08b158 100644 --- a/cloud-hypervisor/tests/integration.rs +++ b/cloud-hypervisor/tests/integration.rs @@ -4,6 +4,8 @@ // #![cfg(any(devcli_testenv, clippy))] #![allow(clippy::undocumented_unsafe_blocks)] +// TODO: Trim qualified paths in this crate, then drop this expectation. +#![expect(clippy::absolute_paths)] // When enabling the `mshv` feature, we skip quite some tests and // hence have known dead-code. This annotation silences dead-code // related warnings for our quality workflow to pass. diff --git a/cloud-hypervisor/tests/integration_cvm.rs b/cloud-hypervisor/tests/integration_cvm.rs index 56b786368..d8282ff3e 100644 --- a/cloud-hypervisor/tests/integration_cvm.rs +++ b/cloud-hypervisor/tests/integration_cvm.rs @@ -4,6 +4,8 @@ // #![cfg(any(devcli_testenv, clippy))] #![allow(clippy::undocumented_unsafe_blocks)] +// TODO: Trim qualified paths in this crate, then drop this expectation. +#![expect(clippy::absolute_paths)] // When enabling the `mshv` feature, we skip quite some tests and // hence have known dead-code. This annotation silences dead-code // related warnings for our quality workflow to pass. diff --git a/devices/src/lib.rs b/devices/src/lib.rs index cdec936e2..9df1fc91a 100644 --- a/devices/src/lib.rs +++ b/devices/src/lib.rs @@ -7,6 +7,9 @@ //! Emulates virtual and hardware devices. +// TODO: Trim qualified paths in this crate, then drop this expectation. +#![cfg_attr(target_arch = "x86_64", expect(clippy::absolute_paths))] + pub mod acpi; #[cfg(target_arch = "riscv64")] pub mod aia; diff --git a/hypervisor/src/lib.rs b/hypervisor/src/lib.rs index 865ea02db..299a32390 100644 --- a/hypervisor/src/lib.rs +++ b/hypervisor/src/lib.rs @@ -21,6 +21,9 @@ //! - riscv64 (experimental) //! +// TODO: Trim qualified paths in this crate, then drop this expectation. +#![expect(clippy::absolute_paths)] + /// Architecture specific definitions #[macro_use] pub mod arch; diff --git a/performance-metrics/src/main.rs b/performance-metrics/src/main.rs index 908fe9ec3..98e14cc21 100644 --- a/performance-metrics/src/main.rs +++ b/performance-metrics/src/main.rs @@ -3,6 +3,9 @@ // SPDX-License-Identifier: Apache-2.0 // +// TODO: Trim qualified paths in this crate, then drop this expectation. +#![expect(clippy::absolute_paths)] + // Custom harness to run performance tests mod micro_bench_block; mod performance_tests; diff --git a/serial_buffer/src/lib.rs b/serial_buffer/src/lib.rs index b0fda8dbb..6536715ea 100644 --- a/serial_buffer/src/lib.rs +++ b/serial_buffer/src/lib.rs @@ -116,6 +116,8 @@ impl Write for SerialBuffer { } #[cfg(test)] +// TODO: Trim qualified paths in these tests, then drop this expectation. +#[expect(clippy::absolute_paths)] mod tests { use std::io::Write; use std::sync::atomic::{AtomicBool, Ordering}; diff --git a/test_infra/src/lib.rs b/test_infra/src/lib.rs index e942ea852..55deb35cb 100644 --- a/test_infra/src/lib.rs +++ b/test_infra/src/lib.rs @@ -4,6 +4,8 @@ // #![allow(clippy::undocumented_unsafe_blocks)] +// TODO: Trim qualified paths in this crate, then drop this expectation. +#![expect(clippy::absolute_paths)] use std::collections::HashMap; use std::ffi::OsStr; diff --git a/tpm/src/lib.rs b/tpm/src/lib.rs index ad021b350..954636c66 100644 --- a/tpm/src/lib.rs +++ b/tpm/src/lib.rs @@ -3,6 +3,9 @@ // SPDX-License-Identifier: Apache-2.0 // +// TODO: Trim qualified paths in this crate, then drop this expectation. +#![expect(clippy::absolute_paths)] + pub mod emulator; pub mod socket; diff --git a/virtio-devices/src/lib.rs b/virtio-devices/src/lib.rs index 6cd0711bd..1d6d3e07c 100644 --- a/virtio-devices/src/lib.rs +++ b/virtio-devices/src/lib.rs @@ -10,6 +10,9 @@ //! Implements virtio devices, queues, and transport mechanisms. +// TODO: Trim qualified paths in this crate, then drop this expectation. +#![expect(clippy::absolute_paths)] + use std::io; use std::sync::atomic::{AtomicU8, Ordering}; diff --git a/vm-migration/src/lib.rs b/vm-migration/src/lib.rs index c163661de..c2d64de6e 100644 --- a/vm-migration/src/lib.rs +++ b/vm-migration/src/lib.rs @@ -3,6 +3,9 @@ // SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause // +// TODO: Trim qualified paths in this crate, then drop this expectation. +#![expect(clippy::absolute_paths)] + use std::collections::BTreeMap; use std::{io, result}; diff --git a/vmm/src/lib.rs b/vmm/src/lib.rs index 18e420581..40d5a2b52 100644 --- a/vmm/src/lib.rs +++ b/vmm/src/lib.rs @@ -3,6 +3,9 @@ // SPDX-License-Identifier: Apache-2.0 // +// TODO: Trim qualified paths in this crate, then drop this expectation. +#![expect(clippy::absolute_paths)] + use std::collections::HashMap; use std::fs::File; use std::io::{Read, Write, stdout};